From 1a096662e1bb92b20fd61c368b6889607bc70b72 Mon Sep 17 00:00:00 2001 From: Jimbo Date: Tue, 1 Oct 2024 18:18:26 -0400 Subject: [PATCH] Make gnome keyring work --- home/misc/useful.nix | 2 +- home/sway/autostart.nix | 2 +- home/sway/hotkeys.nix | 3 +-- home/sway/rules.nix | 2 +- home/sway/swayshot.nix | 36 ++++++------------------------- system/desktop.nix | 1 + system/lenovo.nix | 1 + system/pinebook.nix | 2 +- system/services/gnome-keyring.nix | 3 +++ 9 files changed, 16 insertions(+), 36 deletions(-) create mode 100644 system/services/gnome-keyring.nix diff --git a/home/misc/useful.nix b/home/misc/useful.nix index cc9b824..e6f4d7f 100644 --- a/home/misc/useful.nix +++ b/home/misc/useful.nix @@ -4,7 +4,7 @@ qbittorrent libreoffice-fresh vesktop - element-desktop + fractal ffmpegthumbnailer thunderbird protonvpn-cli_2 diff --git a/home/sway/autostart.nix b/home/sway/autostart.nix index b1e7374..7de28da 100644 --- a/home/sway/autostart.nix +++ b/home/sway/autostart.nix @@ -25,7 +25,7 @@ # Foreground apps {command = "librewolf -P Misc --name=MiscBrowser";} {command = "vesktop";} - {command = "element-desktop";} + {command = "fractal";} {command = "thunderbird";} ]; }; diff --git a/home/sway/hotkeys.nix b/home/sway/hotkeys.nix index 4191b3f..84756de 100644 --- a/home/sway/hotkeys.nix +++ b/home/sway/hotkeys.nix @@ -139,8 +139,7 @@ # Screenshots "Print" = ''exec swayshot --swappy''; "${primeMod}+Shift+f" = ''exec swayshot --swappy''; - "Shift+Print" = ''exec swayshot --current''; - "Ctrl+Print" = ''exec swayshot --all''; + "Shift+Print" = ''exec swayshot --screen''; # Server SSH "${primeMod}+Ctrl+Return" = ''exec foot ssh ${outputs.ips.server} -p 2222''; diff --git a/home/sway/rules.nix b/home/sway/rules.nix index 1c2854e..992619a 100644 --- a/home/sway/rules.nix +++ b/home/sway/rules.nix @@ -118,7 +118,7 @@ # Communication "${outputs.ws.w3a}" = [{class = "zoom";}]; "${outputs.ws.w7}" = [{app_id = "MiscBrowser";} {app_id = "vesktop";} {class = "vesktop";}]; - "${outputs.ws.w8}" = [{app_id = "Element";} {class = "Element";}]; + "${outputs.ws.w8}" = [{app_id = "org.gnome.Fractal";}]; "${outputs.ws.w9}" = [{app_id = "thunderbird";}]; # Else diff --git a/home/sway/swayshot.nix b/home/sway/swayshot.nix index f1768f8..4d01872 100644 --- a/home/sway/swayshot.nix +++ b/home/sway/swayshot.nix @@ -5,7 +5,7 @@ # Swappy handle_swappy() { # Create an imv window to act as a static screen - grim -t jpeg - | imv -w "GlobalShot" - & imv_pid=$! + grim -t jpeg -q 90 - | imv -w "GlobalShot" - & imv_pid=$! # Capture the screenshot of the selected area and save to a temporary file selected_area=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"'\ @@ -23,8 +23,8 @@ rm "$temp_file" } - # Current - handle_current() { + # Screen + handle_screen() { # Take a screenshot and save it to the temporary file temp_file=$(mktemp -u).png grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') "$temp_file" @@ -45,37 +45,13 @@ fi } - # All screens - handle_all() { - # Take a screenshot and save it to the temporary file - temp_file=$(mktemp -u).png - grim -t jpeg "$temp_file" - - # Check if the screenshot was successfully taken - if [ $? -eq 0 ]; then - # Copy the screenshot to the clipboard - wl-copy < "$temp_file" - - # Show a notification with the screenshot - notify-send -i "$temp_file" "All screen copied." - - # Remove the temporary file - rm "$temp_file" - else - # If the screenshot capture failed, show an error notification - notify-send "Error: Unable to capture screenshot." - fi - } - # Check for command-line arguments if [ "$1" == "--swappy" ]; then handle_swappy - elif [ "$1" == "--current" ]; then - handle_current - elif [ "$1" == "--all" ]; then - handle_all + elif [ "$1" == "--screen" ]; then + handle_screen else - echo "Please use the arguments swappy, current, or all." + echo "Please use the arguments --swappy or --screen." fi ''; in with pkgs; [ diff --git a/system/desktop.nix b/system/desktop.nix index 5953af9..da87531 100644 --- a/system/desktop.nix +++ b/system/desktop.nix @@ -33,6 +33,7 @@ # Services ./services/openssh.nix + ./services/gnome-keyring.nix ./services/qemukvm.nix #./services/waydroid.nix ./services/udev.nix diff --git a/system/lenovo.nix b/system/lenovo.nix index a60bcfb..57c8e65 100644 --- a/system/lenovo.nix +++ b/system/lenovo.nix @@ -33,6 +33,7 @@ # Services ./services/openssh.nix + ./services/gnome-keyring.nix ./services/udev.nix ./services/mpd.nix ]; diff --git a/system/pinebook.nix b/system/pinebook.nix index 40efa76..500c773 100644 --- a/system/pinebook.nix +++ b/system/pinebook.nix @@ -34,7 +34,7 @@ # Services ./services/openssh.nix - ./services/udev.nix + ./services/gnome-keyring.nix ./services/mpd.nix ]; diff --git a/system/services/gnome-keyring.nix b/system/services/gnome-keyring.nix new file mode 100644 index 0000000..9dd1656 --- /dev/null +++ b/system/services/gnome-keyring.nix @@ -0,0 +1,3 @@ +{ + services.gnome.gnome-keyring.enable = true; +}