diff options
Diffstat (limited to 'dot_config')
| -rw-r--r-- | dot_config/mako/config | 3 | ||||
| -rw-r--r-- | dot_config/sway/config | 21 | ||||
| -rw-r--r-- | dot_config/sway/executable_brightness-osd.sh | 16 | ||||
| -rw-r--r-- | dot_config/sway/executable_vol-osd.sh | 23 | ||||
| -rw-r--r-- | dot_config/systemd/user/wob.service | 16 | ||||
| -rw-r--r-- | dot_config/wob/wob.ini | 10 | ||||
| -rw-r--r-- | dot_config/xdg-desktop-portal/sway-portals.conf | 4 |
7 files changed, 83 insertions, 10 deletions
diff --git a/dot_config/mako/config b/dot_config/mako/config index b954072..87f06bf 100644 --- a/dot_config/mako/config +++ b/dot_config/mako/config @@ -20,3 +20,6 @@ border-color=#fabd2f [urgency=critical] border-color=#fb4934 default-timeout=0 + +[mode=do-not-disturb] +invisible=1 diff --git a/dot_config/sway/config b/dot_config/sway/config index 6f8dbfc..1e2cc5f 100644 --- a/dot_config/sway/config +++ b/dot_config/sway/config @@ -132,12 +132,12 @@ bindsym $mod+Tab workspace next_on_output bindsym $mod+Shift+Tab workspace prev_on_output # Volume -bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% -bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% -bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle -bindsym $mod+Ctrl+k exec pactl set-sink-volume @DEFAULT_SINK@ +5% -bindsym $mod+Ctrl+j exec pactl set-sink-volume @DEFAULT_SINK@ -5% -bindsym $mod+Shift+m exec pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym XF86AudioRaiseVolume exec ~/.config/sway/vol-osd.sh up +bindsym XF86AudioLowerVolume exec ~/.config/sway/vol-osd.sh down +bindsym XF86AudioMute exec ~/.config/sway/vol-osd.sh mute +bindsym $mod+Ctrl+k exec ~/.config/sway/vol-osd.sh up +bindsym $mod+Ctrl+j exec ~/.config/sway/vol-osd.sh down +bindsym $mod+Shift+m exec ~/.config/sway/vol-osd.sh mute bindsym $mod+m exec pactl set-source-mute @DEFAULT_SOURCE@ toggle # Media @@ -149,10 +149,10 @@ bindsym $mod+Ctrl+l exec playerctl next bindsym $mod+Ctrl+h exec playerctl previous # Brightness -bindsym XF86MonBrightnessUp exec brightnessctl set +5% -bindsym XF86MonBrightnessDown exec brightnessctl set 5%- -bindsym $mod+Ctrl+bracketright exec brightnessctl set +5% -bindsym $mod+Ctrl+bracketleft exec brightnessctl set 5%- +bindsym XF86MonBrightnessUp exec ~/.config/sway/brightness-osd.sh up +bindsym XF86MonBrightnessDown exec ~/.config/sway/brightness-osd.sh down +bindsym $mod+Ctrl+bracketright exec ~/.config/sway/brightness-osd.sh up +bindsym $mod+Ctrl+bracketleft exec ~/.config/sway/brightness-osd.sh down # ThinkPad multimedia keys bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle @@ -221,6 +221,7 @@ mode "system" { bindsym v exec $term --class=floating -e pulsemixer, mode "default" bindsym k exec $term --class=floating -e glow -p ~/dotfiles/KEYBINDS.md, mode "default" bindsym m exec ~/.config/waybar/mako-history.py, mode "default" + bindsym n exec makoctl mode -t do-not-disturb, mode "default" bindsym Escape mode "default" bindsym Return mode "default" } diff --git a/dot_config/sway/executable_brightness-osd.sh b/dot_config/sway/executable_brightness-osd.sh new file mode 100644 index 0000000..74d6baa --- /dev/null +++ b/dot_config/sway/executable_brightness-osd.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# Print brightness percent to wob's fifo to flash a brightness bar. +# Usage: brightness-osd.sh up|down +set -eu + +fifo=${XDG_RUNTIME_DIR:-/tmp}/wob.sock + +case "${1:-}" in + up) brightnessctl set +5% >/dev/null ;; + down) brightnessctl set 5%- >/dev/null ;; + *) echo "usage: $0 up|down" >&2; exit 2 ;; +esac + +cur=$(brightnessctl g) +max=$(brightnessctl m) +printf '%d\n' "$(( cur * 100 / max ))" >"$fifo" diff --git a/dot_config/sway/executable_vol-osd.sh b/dot_config/sway/executable_vol-osd.sh new file mode 100644 index 0000000..46f35b7 --- /dev/null +++ b/dot_config/sway/executable_vol-osd.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# Print 0–100 to wob's fifo to flash a volume bar overlay. +# Usage: vol-osd.sh up|down|mute (mute toggles) +set -eu + +fifo=${XDG_RUNTIME_DIR:-/tmp}/wob.sock +sink='@DEFAULT_SINK@' + +case "${1:-}" in + up) pactl set-sink-volume "$sink" +5% ;; + down) pactl set-sink-volume "$sink" -5% ;; + mute) pactl set-sink-mute "$sink" toggle ;; + *) echo "usage: $0 up|down|mute" >&2; exit 2 ;; +esac + +muted=$(pactl get-sink-mute "$sink" | awk '{print $2}') +if [ "$muted" = "yes" ]; then + printf '0\n' >"$fifo" +else + pactl get-sink-volume "$sink" | + awk '/Volume:/ { for (i=1;i<=NF;i++) if ($i ~ /%/) { gsub(/%/,"",$i); print $i; exit } }' \ + >"$fifo" +fi diff --git a/dot_config/systemd/user/wob.service b/dot_config/systemd/user/wob.service new file mode 100644 index 0000000..3a4268f --- /dev/null +++ b/dot_config/systemd/user/wob.service @@ -0,0 +1,16 @@ +[Unit] +Description=Wayland overlay bar (volume / brightness OSD) +PartOf=graphical-session.target +After=graphical-session.target +ConditionEnvironment=WAYLAND_DISPLAY + +[Service] +Type=simple +ExecStartPre=/usr/bin/sh -c 'rm -f "$XDG_RUNTIME_DIR/wob.sock" && mkfifo "$XDG_RUNTIME_DIR/wob.sock"' +ExecStart=/usr/bin/sh -c 'exec /usr/bin/wob <"$XDG_RUNTIME_DIR/wob.sock"' +ExecStopPost=/usr/bin/rm -f %t/wob.sock +Restart=on-failure +RestartSec=2s + +[Install] +WantedBy=sway-session.target diff --git a/dot_config/wob/wob.ini b/dot_config/wob/wob.ini new file mode 100644 index 0000000..93758dd --- /dev/null +++ b/dot_config/wob/wob.ini @@ -0,0 +1,10 @@ +# gruvbox-flavored wob overlay (fed by vol-osd.sh / brightness-osd.sh). +anchor = bottom +margin = 60 +border_size = 1 +bar_padding = 3 +height = 32 +width = 280 +border_color = ffebdbb2 +background_color = ff282828 +bar_color = fffabd2f diff --git a/dot_config/xdg-desktop-portal/sway-portals.conf b/dot_config/xdg-desktop-portal/sway-portals.conf new file mode 100644 index 0000000..8c3959a --- /dev/null +++ b/dot_config/xdg-desktop-portal/sway-portals.conf @@ -0,0 +1,4 @@ +[preferred] +default=gtk +org.freedesktop.impl.portal.ScreenCast=wlr +org.freedesktop.impl.portal.Screenshot=wlr |
