From c6ff7b4d2c91fbc086e573e01f76da3dc3ef3ed3 Mon Sep 17 00:00:00 2001 From: Mosder Date: Sun, 2 Nov 2025 20:14:11 +0100 Subject: ✨ feat(hypr): integrate swayosd, add scripts and update keybindings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- laptop/.config/hypr/hyprland.conf | 25 ++++++++++++++--------- laptop/.config/hypr/scripts/capture-window.sh | 10 +++++++++ laptop/.config/hypr/scripts/current-brightness.sh | 4 ++++ 3 files changed, 29 insertions(+), 10 deletions(-) create mode 100755 laptop/.config/hypr/scripts/capture-window.sh create mode 100755 laptop/.config/hypr/scripts/current-brightness.sh (limited to 'laptop/.config/hypr') diff --git a/laptop/.config/hypr/hyprland.conf b/laptop/.config/hypr/hyprland.conf index 05fea03..f530b80 100644 --- a/laptop/.config/hypr/hyprland.conf +++ b/laptop/.config/hypr/hyprland.conf @@ -40,6 +40,8 @@ exec-once = $scriptsDir/randomize-wallpaper.sh exec-once = hyprpaper exec-once = hypridle exec-once = $scriptsDir/battery-notifier.sh +exec-once = udiskie +exec-once = swayosd-server # Lock after autologin in sddm, to use lockscreen as login exec-once = hyprlock @@ -187,6 +189,7 @@ master { misc { force_default_wallpaper = 1 # Set to 0 or 1 to disable the anime mascot wallpapers disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :( + middle_click_paste = false } @@ -242,6 +245,8 @@ bind = $mainMod, B, exec, $browser bind = $mainMod, D, exec, discord bind = $mainMod, I, exec, intellij-idea-ultimate-edition bind = $mainMod SHIFT, S, exec, flameshot gui +bind = , Print, exec, flameshot gui --region 1920x1080+0+0 +bind = ALT, Print, exec, $scriptsDir/capture-window.sh bind = $mainMod SHIFT, P, exec, hyprpicker -a bind = $mainMod, L, exec, hyprlock bind = $mainMod, N, exec, dunstctl close-all @@ -285,18 +290,18 @@ bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow # Laptop multimedia keys for volume and LCD brightness -bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ -bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle -bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle -bindel = ,XF86MonBrightnessUp, exec, brightnessctl set 5%+ -bindel = ,XF86MonBrightnessDown, exec, brightnessctl set 5%- +bindel = ,XF86AudioRaiseVolume, exec, swayosd-client --output-volume raise +bindel = ,XF86AudioLowerVolume, exec, swayosd-client --output-volume lower +bindel = ,XF86AudioMute, exec, swayosd-client --output-volume mute-toggle +bindel = ,XF86AudioMicMute, exec, swayosd-client --input-volume mute-toggle +bindel = ,XF86MonBrightnessUp, exec, brightnessctl set 5%+; $scriptsDir/current-brightness.sh | xargs swayosd-client --brightness +bindel = ,XF86MonBrightnessDown, exec, brightnessctl set 5%-; $scriptsDir/current-brightness.sh | xargs swayosd-client --brightness # Requires playerctl -bindl = , XF86AudioNext, exec, playerctl next -bindl = , XF86AudioPause, exec, playerctl play-pause -bindl = , XF86AudioPlay, exec, playerctl play-pause -bindl = , XF86AudioPrev, exec, playerctl previous +bindl = , XF86AudioNext, exec, swayosd-client --playerctl next +bindl = , XF86AudioPause, exec, swayosd-client --playerctl play-pause +bindl = , XF86AudioPlay, exec, swayosd-client --playerctl play-pause +bindl = , XF86AudioPrev, exec, swayosd-client --playerctl previous ############################## ### WINDOWS AND WORKSPACES ### diff --git a/laptop/.config/hypr/scripts/capture-window.sh b/laptop/.config/hypr/scripts/capture-window.sh new file mode 100755 index 0000000..2299cb0 --- /dev/null +++ b/laptop/.config/hypr/scripts/capture-window.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# get size and offset of active window +size=$(hyprctl activewindow | grep size: | awk -F" " '{print $2}') +size=${size/,/x} +offset=$(hyprctl activewindow | grep at: | awk -F" " '{print $2}') +offset=${offset/,/+} + +# open gui with selected region +flameshot gui --region $size+$offset diff --git a/laptop/.config/hypr/scripts/current-brightness.sh b/laptop/.config/hypr/scripts/current-brightness.sh new file mode 100755 index 0000000..4856e59 --- /dev/null +++ b/laptop/.config/hypr/scripts/current-brightness.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +s=$(brightnessctl | grep % | awk -F" " '{print $4}') +echo ${s:1:-2} -- cgit v1.2.3