apps.nix (6414B)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | _: { config, lib, pkgs, osConfig ? null, ... }: lib.mkIf (osConfig != null) ( let lua = import ./_lib.nix lib; inherit (lua) combo bind exec env on permission; inherit (osConfig.gui) display; inherit (config.stylix) cursor; hyprcursor = "${cursor.name}-Hyprcursor"; mod = "SUPER"; unit = command: lib.head (lib.splitString " " command); toggle = app: "pkill ${app} || uwsm app -u ${app}.scope -- ${app}"; runOnce = app: "pgrep ${app} || uwsm app -u ${app}.scope -- ${app}"; in { ## App Environment # Cursor xdg.dataFile."icons/${hyprcursor}".source = "${cursor.package}/share/icons/${hyprcursor}"; wayland.windowManager.hyprland.settings = { env = [ (env "HYPRCURSOR_THEME" hyprcursor) (env "HYPRCURSOR_SIZE" (toString cursor.size)) # QT Apps (env "QT_WAYLAND_DISABLE_WINDOWDECORATION" "1") ]; ## Autostart on = [ (on "hyprland.start" ("function() " + lib.concatStringsSep " " (map (c: ''hl.exec_cmd("${c}");'') ( [ "uwsm finalize" "hyprctl setcursor ${hyprcursor} ${toString cursor.size}" ] ++ (map (app: "uwsm app -t service -u ${unit app}.service -- ${app}") [ # Pyprland "pypr" # Desktop Icons "pcmanfm-qt --desktop" ]) )) + " end")) ]; ## Shortcuts bind = [ # Applications (bind (combo [mod] "F") (exec "nemo")) (bind (combo [mod] "T") (exec "kitty")) (bind (combo [mod] "W") (exec "firefox")) (bind (combo [mod] "Return") (exec (runOnce "resources"))) (bind (combo [mod "SHIFT"] "equal") (exec "pypr toggle calc")) (bind (combo [] "XF86Calculator") (exec "qalculate-gtk")) # Utilities (bind (combo [mod] "A") (exec "noctalia msg panel-toggle launcher")) (bind (combo [mod] "slash") (exec "${toggle "kebihelp"} show -a")) (bind (combo [mod "SHIFT"] "C") (exec "${runOnce "hyprpicker"} -arf hex")) (bind (combo [mod "SHIFT"] "B") (exec (runOnce "overskride"))) (bind (combo [mod] "D") (exec (runOnce "nwg-displays"))) (bind (combo [mod "SHIFT"] "P") (exec "pwvucontrol")) (bind (combo [mod "SHIFT"] "N") (exec "sh -c 'env XDG_CURRENT_DESKTOP=GNOME gnome-control-center wifi'")) (bind (combo [mod] "Escape") (exec "noctalia msg panel-toggle session")) # Shell (bind (combo [mod "SHIFT"] "A") (exec "noctalia msg settings-toggle")) (bind (combo [mod] "Tab") (exec "noctalia msg window-switcher")) (bind (combo [mod] "N") (exec "noctalia msg panel-toggle notifications")) (bind (combo [mod] "V") (exec "noctalia msg panel-toggle clipboard")) # Tools (bind (combo [mod] "G") (exec "hyprutils gamemode")) (bind (combo [mod "SHIFT"] "D") (exec "hyprutils toggle monitor ${display}")) (bind (combo [mod] "S") (exec "hyprutils toggle shader")) (bind (combo [mod "SHIFT"] "T") (exec "pypr toggle term")) ]; ## Permissions permission = [ (permission "${osConfig.programs.hyprland.portalPackage}/libexec/.xdg-desktop-portal-hyprland-wrapped" "screencopy" "allow") (permission (lib.getExe pkgs.gpu-screen-recorder) "screencopy" "allow") (permission (lib.getExe pkgs.wl-screenrec) "screencopy" "allow") ]; ## Layer Rules layer_rule = [ { match.namespace = "^(hyprpicker)$"; no_anim = true; } { match.namespace = "^(noctalia-.*)$"; blur = true; ignore_alpha = 0.6; } { match.namespace = "^(noctalia-wallpaper)$"; order = 1; } { match.namespace = "^(desktop)$"; order = 0; } ]; ## Window Rules window_rule = [ # Settings { match.class = "^(gnome-control-center)$"; stay_focused = true; } # Keybinds Viewer { match.title = "^(Kebihelp)$"; pin = true; stay_focused = true; opacity = "0.9 override"; } # Browser Windows { match.title = "^(Picture-in-[P|p]icture)$"; float = true; } { match.title = "^(Sharing Indicator)$"; workspace = "special silent"; } { match.title = "^(.*is sharing (your screen|a window).)$"; workspace = "special silent"; } # Media Consumption { match.class = "^(mpv|.*celluloid.*|.+exe)$"; idle_inhibit = "focus"; } { match = { class = "^(firefox|brave-browser)$"; title = "^(.*YouTube.*)$"; }; idle_inhibit = "focus"; } { match.class = "^(firefox|brave-browser)$"; idle_inhibit = "fullscreen"; } # Screen Tearing { match.class = "^(.+exe)$"; immediate = true; } # Prompt Windows { match.class = "^(xdg-desktop-portal-gtk)$"; float = true; dim_around = true; } ] ++ (map (class: { # Authentication match.class = "^(${class})$"; pin = true; dim_around = true; stay_focused = true; }) [ "pinentry-" "gcr-prompter" ]) ++ (map (class: { # Utilities match.class = "^(${class})$"; float = true; pin = true; persistent_size = true; }) [ "com.saivert.pwvucontrol" "io.github.kaii_lb.Overskride" "nwg-displays" "gnome-control-center" "org.gnome.Settings" ]) ++ (map (title: { # Dialogs match.title = "^(${title})(.*)$"; float = true; }) [ "Library" "Open File" "Open Folder" "Save As" "Save File" "Select a File" ".*Properties" ]); }; } ) |