Prechádzať zdrojové kódy

move some scripts, remove some

Johan Rong 6 mesiacov pred
rodič
commit
71ceb99d3b

+ 2 - 3
home/features/application/sway/default.nix

@@ -158,9 +158,8 @@ in
           "${super}+Shift+c" = "exec hyprpicker --autocopy";
 
           # Scripts
-          "${mod}+dead_diaeresis" = "exec /storage/Scripts/rofi-audio";
-          "${mod}+Control+a" = "exec /storage/Scripts/toggle-mic-mute";
-          "${mod}+Control+s" = "exec /storage/Scripts/toggle-output-mute";
+          "${mod}+Control+a" = "exec $HOME/.config/waybar/mic-mute.sh";
+          "${mod}+Control+s" = "exec $HOME/.config/waybar/output-mute.sh";
         };
 
         window.commands = [

+ 34 - 0
home/features/application/sway/scripts.nix

@@ -42,6 +42,40 @@
         '';
         executable = true;
       };
+      mic-mute = {
+        target = ".config/waybar/mic-mute.sh";
+        text = ''
+          #!/usr/bin/env bash
+
+          # Toggle mute
+          amixer set 'Capture' toggle
+
+          # Check new state
+          if amixer get Capture | grep -q '\[off\]'; then
+            notify-send "Microphone Muted" "Your mic has been muted." -i microphone-sensitivity-muted-symbolic
+          else
+            notify-send "Microphone Unmuted" "Your mic is live." -i microphone-sensitivity-high-symbolic  
+          fi
+        '';
+        executable = true;
+      };
+      output-mute = {
+        target = ".config/waybar/output-mute.sh";
+        text = ''
+          #!/usr/bin/env bash
+
+          # Toggle mute
+          amixer set 'Master' toggle
+
+          # Check new state
+          if amixer get Master | grep -q '\[off\]'; then
+            notify-send "Master Muted" "You may no longer hear." -i audio-volume-muted-symbolic
+          else
+            notify-send "Master Unmuted" "You may hear now." -i audio-volume-high-symbolic  
+          fi
+        '';
+        executable = true;
+      };
     };
   };
 }

+ 1 - 2
nixos/features/system/basic.nix

@@ -12,11 +12,9 @@
     htop
     unzip
     seatd
-    #polkit
     libgcc
     gnumake
     gparted
-    flatpak
     dnsmasq
     pciutils
     onefetch
@@ -77,6 +75,7 @@
 
   services.seatd.enable = true;
   services.gvfs.enable = true;
+  services.flatpak.enable = true;
 
   virtualisation.libvirtd.enable = true;
   programs.virt-manager.enable = true;