Prechádzať zdrojové kódy

Finally fix screenshots

Johan Rong 3 mesiacov pred
rodič
commit
a296090d67

+ 3 - 0
home/features/desktop/sway/default.nix

@@ -15,5 +15,8 @@
 
   home.packages = with pkgs; [
     material-symbols
+    grim
+    slurp
+    swappy
   ];
 }

+ 10 - 0
home/features/desktop/sway/scripts.nix

@@ -113,6 +113,16 @@
         '';
         executable = true;
       };
+      screenshot = {
+        target = "Scripts/ss.sh";
+        text = ''
+          FILE=~/Pictures/Screenshots/$(date +%F_%T).png
+          grim -g "$(slurp)" "$FILE"
+          wl-copy < "$FILE"
+          swappy -f "$FILE"
+        '';
+        executable = true;
+      };
       #futhark-xkb = {
       #  target = ".config/xkb/symbols/futhark";
       #  text = ''

+ 2 - 3
home/features/desktop/sway/sway.nix

@@ -178,8 +178,8 @@ in
         "${super}+s" = "exec spotify";
         "${super}+d" = "exec discord";
 
-        "${super}+v" = "exec cliphist list | rofi -dmenu | cliphist decode | wl-copy";
-        "${super}+Shift+s" = "exec flameshot gui";
+        "${super}+v" = "exec cliphist list | wofi --dmenu | cliphist decode | wl-copy";
+        "${super}+Shift+s" = ''exec $HOME/Scripts/ss.sh'';
         "${super}+Shift+c" = "exec hyprpicker --autocopy";
 
         # Scripts
@@ -237,7 +237,6 @@ in
       workspace 14 output HDMI-A-1
 
       exec wl-paste --watch cliphist store
-      exec flameshot
 
       seat seat0 xcursor_theme Notwaita-Black 20
 

+ 1 - 1
home/features/desktop/sway/ui/wofi/style.nix

@@ -13,7 +13,7 @@
     window {
       background-color: rgba(10,1,1,0.999);
 
-      border-radius: 12px;
+      /*border-radius: 12px;*/
       margin: 0px;
     }
 

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

@@ -25,7 +25,6 @@
     pkg-config
     kdePackages.qt6ct
     lxqt.lxqt-policykit
-    xdg-desktop-portal-wlr
     neovim
     google-fonts
     ffmpeg_7-full

+ 16 - 1
nixos/flavors/desktop/sway/default.nix

@@ -9,7 +9,6 @@
     wl-clipboard
     mission-center
     hyprpicker
-    flameshot
     nomacs
     gammastep
     geoclue2
@@ -34,6 +33,22 @@
     XDG_SESSION_TYPE = "wayland";
   };
 
+  xdg.portal = {
+    enable = true;
+
+    wlr.enable = true;
+
+    extraPortals = with pkgs; [
+      xdg-desktop-portal-wlr
+    ];
+  };
+
+  environment.sessionVariables = {
+    NIXOS_OZONE_WL = "1";
+    QT_QPA_PLATFORM = "wayland";
+    XDG_CURRENT_DESKTOP = "sway";
+  };
+
   security.pam.services.swaylock = {};
   services.gnome.gnome-keyring.enable = true;
   security.pam.services.login.enableGnomeKeyring = true;