dotfiles

My PC Dotfiles & Website

modules/desktop/niri/_settings/apps.nix (3082B)


  1_: {
  2  config,
  3  pkgs,
  4  lib,
  5  ...
  6}: {
  7  programs.niri.settings = {
  8    ## Autostart
  9    spawn-at-startup = let
 10      exec = app: args: [app] ++ args;
 11    in [
 12      {command = exec "pcmanfm-qt" ["--desktop"];}
 13      {command = [(lib.getExe pkgs.xwayland-satellite) ":0"];}
 14    ];
 15
 16    ## Keybindings
 17    binds = with config.lib.niri.actions; let
 18      sh = spawn "sh" "-c";
 19      runOnce = app: args: sh "pgrep ${app} || ${app} ${args}";
 20    in {
 21      # Applications
 22      "Super+F" = {
 23        action = spawn "nemo";
 24        hotkey-overlay.title = "Files";
 25      };
 26
 27      "Super+T" = {
 28        action = spawn "kitty";
 29        hotkey-overlay.title = "Terminal";
 30      };
 31
 32      "Super+W" = {
 33        action = spawn "firefox";
 34        hotkey-overlay.title = "Browser";
 35      };
 36
 37      "Super+Return" = {
 38        action = runOnce "resources" "";
 39        hotkey-overlay.title = "Task Manager";
 40      };
 41
 42      "XF86Calculator" = {
 43        action = spawn "qalculate-gtk";
 44        hotkey-overlay.title = "Calculator";
 45      };
 46
 47      # Shell
 48      "Super+A" = {
 49        action = sh "noctalia msg panel-toggle launcher";
 50        hotkey-overlay.title = "Launcher";
 51      };
 52
 53      "Super+Shift+A" = {
 54        action = sh "noctalia msg settings-toggle";
 55        hotkey-overlay.title = "Settings";
 56      };
 57
 58      "Super+N" = {
 59        action = sh "noctalia msg panel-toggle notifications";
 60        hotkey-overlay.title = "Notifications";
 61      };
 62
 63      "Super+V" = {
 64        action = sh "noctalia msg panel-toggle clipboard";
 65        hotkey-overlay.title = "Clipboard";
 66      };
 67
 68      "Super+Escape" = {
 69        action = sh "noctalia msg panel-toggle session";
 70        hotkey-overlay.title = "Power Menu";
 71      };
 72
 73      # Utilities
 74      "Super+Shift+C" = {
 75        action = runOnce "hyprpicker" "-arf hex";
 76        hotkey-overlay.title = "Color Picker";
 77      };
 78
 79      "Super+Shift+B" = {
 80        action = runOnce "overskride" "";
 81        hotkey-overlay.title = "Bluetooth Settings";
 82      };
 83
 84      "Super+Shift+N" = {
 85        action = sh "env XDG_CURRENT_DESKTOP=GNOME gnome-control-center wifi";
 86        hotkey-overlay.title = "Network Settings";
 87      };
 88
 89      "Super+Shift+P" = {
 90        action = spawn "pwvucontrol";
 91        hotkey-overlay.title = "Audio Settings";
 92      };
 93
 94      "Super+D" = {
 95        action = runOnce "nwg-displays" "";
 96        hotkey-overlay.title = "Display Settings";
 97      };
 98    };
 99
100    ## Window Rules
101    window-rules = [
102      {
103        matches = [{app-id = "qalculate-gtk";}];
104        open-floating = true;
105        default-column-width.proportion = 0.5;
106        default-window-height.proportion = 0.9;
107        default-floating-position = {
108          relative-to = "right";
109          x = 5;
110          y = 0;
111        };
112      }
113      {
114        matches = [
115          {app-id = "com.saivert.pwvucontrol";}
116          {app-id = "io.github.kaii_lb.Overskride";}
117          {app-id = "nwg-displays";}
118          {app-id = "org.gnome.Settings";}
119          {app-id = "gnome-control-center";}
120        ];
121        open-floating = true;
122      }
123    ];
124  };
125}