From 4cfee8e16be0333e0c35e19e95723f8ae2935f84 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Sun, 23 Aug 2026 08:35:34 +0200 Subject: [PATCH] feat: use grim, slurp and satty for screenshots --- config/fish/config.fish | 3 --- config/hypr/hyprland/binds/device.lua | 11 +++++------ config/hypr/hyprland/binds/groups.lua | 2 -- config/hypr/hyprland/binds/screenshot.lua | 22 +++++++++++++++------- config/hypr/hyprland/core/style.lua | 1 - requiredpkgs.txt | 3 +++ setup.sh | 3 +-- 7 files changed, 24 insertions(+), 21 deletions(-) diff --git a/config/fish/config.fish b/config/fish/config.fish index 278f610..25d368b 100755 --- a/config/fish/config.fish +++ b/config/fish/config.fish @@ -109,9 +109,6 @@ if status is-interactive echo -n $white'─'$__fish_prompt_char $normal end - # NOTE: disable `VIRTUAL_ENV_DISABLE_PROMPT` in `config.fish` - # see: https://virtualenv.pypa.io/en/latest/reference/#envvar-VIRTUAL_ENV_DISABLE_PROMPT - # support for virtual env name if set -q VIRTUAL_ENV echo -n "($turquoise"(basename "$VIRTUAL_ENV")"$white)" end diff --git a/config/hypr/hyprland/binds/device.lua b/config/hypr/hyprland/binds/device.lua index d596c16..3d1a22f 100644 --- a/config/hypr/hyprland/binds/device.lua +++ b/config/hypr/hyprland/binds/device.lua @@ -3,13 +3,12 @@ local function exit_submap() end -- TODO: Update this for laptop -hl.bind("code:232", hl.dsp.exec_cmd("brightnessctl -S"), { description = "Doesn't do anything yet" }) --- bind = ,code:232, exec, light -U 5 && notify-send 'Display brightness decreased by 5%' --- bind = ,code:233, exec, light -A 5 && notify-send 'Display brightness increased by 5%' +hl.bind("code:232", hl.dsp.exec_cmd("brightnessctl set 5%-"), { description = "Decrease screen brightness" }) +hl.bind("code:233", hl.dsp.exec_cmd("brightnessctl set +5%"), { description = "Increase screen brightness" }) -hl.bind("code:123", hl.dsp.exec_cmd("pamixer -i 5"), { description = "Increase volume by 5%" }) -hl.bind("code:122", hl.dsp.exec_cmd("pamixer -d 5"), { description = "Decrease volume by 5%" }) -hl.bind("code:121", hl.dsp.exec_cmd("pamixer t"), { description = "Open mixer" }) +hl.bind("code:123", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"), { description = "Increase volume by 5%" }) +hl.bind("code:122", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { description = "Decrease volume by 5%" }) +hl.bind("code:121", hl.dsp.exec_cmd("hyprpwcenter"), { description = "Open mixer" }) hl.define_submap("device", function() hl.bind("m", function() diff --git a/config/hypr/hyprland/binds/groups.lua b/config/hypr/hyprland/binds/groups.lua index cf3d7f2..317e012 100644 --- a/config/hypr/hyprland/binds/groups.lua +++ b/config/hypr/hyprland/binds/groups.lua @@ -5,8 +5,6 @@ end hl.bind("SUPER + SHIFT + H", hl.dsp.group.prev(), { description = "Go to previous group member" }) hl.bind("SUPER + SHIFT + L", hl.dsp.group.next(), { description = "Go to next group member" }) --- TODO: Improve mapping (also global mapping, for moving between els if to use regularly) --- Improve colours hl.define_submap("groups", function() hl.bind("c", function() hl.dispatch(hl.dsp.group.toggle()) diff --git a/config/hypr/hyprland/binds/screenshot.lua b/config/hypr/hyprland/binds/screenshot.lua index 3327bce..263a460 100644 --- a/config/hypr/hyprland/binds/screenshot.lua +++ b/config/hypr/hyprland/binds/screenshot.lua @@ -4,32 +4,40 @@ end hl.define_submap("screenshot", function() hl.bind("y", function() - hl.dispatch(hl.dsp.exec_cmd("dms screenshot --no-file")) + hl.dispatch(hl.dsp.exec_cmd('grim -g "$(slurp -d)" - | wl-copy')) exit_submap() - end, { description = "Take sceenshot of are and Yank" }) + end, { description = "Take sceenshot of area and Yank" }) hl.bind("c", function() - hl.dispatch(hl.dsp.exec_cmd("dms screenshot")) + hl.dispatch( + hl.dsp.exec_cmd( + 'grim -g "$(slurp -d)" - | satty -f - --copy-command wl-copy -o "~/Pictures/Screenshots/%Y-%m-%dT%H:%M:%SZ%z.png"' + ) + ) exit_submap() end, { description = "Take screenshot of area, yank and save" }) hl.bind("s", function() - hl.dispatch(hl.dsp.exec_cmd("dms screenshot --no-clipboard")) + hl.dispatch(hl.dsp.exec_cmd("grim -g '$(slurp -d)' $(xdg-user-dir PICTURES)/Screenshots/$(date +'%Y-%m-%dT%H:%M:%SZ%z.png')")) exit_submap() end, { description = "Take screenshot of area and Save" }) hl.bind("SHIFT + y", function() - hl.dispatch(hl.dsp.exec_cmd("dms screenshot full --no-file")) + hl.dispatch(hl.dsp.exec_cmd("grim - | wl-copy")) exit_submap() end, { description = "Take screenshot and Yank" }) hl.bind("SHIFT + c", function() - hl.dispatch(hl.dsp.exec_cmd("dms screenshot full")) + hl.dispatch( + hl.dsp.exec_cmd( + 'grim - | satty -f - --copy-command wl-copy -o "~/Pictures/Screenshots/%Y-%m-%dT%H:%M:%SZ%z.png"' + ) + ) exit_submap() end, { description = "Take sceenshot, yank and save" }) hl.bind("SHIFT + s", function() - hl.dispatch(hl.dsp.exec_cmd("dms screenshot full --no-clipboard")) + hl.dispatch(hl.dsp.exec_cmd("grim $(xdg-user-dir PICTURES)/Screenshots/$(date +'%Y-%m-%dT%H:%M:%SZ%z.png')")) exit_submap() end, { description = "Take screenshot and Save" }) diff --git a/config/hypr/hyprland/core/style.lua b/config/hypr/hyprland/core/style.lua index 8c5a0a2..03b5b33 100644 --- a/config/hypr/hyprland/core/style.lua +++ b/config/hypr/hyprland/core/style.lua @@ -18,7 +18,6 @@ hl.config({ dim_inactive = true, dim_strength = 0.1, - -- TODO: Consider adding glow? }, animations = { enabled = true, diff --git a/requiredpkgs.txt b/requiredpkgs.txt index ccb5362..e8632a3 100644 --- a/requiredpkgs.txt +++ b/requiredpkgs.txt @@ -21,3 +21,6 @@ rga resvg wl-clipboard nextcloud-client +slurp +grim +satty diff --git a/setup.sh b/setup.sh index 99873de..26a1a3a 100755 --- a/setup.sh +++ b/setup.sh @@ -9,8 +9,7 @@ echo " ( )_| | \___/ - => Migration to V4 - -> WARNING: This will remove the old configurations from the system + => Setup + Theming script <= " # ┌ ┐