about summary refs log tree commit diff
path: root/home/wm/sway
diff options
context:
space:
mode:
Diffstat (limited to 'home/wm/sway')
-rw-r--r--home/wm/sway/default.nix31
1 files changed, 27 insertions, 4 deletions
diff --git a/home/wm/sway/default.nix b/home/wm/sway/default.nix
index 5a69d75..ba70992 100644
--- a/home/wm/sway/default.nix
+++ b/home/wm/sway/default.nix
@@ -37,6 +37,7 @@ in {
           size = 10.0;
         };
         keybindings = lib.mkOptionDefault {
+          # control the volume
           "XF86AudioRaiseVolume" =
             "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
           "XF86AudioLowerVolume" =
@@ -45,20 +46,40 @@ in {
             "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
           "XF86AudioMicMute" =
             "exec ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
+
+          # control brightness
           "XF86MonBrightnessDown" =
             "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-";
           "XF86MonBrightnessUp" =
             "exec ${pkgs.brightnessctl}/bin/brightnessctl set +5%";
+
+          # logout
           "${modifier}+Escape" = "exec ${pkgs.wlogout}/bin/wlogout";
+
+          # screenshot
           "${modifier}+s" =
             "exec ${pkgs.grim}/bin/grim $(xdg-user-dir DOCUMENTS)/screenshots/$(date +'%Y-%m-%d-%H%M%S_screenshot.png')";
           "${modifier}+Shift+s" =
             "exec ${pkgs.slurp}/bin/slurp | ${pkgs.grim}/bin/grim -g - $(xdg-user-dir DOCUMENTS)/screenshots/$(date +'%Y-%m-%d-%H%M%S_screenshot.png')";
+
+          # File Manager
+          "${modifier}+p" = "exec ${pkgs.pcmanfm}/bin/pcmanfm";
         };
-        window.commands = [{
-          command = "floating enable";
-          criteria.app_id = "pavucontrol";
-        }];
+
+        # use `swaymsg -t get_tree' to get the title/name/ID of the applications
+        window = {
+          commands = [
+            {
+              criteria.class = ".blueman-manager-wrapped";
+              command = "floating enable";
+            }
+            {
+              criteria.class = "Pavucontrol";
+              command = "floating enable";
+            }
+          ];
+        };
+
         input = {
           "*" = {
             "xkb_layout" = "us,fr";
@@ -66,12 +87,14 @@ in {
             "xkb_options" = "ctrl:nocaps,grp:shift_caps_toggle";
           };
         };
+
         assigns = {
           "1" = [{ app_id = "emacs"; }];
           "2" = [{ app_id = "Alacritty"; }];
           "3" = [{ app_id = "firefox"; }];
           "4" = [{ class = "Element"; }];
         };
+
         output = {
           "*" = {
             scale = "1.5";