[Init]
This commit is contained in:
		
							
								
								
									
										93
									
								
								home/wayland/default.nix
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										93
									
								
								home/wayland/default.nix
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,93 @@
 | 
			
		||||
{
 | 
			
		||||
  pkgs,
 | 
			
		||||
  ...
 | 
			
		||||
}:
 | 
			
		||||
 | 
			
		||||
let 
 | 
			
		||||
  dbus-hyprland-environment = pkgs.writeTextFile {
 | 
			
		||||
    name = "dbus-hyprland-environment";
 | 
			
		||||
    destination = "/bin/dbus-hyprland-environment";
 | 
			
		||||
    executable = true;
 | 
			
		||||
    text = ''
 | 
			
		||||
      dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=hyprland
 | 
			
		||||
      systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
 | 
			
		||||
      systemctl --user start pipewire wireplumber pipewire-media-session xdg-desktop-portal xdg-desktop-portal-hyprland
 | 
			
		||||
    '';
 | 
			
		||||
  };
 | 
			
		||||
  in
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
  imports = [
 | 
			
		||||
   ../../modules/greetd.nix 
 | 
			
		||||
  ];
 | 
			
		||||
  
 | 
			
		||||
  environment.systemPackages = with pkgs; [
 | 
			
		||||
    dbus-hyprland-environment
 | 
			
		||||
    xdg-user-dirs
 | 
			
		||||
    wayland
 | 
			
		||||
    grim
 | 
			
		||||
    slurp
 | 
			
		||||
    swappy
 | 
			
		||||
    cliphist
 | 
			
		||||
    wl-clipboard
 | 
			
		||||
    wlogout
 | 
			
		||||
    wlr-randr
 | 
			
		||||
    wdisplays
 | 
			
		||||
    kanshi
 | 
			
		||||
    glib
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  services.dbus.enable = true;
 | 
			
		||||
  xdg.portal = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    wlr.enable = true;
 | 
			
		||||
    extraPortals = with pkgs; [
 | 
			
		||||
      xdg-desktop-portal-hyprland
 | 
			
		||||
      xdg-desktop-portal
 | 
			
		||||
    ];
 | 
			
		||||
 };
 | 
			
		||||
 | 
			
		||||
  programs.xwayland.enable = true;
 | 
			
		||||
 | 
			
		||||
  environment.sessionVariables = rec {
 | 
			
		||||
    GBM_BACKEND = "amd-drm";
 | 
			
		||||
    __GL_GSYNC_ALLOWED = "0";
 | 
			
		||||
    __GL_VRR_ALLOWED = "0";
 | 
			
		||||
    WLR_DRM_NO_ATOMIC = "1";
 | 
			
		||||
    __GLX_VENDOR_LIBRARY_NAME = "amd";
 | 
			
		||||
    _JAVA_AWT_WM_NONREPARENTING = "1";
 | 
			
		||||
    QT_QPA_PLATFORM = "wayland";
 | 
			
		||||
    QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
 | 
			
		||||
    GDK_BACKEND = "wayland";
 | 
			
		||||
    WLR_NO_HARDWARE_CURSORS = "1";
 | 
			
		||||
    MOZ_ENABLE_WAYLAND = "1";
 | 
			
		||||
    WLR_BACKEND = "vulkan";
 | 
			
		||||
    WLR_RENDERER = "vulkan";
 | 
			
		||||
    XCURSOR_SIZE = "24";
 | 
			
		||||
    NIXOS_OZONE_WL = "1";
 | 
			
		||||
    PATH = [
 | 
			
		||||
      "$HOME/.local/bin/:$PATH"
 | 
			
		||||
    ];
 | 
			
		||||
    XDG_CACHE_HOME  = "$HOME/.cache";
 | 
			
		||||
    XDG_CONFIG_HOME = "$HOME/.config";
 | 
			
		||||
    XDG_DATA_HOME   = "$HOME/.local/share";
 | 
			
		||||
    XDG_STATE_HOME  = "$HOME/.local/state";
 | 
			
		||||
    XDG_BIN_HOME    = "$HOME/.local/bin";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  environment.etc."greetd/environments".text = ''
 | 
			
		||||
    Hyprland
 | 
			
		||||
  '';
 | 
			
		||||
 | 
			
		||||
  environment.etc."xdg/user-dirs.defaults".text = ''
 | 
			
		||||
    XDG_DESKTOP_DIR="$HOME/desktop"
 | 
			
		||||
    XDG_DOCUMENTS_DIR="$HOME/files"
 | 
			
		||||
    XDG_DOWNLOAD_DIR="$HOME/download"
 | 
			
		||||
    XDG_MUSIC_DIR="$HOME/media/music"
 | 
			
		||||
    XDG_PICTURES_DIR="$HOME/media/photo"
 | 
			
		||||
    XDG_PUBLICSHARE_DIR="$HOME/pub"
 | 
			
		||||
    XDG_TEMPLATES_DIR="$HOME/media/templates"
 | 
			
		||||
    XDG_VIDEOS_DIR="$HOME/media/video"
 | 
			
		||||
  '';
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										230
									
								
								home/wayland/hyprland/config.nix
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										230
									
								
								home/wayland/hyprland/config.nix
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,230 @@
 | 
			
		||||
{
 | 
			
		||||
    config,
 | 
			
		||||
    ...
 | 
			
		||||
}: {
 | 
			
		||||
    wayland.windowManager.hyprland.extraConfig = ''
 | 
			
		||||
 | 
			
		||||
monitor=,preferred,auto,1
 | 
			
		||||
#monitor = HDMI-A-1,1920x1080,5760x0,1 #right
 | 
			
		||||
#monitor = DP-2,1920x1080,1920x0,1 #left
 | 
			
		||||
#monitor = DP-3,1920x1080@144,3840x0,1 #middle
 | 
			
		||||
 | 
			
		||||
input {
 | 
			
		||||
    kb_layout = us, ru
 | 
			
		||||
    kb_variant = intl, phonetic
 | 
			
		||||
    kb_model = pc104
 | 
			
		||||
    kb_options = grp:ctrls_toggle
 | 
			
		||||
    kb_rules =
 | 
			
		||||
 | 
			
		||||
    follow_mouse = 0
 | 
			
		||||
 | 
			
		||||
    sensitivity = 0 # -0.5 # -1.0 - 1.0, 0 means no modification.
 | 
			
		||||
    force_no_accel = true
 | 
			
		||||
 | 
			
		||||
    touchpad {
 | 
			
		||||
        natural_scroll=no
 | 
			
		||||
        disable_while_typing=true
 | 
			
		||||
        scroll_factor=1
 | 
			
		||||
        disable_while_typing=0
 | 
			
		||||
        tap-to-click=0
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
misc {
 | 
			
		||||
    disable_hyprland_logo=true
 | 
			
		||||
    animate_mouse_windowdragging=false
 | 
			
		||||
    animate_manual_resizes=false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
general {
 | 
			
		||||
    gaps_in = 8
 | 
			
		||||
    gaps_out = 15
 | 
			
		||||
    border_size = 2
 | 
			
		||||
    col.active_border = rgb(${config.colorScheme.colors.base05})
 | 
			
		||||
    col.inactive_border = rgb(${config.colorScheme.colors.base03})
 | 
			
		||||
 | 
			
		||||
    col.group_border_active = rgb(${config.colorScheme.colors.base05})
 | 
			
		||||
    col.group_border = rgb(${config.colorScheme.colors.base03})
 | 
			
		||||
 | 
			
		||||
    layout = dwindle
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
decoration {
 | 
			
		||||
    rounding = 7
 | 
			
		||||
 | 
			
		||||
    #blur
 | 
			
		||||
    blur = yes
 | 
			
		||||
    blur_size = 2
 | 
			
		||||
    blur_passes = 1
 | 
			
		||||
    blur_new_optimizations = on
 | 
			
		||||
    multisample_edges = true
 | 
			
		||||
    
 | 
			
		||||
    #opactity
 | 
			
		||||
    inactive_opacity = 1.0
 | 
			
		||||
    active_opacity = 1.0
 | 
			
		||||
    fullscreen_opacity = 1.0
 | 
			
		||||
    
 | 
			
		||||
    # shadow
 | 
			
		||||
    drop_shadow = no
 | 
			
		||||
    shadow_range = 60
 | 
			
		||||
    shadow_offset = 0 5
 | 
			
		||||
    shadow_render_power = 4
 | 
			
		||||
    col.shadow = rgba(00000099)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
animations {
 | 
			
		||||
    enabled = false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dwindle {
 | 
			
		||||
    pseudotile = yes
 | 
			
		||||
    # force_split = 0
 | 
			
		||||
    preserve_split = yes 
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
master {
 | 
			
		||||
    new_is_master = true
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gestures {
 | 
			
		||||
    workspace_swipe = off
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exec-once = eww open bar & dunst
 | 
			
		||||
 | 
			
		||||
exec-once = swww init
 | 
			
		||||
 | 
			
		||||
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
 | 
			
		||||
exec-once = /nix/store/$(ls -la /nix/store | grep 'polkit-gnome' | grep '4096' | awk '{print $9}' | sed -n '$p')/libexec/polkit-gnome-authentication-agent-1 & 
 | 
			
		||||
 | 
			
		||||
exec-once = wl-paste --type text --watch cliphist store #Stores only text data
 | 
			
		||||
exec-once = wl-paste --type image --watch cliphist store #Stores only image data
 | 
			
		||||
 | 
			
		||||
exec-once = swayidle -w timeout 600 'swaylock' before-sleep 'swaylock'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#windowrules
 | 
			
		||||
windowrulev2 = noshadow, floating:0
 | 
			
		||||
 | 
			
		||||
windowrulev2 = float, title:^(flying_kitty)$
 | 
			
		||||
windowrulev2 = size 1100 600, title:^(flying_kitty)$
 | 
			
		||||
windowrulev2 = move center, title:^(flying_kitty)$
 | 
			
		||||
windowrulev2 = animation slide, title:^(flying_kitty)$
 | 
			
		||||
windowrulev2 = float, title:^(Volume Control)$
 | 
			
		||||
windowrulev2 = float, title:^(Picture-in-Picture)$
 | 
			
		||||
windowrulev2 = float, title:^(Steam)$
 | 
			
		||||
windowrulev2 = fullscreen, title:^(wlogout)$
 | 
			
		||||
windowrulev2 = float, title:^(wlogout)$
 | 
			
		||||
 | 
			
		||||
windowrulev2 = workspace 2 silent, class:^(org.telegram.desktop)$
 | 
			
		||||
windowrulev2 = workspace 2 silent, class:^(discord)$
 | 
			
		||||
 | 
			
		||||
windowrulev2 = workspace 8 silent, class:^(org.keepassxc.KeePassXC)$
 | 
			
		||||
windowrulev2 = workspace 8 silent, title:^(Nextcloud)$
 | 
			
		||||
windowrulev2 = workspace 8 silent, class:^(Tk)$,title:^(Server Configuration)$
 | 
			
		||||
 | 
			
		||||
#SPECIAL FLOATERS
 | 
			
		||||
windowrulev2 = float,class:^(org.keepassxc.KeePassXC)$,title:^(KeePassXC -  Access Request)$
 | 
			
		||||
windowrulev2 = pin,class:^(org.keepassxc.KeePassXC)$,title:^(KeePassXC -  Access Request)$
 | 
			
		||||
windowrulev2 = float,class:^(org.keepassxc.KeePassXC)$,title:^(Unlock Database - KeePassXC)$
 | 
			
		||||
windowrulev2 = pin,class:^(org.keepassxc.KeePassXC)$,title:^(Unlock Database - KeePassXC)$
 | 
			
		||||
windowrulev2 = float,title:^(Open)$
 | 
			
		||||
windowrulev2 = float,title:^(Choose Files)$
 | 
			
		||||
windowrulev2 = float,title:^(Save As)$
 | 
			
		||||
windowrulev2 = float,title:^(Confirm to replace files)$
 | 
			
		||||
windowrulev2 = float,title:^(File Operation Progress)$
 | 
			
		||||
windowrulev2 = float,class:^(firefox)$,title:^(Picture-in-Picture)$
 | 
			
		||||
windowrulev2 = pin,class:^(firefox)$,title:^(Picture-in-Picture)$
 | 
			
		||||
windowrulev2 = nofullscreenrequest,class:^(firefox)$,title:^(Picture-in-Picture)$
 | 
			
		||||
windowrulev2 = float,class:^(firefox)$,title:^(Firefox — Sharing Indicator)$
 | 
			
		||||
windowrulev2 = nofullscreenrequest,class:^(firefox)$,title:^(Firefox — Sharing Indicator)$
 | 
			
		||||
windowrulev2 = float,class:^(firefox)$,title:^(Extension: (Tree Style Tab) - Close tabs? — Mozilla Firefox)$
 | 
			
		||||
windowrulev2 = nofullscreenrequest,class:^(firefox)$,title:^(Extension: (Tree Style Tab) - Close tabs? — Mozilla Firefox)$
 | 
			
		||||
windowrulev2 = float,class:^(org.telegram.desktop)$,title:^(Media viewer)$
 | 
			
		||||
windowrulev2 = center,class:^(org.telegram.desktop)$,title:^(Media viewer)$
 | 
			
		||||
 | 
			
		||||
#binds
 | 
			
		||||
$mainMod = SUPER
 | 
			
		||||
 | 
			
		||||
bind = SUPER, RETURN, exec, kitty
 | 
			
		||||
 | 
			
		||||
bind = SUPER_SHIFT, RETURN,togglespecialworkspace,
 | 
			
		||||
# bind = SUPER_SHIFT, RETURN, exec, kitty --title flying_kitty --single-instance
 | 
			
		||||
bind = SUPER, Q, killactive, 
 | 
			
		||||
bind = SUPER, T, togglefloating, 
 | 
			
		||||
bind = SUPER, F, fullscreen, 
 | 
			
		||||
 | 
			
		||||
bind = SUPER, D, exec, wofi -modi --show drun
 | 
			
		||||
bind = SUPER SHIFT,D,exec, ~/.config/hypr/themes/apatheia/eww/launch_bar 
 | 
			
		||||
 | 
			
		||||
bind = SUPER, V, exec, cliphist list | wofi -dmenu | cliphist decode | wl-copy
 | 
			
		||||
bind =  , Print, exec, grim -g "$(slurp -d)" - | swappy -f - | wl-copy
 | 
			
		||||
 | 
			
		||||
bind = SUPER, L, exec, swaylock 
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
bind = SUPER, P, pseudo, # dwindle
 | 
			
		||||
bind = SUPER, J, togglesplit, # dwindle
 | 
			
		||||
bind = SUPER, G, togglegroup
 | 
			
		||||
bind = SUPER, tab, changegroupactive
 | 
			
		||||
 | 
			
		||||
bind = SUPER, left, movefocus, l
 | 
			
		||||
bind = SUPER, right, movefocus, r
 | 
			
		||||
bind = SUPER, up, movefocus, u
 | 
			
		||||
bind = SUPER, down, movefocus, d
 | 
			
		||||
 | 
			
		||||
bind = SUPER, 1, workspace, 1
 | 
			
		||||
bind = SUPER, 2, workspace, 2
 | 
			
		||||
bind = SUPER, 3, workspace, 3
 | 
			
		||||
bind = SUPER, 4, workspace, 4
 | 
			
		||||
bind = SUPER, 5, workspace, 5
 | 
			
		||||
bind = SUPER, 6, workspace, 6
 | 
			
		||||
bind = SUPER, 7, workspace, 7
 | 
			
		||||
bind = SUPER, 8, workspace, 8
 | 
			
		||||
bind = SUPER, 9, workspace, 9
 | 
			
		||||
bind = SUPER, 0, workspace, 10
 | 
			
		||||
 | 
			
		||||
bind = SUPER SHIFT, 1, movetoworkspace, 1
 | 
			
		||||
bind = SUPER SHIFT, 2, movetoworkspace, 2
 | 
			
		||||
bind = SUPER SHIFT, 3, movetoworkspace, 3
 | 
			
		||||
bind = SUPER SHIFT, 4, movetoworkspace, 4
 | 
			
		||||
bind = SUPER SHIFT, 5, movetoworkspace, 5
 | 
			
		||||
bind = SUPER SHIFT, 6, movetoworkspace, 6
 | 
			
		||||
bind = SUPER SHIFT, 7, movetoworkspace, 7
 | 
			
		||||
bind = SUPER SHIFT, 8, movetoworkspace, 8
 | 
			
		||||
bind = SUPER SHIFT, 9, movetoworkspace, 9
 | 
			
		||||
bind = SUPER SHIFT, 0, movetoworkspace, 10
 | 
			
		||||
 | 
			
		||||
bind = SUPER, mouse_down, workspace, e+1
 | 
			
		||||
bind = SUPER, mouse_up, workspace, e-1
 | 
			
		||||
 | 
			
		||||
bindm = SUPER, mouse:272, movewindow
 | 
			
		||||
bindm = SUPER, mouse:273, resizewindow
 | 
			
		||||
bind = , XF86AudioPlay, exec, playerctl play-pause
 | 
			
		||||
bind = , XF86AudioPrev, exec, playerctl previous
 | 
			
		||||
bind = , XF86AudioNext, exec, playerctl next
 | 
			
		||||
bind = , XF86AudioRaiseVolume, exec, amixer -q sset 'Master' 5%+
 | 
			
		||||
bind = , XF86AudioLowerVolume, exec, amixer -q sset 'Master' 5%-
 | 
			
		||||
bind = , XF86AudioMute, exec, amixer -q sset 'Master' toggle
 | 
			
		||||
bind = , XF86MonBrightnessUp, exec, brillo -A 5
 | 
			
		||||
bind = , XF86MonBrightnessDown, exec, brillo -U 5
 | 
			
		||||
 | 
			
		||||
exec-once = [workspace special silent] kitty --title flying_kitty
 | 
			
		||||
exec-once = sh ~/.config/startup.sh
 | 
			
		||||
  '';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  xdg.configFile."startup.sh".text =  ''
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
sleep 2
 | 
			
		||||
swww img ~/cloud/dark.jpg
 | 
			
		||||
keepassxc & 
 | 
			
		||||
firefox & 
 | 
			
		||||
jellyfin-mpv-shim & 
 | 
			
		||||
 | 
			
		||||
sleep 2
 | 
			
		||||
nextcloud & 
 | 
			
		||||
telegram-desktop& 
 | 
			
		||||
discord& 
 | 
			
		||||
  '';
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										10
									
								
								home/wayland/hyprland/default.nix
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										10
									
								
								home/wayland/hyprland/default.nix
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
{
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  imports = [./config.nix];
 | 
			
		||||
  
 | 
			
		||||
  wayland.windowManager.hyprland = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user