From c2764148c9755b26ed25bbcefedfb03241ecb601 Mon Sep 17 00:00:00 2001 From: William Ball Date: Thu, 5 Mar 2026 19:41:33 -0500 Subject: [PATCH] new river scripts --- river/.config/river/init | 16 ++++++++++------ river/.config/river/power_mode.sh | 3 +++ river/.config/river/screenshot.sh | 17 +++++++++++++++++ 3 files changed, 30 insertions(+), 6 deletions(-) create mode 100755 river/.config/river/power_mode.sh create mode 100755 river/.config/river/screenshot.sh diff --git a/river/.config/river/init b/river/.config/river/init index 9090b9d..e9ca1bb 100755 --- a/river/.config/river/init +++ b/river/.config/river/init @@ -10,6 +10,7 @@ emacs="emacsclient --create-frame --alternate-editor='emacs'" mod=Super books="$HOME/.local/bin/books.sh" papers="$HOME/.local/bin/papers.sh" +config="$HOME/.config/river" wobsock=$XDG_RUNTIME_DIR/wob.sock rm -f $wobsock && mkfifo $wobsock && tail -f $wobsock | wob & @@ -19,7 +20,8 @@ riverctl map normal $mod Return spawn $term_client riverctl map normal $mod+Shift Return spawn $term riverctl map normal $mod R span "bemenu-run -p launch" riverctl map normal $mod Semicolon spawn "bemenu-run -p launch" -riverctl map normal $mod+Shift P spawn "passmenu -p password" +riverctl map normal $mod+Shift P spawn "$config/power_mode.sh" +# riverctl map normal $mod+Shift P spawn "passmenu -p password" riverctl map normal $mod BracketRight spawn "$browser" riverctl map normal $mod T spawn "$email" riverctl map normal $mod Z spawn "$books" @@ -28,6 +30,8 @@ riverctl map normal $mod E spawn "$emacs" riverctl map normal $mod+Control O spawn "swaylock" riverctl map normal $mod B spawn "bluetoothctl connect 88:C9:E8:D7:60:85" riverctl map normal $mod+Shift B spawn "bluetoothctl disconnect 88:C9:E8:D7:60:85" +riverctl map normal $mod+Control S spawn "$config/screenshot.sh clip" +riverctl map normal $mod+Shift E spawn "$config/screenshot.sh menu" # Close windows & exit wm riverctl map normal $mod+Shift C close @@ -181,14 +185,14 @@ riverctl rule-add -app-id org.gnome.Boxes ssd riverctl rule-add -app-id com.github.xournalpp.xournalpp ssd # spawn stuff -pgrep wbg || wbg ~/.config/river/wallpaper.jpg & +pgrep swaybg || swaybg -i ~/.config/river/wallpaper.jpg & wlr-randr --output eDP-1 --scale 1.25 & pgrep waybar || waybar & -# mako stuff -pgrep mako || mako & -riverctl map normal $mod D spawn 'makoctl dismiss' -riverctl map normal $mod+Shift D spawn 'makoctl dismiss --all' +# dunst stuff +pgrep dunst || dunst & +riverctl map normal $mod D spawn 'dunstctl close' +riverctl map normal $mod+Shift D spawn 'dunstctl close-all' # bluetooth blueman-applet & diff --git a/river/.config/river/power_mode.sh b/river/.config/river/power_mode.sh new file mode 100755 index 0000000..0a10d1f --- /dev/null +++ b/river/.config/river/power_mode.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +echo -e "performance\nbalanced\npower-saver" | bemenu --center --list 3 -p "Power Mode" --border 2 --bdr "#f6c2e7" -W 0.5 | xargs tlpctl diff --git a/river/.config/river/screenshot.sh b/river/.config/river/screenshot.sh new file mode 100755 index 0000000..71dbad4 --- /dev/null +++ b/river/.config/river/screenshot.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +if [ $1 = "clip" ]; then + if grim -g "$(slurp)" - | wl-copy; then + notify-send "screenshot" "Saved to clipboard" + else + notify-send "screenshot" "Canceled" + fi +else + filename="$HOME/Downloads/$(echo '' | bemenu --ifne -p "Enter filename:")" + filename_ext="${filename%.png}.png" + if grim -g "$(slurp)" "$filename_ext"; then + notify-send "screenshot" "Saved as $filename_ext" + else + notify-send "screenshot" "Canceled" + fi +fi