aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.config/river/init96
1 files changed, 46 insertions, 50 deletions
diff --git a/.config/river/init b/.config/river/init
index 0d46991..201b0c2 100755
--- a/.config/river/init
+++ b/.config/river/init
@@ -3,22 +3,23 @@
# See the river(1), riverctl(1), and rivertile(1) man pages for complete
# documentation.
-# Focus follows mouse
-riverctl focus-follows-cursor normal
+# Appearance
+riverctl background-color 0x002b36
+riverctl border-color-focused 0x33ccff
+riverctl border-color-unfocused 0x595959
+riverctl border-width 2
-# Let the cursor follow focused screen
+# Pointer
+riverctl focus-follows-cursor normal
riverctl set-cursor-warp on-focus-change
-# Atatch new windows at the bottom of the stack
-riverctl attach-mode bottom
-
-# Hide cursor
+# Inputs
+riverctl set-repeat 50 300
riverctl hide-cursor timeout 5000
riverctl hide-cursor when-typing enabled
-
-# Setup keyboard
riverctl keyboard-layout -options "grp:ctrl_space_toggle" "us,gb"
+# Keybinds
# Note: the "Super" modifier is also known as Logo, GUI, Windows, Mod4, etc.
# Super+Shift+Return to start an instance of foot (https://codeberg.org/dnkl/foot)
@@ -39,6 +40,21 @@ riverctl map normal Super B spawn "killall yambar || ~/.config/yambar/scripts/ya
# Power Menu
riverctl map normal Control+Super P spawn "~/.local/bin/powermenu"
+# Take a screenshot of the active output
+riverctl map normal None Print spawn '~/.config/river/scripts/screenshot.sh'
+
+# Take a screenshot of the selected region
+riverctl map normal Super Print spawn '~/.config/river/scripts/screenshot.sh selected-region'
+
+# Take a screenshot and save it to the clipboard
+riverctl map normal Super+Shift Print spawn '~/.config/river/scripts/screenshot.sh save-to-clipboard'
+
+# Super+Space to toggle float
+riverctl map normal Super Space toggle-float
+
+# Super+F to toggle fullscreen
+riverctl map normal Super F toggle-fullscreen
+
# Super+J and Super+K to focus the next/previous view in the layout stack
riverctl map normal Super J focus-view next
riverctl map normal Super K focus-view previous
@@ -94,6 +110,7 @@ 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
+# Tags
for i in $(seq 1 9)
do
tags=$((1 << ($i - 1)))
@@ -117,12 +134,28 @@ all_tags=$(((1 << 32) - 1))
riverctl map normal Super 0 set-focused-tags $all_tags
riverctl map normal Super+Shift 0 set-view-tags $all_tags
-# Super+Space to toggle float
-riverctl map normal Super Space toggle-float
+# The scratchpad will live on an unused tag. Which tags are used depends on your
+# config, but rivers default uses the first 9 tags.
+scratch_tag=$((1 << 20 ))
-# Super+F to toggle fullscreen
-riverctl map normal Super F toggle-fullscreen
+# Toggle the scratchpad with Super+P
+riverctl map normal Super P toggle-focused-tags ${scratch_tag}
+
+# Send windows to the scratchpad with Super+Shift+P
+riverctl map normal Super+Shift P set-view-tags ${scratch_tag}
+
+# Set spawn tagmask to ensure new windows don't have the scratchpad tag unless
+# explicitly set.
+all_but_scratch_tag=$(( ((1 << 32) - 1) ^ $scratch_tag ))
+riverctl spawn-tagmask ${all_but_scratch_tag}
+# Layout
+# Set the default layout generator to be rivertile and start it.
+# River will send the process group of the init executable SIGTERM on exit.
+riverctl default-layout rivertile
+rivertile -view-padding 5 -outer-padding 5 -main-ratio 0.5 &
+# Atatch new windows at the bottom of the stack
+riverctl attach-mode bottom
# Super+{Up,Right,Down,Left} to change layout orientation
riverctl map normal Super Up send-layout-cmd rivertile "main-location top"
riverctl map normal Super Right send-layout-cmd rivertile "main-location right"
@@ -139,30 +172,6 @@ riverctl map normal Super F11 enter-mode passthrough
# Super+F11 to return to normal mode
riverctl map passthrough Super F11 enter-mode normal
-# Take a screenshot of the active output
-riverctl map normal None Print spawn '~/.config/river/scripts/screenshot.sh'
-
-# Take a screenshot of the selected region
-riverctl map normal Super Print spawn '~/.config/river/scripts/screenshot.sh selected-region'
-
-# Take a screenshot and save it to the clipboard
-riverctl map normal Super+Shift Print spawn '~/.config/river/scripts/screenshot.sh save-to-clipboard'
-
-# The scratchpad will live on an unused tag. Which tags are used depends on your
-# config, but rivers default uses the first 9 tags.
-scratch_tag=$((1 << 20 ))
-
-# Toggle the scratchpad with Super+P
-riverctl map normal Super P toggle-focused-tags ${scratch_tag}
-
-# Send windows to the scratchpad with Super+Shift+P
-riverctl map normal Super+Shift P set-view-tags ${scratch_tag}
-
-# Set spawn tagmask to ensure new windows don't have the scratchpad tag unless
-# explicitly set.
-all_but_scratch_tag=$(( ((1 << 32) - 1) ^ $scratch_tag ))
-riverctl spawn-tagmask ${all_but_scratch_tag}
-
# Various media key mapping examples for both normal and locked mode which do
# not have a modifier
for mode in normal locked
@@ -183,14 +192,6 @@ do
riverctl map $mode None XF86MonBrightnessDown spawn 'light -U 5; light -O'
done
-# Set background and border color
-riverctl background-color 0x002b36
-riverctl border-color-focused 0x33ccff
-riverctl border-color-unfocused 0x595959
-riverctl border-width 2
-# Set keyboard repeat rate
-riverctl set-repeat 50 300
-
# auto starting apps
bash $HOME/.config/river/autostart.sh
@@ -205,8 +206,3 @@ riverctl rule-add -app-id 'mpv' float
riverctl rule-add -app-id 'libreoffice*' ssd
riverctl rule-add -app-id 'org.pwmt.zathura' ssd
riverctl rule-add -app-id 'imv' ssd
-
-# Set the default layout generator to be rivertile and start it.
-# River will send the process group of the init executable SIGTERM on exit.
-riverctl default-layout rivertile
-rivertile -view-padding 5 -outer-padding 5 -main-ratio 0.5 &