2024-03-10 16:06:27 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2024-03-23 06:26:43 +00:00
|
|
|
# Please, no cursor ___________________________________________________________
|
|
|
|
riverctl hide-cursor when-typing enabled
|
|
|
|
|
2024-04-20 16:35:13 +00:00
|
|
|
# Hibernate when lid is closed ________________________________________________
|
|
|
|
riverctl declare-mode wlrctl
|
|
|
|
for mode in locked normal wlrctl; do
|
|
|
|
riverctl map-switch $mode lid close "doas zzz"
|
|
|
|
done
|
|
|
|
|
2024-07-04 00:50:02 +00:00
|
|
|
# Autostart applications ______________________________________________________
|
|
|
|
|
|
|
|
spawn () {
|
|
|
|
$1 >> ~/.local/state/log/$(basename $1).log 2>&1 &
|
|
|
|
}
|
|
|
|
|
|
|
|
# xdg-desktop-portal
|
|
|
|
dbus-update-activation-environment DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river
|
|
|
|
spawn ~/.guix-home/profile/libexec/xdg-desktop-portal-wlr
|
|
|
|
spawn ~/.guix-home/profile/libexec/xdg-desktop-portal
|
|
|
|
|
|
|
|
for application in gammastep waybar fnott keepassxc; do
|
|
|
|
spawn $application
|
|
|
|
done
|
|
|
|
|
2024-07-09 22:21:03 +00:00
|
|
|
foot --server &
|
2024-07-04 00:50:02 +00:00
|
|
|
wayneko --background-colour 0x606060 --layer overlay &
|
|
|
|
|
2024-03-20 06:57:30 +00:00
|
|
|
# Decorations _________________________________________________________________
|
|
|
|
|
|
|
|
# wallpaper
|
2024-07-04 00:48:37 +00:00
|
|
|
swww init
|
|
|
|
swww img ~/media/pictures/wallpapers/wall.png -t none &
|
2024-03-20 06:57:30 +00:00
|
|
|
|
|
|
|
# Set background and border color
|
|
|
|
riverctl border-color-focused 0x8581e0
|
|
|
|
riverctl border-color-unfocused 0x313131
|
2024-07-04 00:50:28 +00:00
|
|
|
riverctl border-color-urgent 0xdce081
|
2024-03-20 06:57:30 +00:00
|
|
|
riverctl border-width 1
|
|
|
|
|
2024-03-11 00:15:34 +00:00
|
|
|
# Window layout _______________________________________________________________
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-03-11 00:15:34 +00:00
|
|
|
# Set the default layout generator to be rivercarro and start it.
|
|
|
|
# River will send the process group of the init executable SIGTERM on exit.
|
|
|
|
riverctl default-layout rivercarro
|
|
|
|
rivercarro -inner-gaps 10 -outer-gaps 10 -no-smart-gaps &
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-03-20 06:57:30 +00:00
|
|
|
# Window focus ________________________________________________________________
|
|
|
|
riverctl focus-follows-cursor normal
|
|
|
|
|
|
|
|
# Inputs ______________________________________________________________________
|
2024-03-26 20:33:37 +00:00
|
|
|
riverctl input pointer-2-10-TPPS/2_IBM_TrackPoint accel-profile none
|
|
|
|
riverctl input pointer-2-10-TPPS/2_IBM_TrackPoint pointer-accel 1.0
|
2024-03-20 06:57:30 +00:00
|
|
|
|
2024-03-11 00:15:34 +00:00
|
|
|
# Keyboard ____________________________________________________________________
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-03-11 00:15:34 +00:00
|
|
|
# layout
|
|
|
|
riverctl keyboard-layout\
|
|
|
|
-options grp:menu_switch,parens:swap_brackets,caps:swapescape \
|
|
|
|
us,br
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-03-11 00:15:34 +00:00
|
|
|
# repeat rate
|
|
|
|
riverctl set-repeat 50 300
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-03-11 00:15:34 +00:00
|
|
|
# Bindings ____________________________________________________________________
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-03-26 20:33:37 +00:00
|
|
|
## kill river __________________________________________________________________
|
|
|
|
riverctl map normal Super+Shift Q exit
|
|
|
|
|
|
|
|
## cycle layout
|
2024-04-20 16:35:13 +00:00
|
|
|
#riverctl Super Space send-layout-cmd "riverguile cycle-layout"
|
2024-03-10 16:06:27 +00:00
|
|
|
|
|
|
|
# toggle monocle layout
|
|
|
|
riverctl map normal Super M send-layout-cmd rivercarro "main-location monocle"
|
|
|
|
riverctl map normal Super T send-layout-cmd rivercarro "main-location left"
|
|
|
|
|
|
|
|
# Super+H and Super+L to decrease/increase the main ratio of rivercarro(1)
|
|
|
|
riverctl map normal Super H send-layout-cmd rivercarro "main-ratio -0.05"
|
|
|
|
riverctl map normal Super L send-layout-cmd rivercarro "main-ratio +0.05"
|
|
|
|
|
2024-04-20 16:35:13 +00:00
|
|
|
# Super+Shift+H and Super+Alt+L to (re)move views from rivercarro(1) main
|
|
|
|
riverctl map normal Super+Alt+Control H send-layout-cmd rivercarro "main-count +1"
|
|
|
|
riverctl map normal Super+Alt+Control L send-layout-cmd rivercarro "main-count -1"
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-03-26 20:33:37 +00:00
|
|
|
# Super+J and Super+K to focus the next/previous view in the layout stack
|
|
|
|
riverctl map normal Super Tab focus-view next
|
|
|
|
riverctl map normal Super+Shift Tab focus-view previous
|
|
|
|
|
2024-03-11 00:15:34 +00:00
|
|
|
# Super+Return to bump the focused view to the top of the layout stack
|
|
|
|
|
|
|
|
## view related keybindings ___________________________________________________
|
|
|
|
|
2024-04-20 16:35:13 +00:00
|
|
|
riverctl map normal Super w enter-mode "wlrctl"
|
|
|
|
riverctl map wlrctl Super w enter-mode "normal"
|
|
|
|
riverctl map wlrctl Super Escape enter-mode "normal"
|
|
|
|
|
|
|
|
# Super+{H,J,K,L} to move the cursor
|
|
|
|
riverctl map -repeat wlrctl Super H spawn "wlrctl pointer move -10 0"
|
|
|
|
riverctl map -repeat wlrctl Super J spawn "wlrctl pointer move 0 10"
|
|
|
|
riverctl map -repeat wlrctl Super K spawn "wlrctl pointer move 0 -10"
|
|
|
|
riverctl map -repeat wlrctl Super L spawn "wlrctl pointer move 10 0"
|
|
|
|
|
|
|
|
# Super+Shift+{H,J,K,L} to scroll the window under the cursor
|
2024-05-05 19:03:32 +00:00
|
|
|
riverctl map -repeat wlrctl Super+Shift H spawn "wlrctl pointer scroll 0 10"
|
|
|
|
riverctl map -repeat wlrctl Super+Shift J spawn "wlrctl pointer scroll 10 0"
|
|
|
|
riverctl map -repeat wlrctl Super+Shift K spawn "wlrctl pointer scroll -10 0"
|
|
|
|
riverctl map -repeat wlrctl Super+Shift L spawn "wlrctl pointer scroll 0 -10"
|
2024-04-20 16:35:13 +00:00
|
|
|
|
|
|
|
# Super+Alt+{H,J,K} to left, middle, right click
|
|
|
|
riverctl map wlrctl Super+Alt H spawn "wlrctl pointer click left"
|
|
|
|
riverctl map wlrctl Super+Alt J spawn "wlrctl pointer click middle"
|
|
|
|
riverctl map wlrctl Super+Alt K spawn "wlrctl pointer click right"
|
|
|
|
|
2024-03-26 20:33:37 +00:00
|
|
|
# Super+Control+{H,J,K,L} to swap views
|
|
|
|
riverctl map -repeat normal Super+Shift H swap left
|
|
|
|
riverctl map -repeat normal Super+Shift J swap down
|
|
|
|
riverctl map -repeat normal Super+Shift K swap up
|
|
|
|
riverctl map -repeat normal Super+Shift L swap right
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-03-11 00:15:34 +00:00
|
|
|
# Super+Alt+{H,J,K,L} to move views
|
|
|
|
riverctl map -repeat normal Super+Control H move left 10
|
|
|
|
riverctl map -repeat normal Super+Control J move down 10
|
|
|
|
riverctl map -repeat normal Super+Control K move up 10
|
|
|
|
riverctl map -repeat normal Super+Control L move right 10
|
2024-03-10 16:06:27 +00:00
|
|
|
|
|
|
|
# Super+Alt+Shift+{H,J,K,L} to resize views
|
|
|
|
riverctl map -repeat normal Super+Alt H resize horizontal -10
|
|
|
|
riverctl map -repeat normal Super+Alt J resize vertical 10
|
|
|
|
riverctl map -repeat normal Super+Alt K resize vertical -10
|
|
|
|
riverctl map -repeat normal Super+Alt L resize horizontal 10
|
|
|
|
|
|
|
|
# Super + Left Mouse Button to move views
|
|
|
|
riverctl map-pointer normal Super BTN_LEFT move-view
|
|
|
|
|
|
|
|
# Super + Right Mouse Button to resize views
|
|
|
|
riverctl map-pointer normal Super BTN_RIGHT resize-view
|
|
|
|
|
|
|
|
# Super + Middle Mouse Button to toggle float
|
|
|
|
riverctl map-pointer normal Super BTN_MIDDLE toggle-float
|
|
|
|
|
2024-03-11 00:15:34 +00:00
|
|
|
# Super+Space to toggle float
|
2024-04-20 16:35:13 +00:00
|
|
|
riverctl map normal Super f toggle-float
|
2024-03-11 00:15:34 +00:00
|
|
|
|
|
|
|
# Super+F to toggle fullscreen
|
2024-04-20 16:35:13 +00:00
|
|
|
riverctl map normal Super F11 toggle-fullscreen
|
2024-03-11 00:15:34 +00:00
|
|
|
|
2024-03-26 20:33:37 +00:00
|
|
|
# Super+T to toggle top
|
2024-04-20 16:35:13 +00:00
|
|
|
riverctl map normal Super Space zoom
|
2024-03-26 20:33:37 +00:00
|
|
|
|
2024-03-11 00:15:34 +00:00
|
|
|
# close the focused view
|
|
|
|
riverctl map normal Super q close
|
|
|
|
|
|
|
|
## Application related keybindings ____________________________________________
|
|
|
|
|
|
|
|
# $TERMINAL
|
2024-07-09 22:21:03 +00:00
|
|
|
riverctl map normal Super Return spawn "$TERMINAL"
|
2024-03-11 00:15:34 +00:00
|
|
|
|
|
|
|
# $EDITOR
|
2024-03-20 06:57:30 +00:00
|
|
|
riverctl map normal Super e spawn "$TERMINAL -e $EDITOR"
|
2024-03-11 00:15:34 +00:00
|
|
|
|
|
|
|
# file manager
|
2024-03-26 20:33:37 +00:00
|
|
|
riverctl map normal Super d spawn "$TERMINAL -e lf"
|
2024-03-11 00:15:34 +00:00
|
|
|
|
2024-07-04 00:27:06 +00:00
|
|
|
# btop
|
|
|
|
riverctl map normal Super b spawn "$TERMINAL -e btop"
|
2024-03-11 00:15:34 +00:00
|
|
|
|
|
|
|
# application launcher
|
|
|
|
riverctl map normal Super Semicolon spawn fuzzel
|
|
|
|
|
|
|
|
# webcam (TODO: fix)
|
2024-04-08 04:03:52 +00:00
|
|
|
riverctl map normal None XF86WebCam spawn "cam"
|
|
|
|
riverctl map normal None XF86Sleep spawn "doas zzz"
|
2024-03-11 00:15:34 +00:00
|
|
|
|
|
|
|
# rss reader (TODO: fix)
|
2024-04-08 04:03:52 +00:00
|
|
|
riverctl map normal None XF86Launch1 spawn "$TERMINAL -e newsraft"
|
2024-03-11 00:15:34 +00:00
|
|
|
|
|
|
|
# keepassxc
|
|
|
|
riverctl map normal Super c spawn keepassxc
|
|
|
|
|
|
|
|
# loot some ships
|
|
|
|
riverctl map normal Super z spawn anna
|
|
|
|
|
|
|
|
# guix repl
|
2024-03-20 06:57:30 +00:00
|
|
|
riverctl map normal Super g spawn "$TERMINAL -e guix repl"
|
2024-03-11 00:15:34 +00:00
|
|
|
|
|
|
|
## Tag related keybindings ____________________________________________________
|
|
|
|
|
|
|
|
# go to last tag
|
|
|
|
riverctl map normal Super Escape focus-previous-tags
|
|
|
|
|
2024-04-20 16:35:13 +00:00
|
|
|
for mode in normal wlrctl; do
|
|
|
|
for i in $(seq 1 7); do
|
|
|
|
tags=$((1 << ($i - 1)))
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-04-20 16:35:13 +00:00
|
|
|
# Super+[1-8] to focus tag [0-7]
|
|
|
|
riverctl map $mode Super $i set-focused-tags $tags
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-04-20 16:35:13 +00:00
|
|
|
# Super+Shift+[1-8] to tag focused view with tag [0-7]
|
|
|
|
riverctl map $mode Super+Shift $i set-view-tags $tags
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-04-20 16:35:13 +00:00
|
|
|
# Super+Control+[1-8] to toggle focus of tag [0-7]
|
|
|
|
riverctl map $mode Super+Control $i toggle-focused-tags $tags
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-04-20 16:35:13 +00:00
|
|
|
# Super+Shift+Control+[1-8] to toggle tag [0-7] of focused view
|
|
|
|
riverctl map $mode Super+Shift+Control $i toggle-view-tags $tags
|
|
|
|
done
|
2024-03-10 16:06:27 +00:00
|
|
|
done
|
2024-03-23 06:26:43 +00:00
|
|
|
scratch_tag=$((1 << 7))
|
|
|
|
|
2024-04-20 16:35:13 +00:00
|
|
|
for mode in normal wlrctl; do
|
|
|
|
# toggle the scratchpad
|
|
|
|
riverctl map $mode Super period toggle-focused-tags ${scratch_tag}
|
2024-03-23 06:26:43 +00:00
|
|
|
|
2024-04-20 16:35:13 +00:00
|
|
|
# send windows to the scratchpad
|
|
|
|
riverctl map $mode Super+Shift period set-view-tags ${scratch_tag}
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-04-20 16:35:13 +00:00
|
|
|
# Super+0 to focus all tags
|
|
|
|
# Super+Shift+0 to tag focused view with all tags
|
|
|
|
all_tags=$(((1 << 7) - 1))
|
|
|
|
riverctl map $mode Super 0 set-focused-tags $all_tags
|
|
|
|
riverctl map $mode Super+Shift 0 set-view-tags $all_tags
|
|
|
|
done
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-03-11 00:15:34 +00:00
|
|
|
## Clipboard related keybindings ______________________________________________
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-03-11 00:15:34 +00:00
|
|
|
# grab videos from clipboard
|
|
|
|
riverctl map normal Super V spawn "wl-paste | xargs vid"
|
|
|
|
riverctl map normal Super+Shift V spawn "wl-paste | xargs vd"
|
|
|
|
|
2024-04-20 16:35:13 +00:00
|
|
|
riverctl map normal None Print \
|
2024-03-20 06:57:30 +00:00
|
|
|
spawn 'grim -g "$(slurp)" -t png - | wl-copy -t image/png'
|
2024-03-11 00:15:34 +00:00
|
|
|
|
|
|
|
# screenshot (TODO: fix)
|
2024-04-20 16:35:13 +00:00
|
|
|
riverctl map normal Super Print \
|
|
|
|
spawn 'grim -g "$(slurp)" ~/media/pictures/screenshots/$(date +%Y-%m-%d--%H-%M-%S.png)'
|
2024-03-11 00:15:34 +00:00
|
|
|
|
|
|
|
## Audio related keybindings __________________________________________________
|
2024-04-20 16:35:13 +00:00
|
|
|
for mode in normal locked wlrctl
|
2024-03-11 00:15:34 +00:00
|
|
|
do
|
2024-04-08 04:03:52 +00:00
|
|
|
riverctl map -repeat $mode None XF86AudioRaiseVolume \
|
2024-03-11 00:15:34 +00:00
|
|
|
spawn 'wpctl set-volume -l 2.0 @DEFAULT_AUDIO_SINK@ 1%+'
|
|
|
|
riverctl map -repeat $mode None XF86AudioLowerVolume \
|
|
|
|
spawn 'wpctl set-volume -l 2.0 @DEFAULT_AUDIO_SINK@ 1%-'
|
2024-04-08 04:03:52 +00:00
|
|
|
riverctl map -repeat $mode None XF86AudioMute \
|
2024-03-11 00:15:34 +00:00
|
|
|
spawn 'wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle'
|
2024-04-08 04:03:52 +00:00
|
|
|
riverctl map -repeat $mode None XF86AudioMicMute \
|
2024-03-11 00:15:34 +00:00
|
|
|
spawn 'wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle'
|
|
|
|
|
|
|
|
# control mpv playlist listening on socket /tmp/mpv-socket
|
|
|
|
riverctl map $mode Super XF86AudioLowerVolume \
|
|
|
|
spawn "echo '{ \"command\": [\"keypress\", \"<\"] }' | socat - /tmp/mpv-socket"
|
|
|
|
riverctl map $mode Super XF86AudioRaiseVolume \
|
|
|
|
spawn "echo '{ \"command\": [\"keypress\", \">\"] }' | socat - /tmp/mpv-socket"
|
|
|
|
riverctl map $mode Super XF86AudioMute \
|
|
|
|
spawn "echo '{ \"command\": [\"keypress\", \"p\"] }' | socat - /tmp/mpv-socket"
|
|
|
|
riverctl map $mode Super A \
|
|
|
|
spawn "echo '{ \"command\": [\"keypress\", \"N\"] }' | socat - /tmp/mpv-socket"
|
|
|
|
|
|
|
|
# Control screen backlight brightness
|
|
|
|
riverctl map $mode None XF86MonBrightnessUp \
|
|
|
|
spawn 'brightnessctl set +5%'
|
|
|
|
riverctl map $mode Shift XF86MonBrightnessUp \
|
|
|
|
spawn 'brightnessctl set +10%'
|
|
|
|
riverctl map $mode None XF86MonBrightnessDown \
|
|
|
|
spawn 'brightnessctl set 5%-'
|
|
|
|
riverctl map $mode Shift XF86MonBrightnessDown \
|
|
|
|
spawn 'brightnessctl set 10%-'
|
|
|
|
done
|
|
|
|
|
|
|
|
# lock screen
|
|
|
|
riverctl map normal Super+Shift S \
|
|
|
|
spawn "swaylock -k -i ~/media/pictures/wallpapers/lockscreen"
|
2024-03-10 16:06:27 +00:00
|
|
|
|
|
|
|
# Declare a passthrough mode. This mode has only a single mapping to return to
|
|
|
|
# normal mode. This makes it useful for testing a nested wayland compositor
|
|
|
|
riverctl declare-mode passthrough
|
|
|
|
|
2024-04-20 16:35:13 +00:00
|
|
|
# Super+F12 to enter passthrough mode
|
|
|
|
riverctl map normal Super F12 enter-mode passthrough
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-04-20 16:35:13 +00:00
|
|
|
# Super+F12 to return to normal mode
|
|
|
|
riverctl map passthrough Super F12 enter-mode normal
|
2024-03-10 16:06:27 +00:00
|
|
|
|
2024-03-23 06:26:43 +00:00
|
|
|
# Application rules ___________________________________________________________
|
|
|
|
|
|
|
|
# float views
|
|
|
|
#riverctl rule-add -app-id 'KeePassXC' float
|
|
|
|
#riverctl rule-add -app-id 'Pavucontrol' float
|
|
|
|
#riverctl rule-add -app-id 'TelegramDesktop' float
|
|
|
|
|
|
|
|
# server side decorations
|
|
|
|
#riverctl rule-add -app-id 'KeePassXC' ssd
|
|
|
|
#riverctl rule-add -app-id 'Pavucontrol' ssd
|
|
|
|
#riverctl rule-add -app-id 'TelegramDesktop' ssd
|
|
|
|
|
|
|
|
# initial view tags
|
|
|
|
# riverctl rule-add -app-id 'TelegramDesktop' ${scratch_tag}
|
|
|
|
|