Commit 838c2d959c53

Vincent Demeester <vincent@sbr.pm>
2022-08-22 10:49:44
users/vincent: sway scratchpad and emacs pgtk
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent dbb9b43
Changed files (2)
users
vincent
users/vincent/desktop/sway.nix
@@ -137,10 +137,16 @@ in
           criteria.class = "Spotify";
         }
         {
-          command = "move to scratchpad";
+          command = "move to scratchpad, scratchpad show";
           criteria = {
-            app_id = "kitty";
-            class = "metask";
+            app_id = "metask";
+          };
+        }
+        {
+          command = "move to scratchpad, scratchpad show";
+          criteria = {
+            app_id = "emacs";
+            title = "^_emacs scratchpad_$";
           };
         }
       ];
@@ -148,8 +154,8 @@ in
         { command = "mako"; }
         { command = "${pkgs.networkmanagerapplet}/bin/nm-applet --indicator"; }
         { command = "systemctl --user restart waybar"; always = true; }
-        { command = "${pkgs.kitty}/bin/kitty --title metask --class metask tmux"; }
-        { command = ''emacsclient -n -c -F "((name . \"_emacs scratchpad_\"))''; }
+        # { command = "${pkgs.kitty}/bin/kitty --title metask --class metask tmux"; }
+        # { command = ''emacsclient -n -c -F "((name . \"_emacs scratchpad_\"))''; }
       ];
     };
     extraConfig =
@@ -187,6 +193,12 @@ in
         bindsym XF86AudioLowerVolume exec ${pkgs.pamixer}/bin/pamixer -ud 5 && ${pkgs.pamixer}/bin/pamixer --get-volume > $SWAYSOCK.wob
         bindsym XF86AudioMute exec ${pkgs.pamixer}/bin/pamixer --toggle-mute && ( ${pkgs.pamixer}/bin/pamixer --get-mute && echo 0 > $SWAYSOCK.wob ) || ${pkgs.pamixer}/bin/pamixer --get-volume > $SWAYSOCK.wob
 
+        bindsym XF86AudioPlay exec "playerctl play-pause"
+        bindsym XF86AudioNext exec "playerctl next"
+        bindsym XF86AudioPrev exec "playerctl previous"
+
+        bindcode ${mod}+49 exec swaymsg [app_id="metask"] scratchpad show || exec ${pkgs.kitty}/bin/kitty --title metask --class metask tmux
+        bindcode ${mod}+Shift+49 exec swaymsg '[app_id="emacs" title="^_emacs scratchpad_$"]' scratchpad show || exec ${config.programs.emacs.package}/bin/emacsclient -c -F "((name . \"_emacs scratchpad_\"))" 
       '';
   };
   programs = {
users/vincent/dev/emacs.nix
@@ -157,8 +157,9 @@ in
   ];
   programs.emacs = {
     enable = true;
-    # emacsPgtkNativeComp
-    package = (pkgs.emacsNativeComp.override { withGTK3 = true; withGTK2 = false; withX = true; withXwidgets = true; });
+    # FIXME: choose depending on the enabled modules
+    package = (pkgs.emacsPgtkNativeComp.override { withGTK3 = true; withGTK2 = false; });
+    # package = (pkgs.emacsNativeComp.override { withGTK3 = true; withGTK2 = false; withX = true; withXwidgets = true; });
     extraPackages = myExtraPackages;
   };
   services.emacs = {