Advertisement
Guest User

Untitled

a guest
Apr 19th, 2022
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.76 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # This is the example configuration file for river.
  4. #
  5. # If you wish to edit this, you will probably want to copy it to
  6. # $XDG_CONFIG_HOME/river/init or $HOME/.config/river/init first.
  7. #
  8. # See the river(1), riverctl(1), and rivertile(1) man pages for complete
  9. # documentation.
  10.  
  11. # Super+D to launch Rofi
  12. riverctl map -repeat normal Super D spawn "rofi -no-lazy-grab -show drun"
  13.  
  14. # Super+M to launch ncmpcpp
  15. riverctl map -repeat normal Super M spawn "kitty ncmpcpp"
  16.  
  17. # Super+B to launch bpytop
  18. riverctl map -repeat normal Super B spawn "kitty doas bpytop"
  19.  
  20. # Super+X to take a screenshot
  21. riverctl map normal Super X spawn "grim ~/Pictures/Screenshots/$(date +'%s.png') - | wl-copy"
  22.  
  23. # Super+E to start an instance of PCManFM
  24. riverctl map normal Super E spawn pcmanfm
  25.  
  26. # Super+W to start a Wayland instance of LibreWolf
  27. riverctl map normal Super W spawn "exec=env GDL_BACKEND=wayland MOZ_ENABLE_WAYLAND=1 librewolf"
  28.  
  29. # Super+Shift+Return to start an instance of Kitty
  30. riverctl map -repeat normal Super+Shift Return spawn kitty
  31.  
  32. # Super+Q to close the focused view
  33. riverctl map -repeat normal Super Q close
  34.  
  35. # Super+Shift+E to exit river
  36. riverctl map normal Super+Shift E exit
  37.  
  38. # Super+{J/K} to focus the next/previous view in the layout stack
  39. riverctl map -repeat normal Super J focus-view next
  40. riverctl map -repeat normal Super K focus-view previous
  41.  
  42. # Super+Shift+{J/K} to swap the focused view with the next/previous
  43. # view in the layout stack
  44. riverctl map -repeat normal Super+Shift J swap next
  45. riverctl map -repeat normal Super+Shift K swap previous
  46.  
  47. # Super+{Period/Comma} to focus the next/previous output
  48. riverctl map normal Super Period focus-output next
  49. riverctl map normal Super Comma focus-output previous
  50.  
  51. # Super+Shift+{Period/Comma} to send the focused view to the next/previous output
  52. riverctl map normal Super+Shift Period send-to-output next
  53. riverctl map normal Super+Shift Comma send-to-output previous
  54.  
  55. # Super+Return to bump the focused view to the top of the layout stack
  56. riverctl map normal Super Return zoom
  57.  
  58. # Super+{H/L} to decrease/increase the main ratio of rivertile(1)
  59. riverctl map -repeat normal Super H send-layout-cmd rivertile "main-ratio -0.05"
  60. riverctl map -repeat normal Super L send-layout-cmd rivertile "main-ratio +0.05"
  61.  
  62. # Super+Shift+{J/L} to increment/decrement the main count of rivertile(1)
  63. riverctl map normal Super+Shift H send-layout-cmd rivertile "main-count +1"
  64. riverctl map normal Super+Shift L send-layout-cmd rivertile "main-count -1"
  65.  
  66. # Super+Alt+{H,J,K,L} to move views
  67. riverctl map normal Super+Alt H move left 100
  68. riverctl map normal Super+Alt J move down 100
  69. riverctl map normal Super+Alt K move up 100
  70. riverctl map normal Super+Alt L move right 100
  71.  
  72. # Super+Alt+Control+{H,J,K,L} to snap views to screen edges
  73. riverctl map normal Super+Alt+Control H snap left
  74. riverctl map normal Super+Alt+Control J snap down
  75. riverctl map normal Super+Alt+Control K snap up
  76. riverctl map normal Super+Alt+Control L snap right
  77.  
  78. # Super+Alt+Shift+{H,J,K,L} to resize views
  79. riverctl map normal Super+Alt+Shift H resize horizontal -100
  80. riverctl map normal Super+Alt+Shift J resize vertical 100
  81. riverctl map normal Super+Alt+Shift K resize vertical -100
  82. riverctl map normal Super+Alt+Shift L resize horizontal 100
  83.  
  84. # Super + Left Mouse Button to move views
  85. riverctl map-pointer normal Super BTN_LEFT move-view
  86.  
  87. # Super + Right Mouse Button to resize views
  88. riverctl map-pointer normal Super BTN_RIGHT resize-view
  89.  
  90. for i in $(seq 1 9)
  91. do
  92. tags=$((1 << ($i - 1)))
  93.  
  94. # Super+[1-9] to focus tag [0-8]
  95. riverctl map normal Super $i set-focused-tags $tags
  96.  
  97. # Super+Shift+[1-9] to tag focused view with tag [0-8]
  98. riverctl map normal Super+Shift $i set-view-tags $tags
  99.  
  100. # Super+Ctrl+[1-9] to toggle focus of tag [0-8]
  101. riverctl map normal Super+Control $i toggle-focused-tags $tags
  102.  
  103. # Super+Shift+Ctrl+[1-9] to toggle tag [0-8] of focused view
  104. riverctl map normal Super+Shift+Control $i toggle-view-tags $tags
  105. done
  106.  
  107. # Super+0 to focus all tags
  108. # Super+Shift+0 to tag focused view with all tags
  109. all_tags=$(((1 << 32) - 1))
  110. riverctl map normal Super 0 set-focused-tags $all_tags
  111. riverctl map normal Super+Shift 0 set-view-tags $all_tags
  112.  
  113. # The scratchpad will live on an unused tag. Which tags are used depends on your
  114. # config, but rivers default uses the first 9 tags.
  115. scratch_tag=$((1 << 20 ))
  116.  
  117. # Toggle the scratchpad with Super+P
  118. riverctl map normal Super P toggle-focused-tags ${scratch_tag}
  119.  
  120. # Send windows to the scratchpad with Super+Shift+P
  121. riverctl map normal Super+Shift P set-view-tags ${scratch_tag}
  122.  
  123. # Set spawn tagmask to ensure new windows don't have the scratchpad tag unless
  124. # explicitly set.
  125. all_but_scratch_tag=$(( $(((1 << 32) - 1)) ^ $scratch_tag ))
  126. riverctl spawn-tagmask ${all_but_scratch_tag}
  127.  
  128. all_tags=$(((1 << 32) - 1))
  129. sticky_tag=$((1 << 31))
  130. all_but_sticky_tag=$(( $all_tags ^ $sticky_tag ))
  131.  
  132. riverctl map normal Super S toggle-view-tags $sticky_tag
  133. riverctl spawn-tagmask ${all_but_sticky_tag}
  134.  
  135. # modify the normal keybind to always select the sticky tag
  136. for i in $(seq 1 9)
  137. do
  138. tags=$((1 << ($i - 1)))
  139. # Super+[1-9] to focus tag [0-8]
  140. riverctl map normal Super $i set-focused-tags $(($sticky_tag + $tags))
  141. done
  142.  
  143. # Super+Tab to go to the previous tag
  144. riverctl map -repeat normal Super TAB focus-previous-tags
  145.  
  146. # Super+Space to toggle float
  147. riverctl map -repeat normal Super Space toggle-float
  148.  
  149. # Super+F to toggle fullscreen
  150. riverctl map -repeat normal Super F toggle-fullscreen
  151.  
  152. # Super+{Up,Right,Down,Left} to change layout orientation
  153. riverctl map normal Super Up send-layout-cmd rivertile "main-location top"
  154. riverctl map normal Super Right send-layout-cmd rivertile "main-location right"
  155. riverctl map normal Super Down send-layout-cmd rivertile "main-location bottom"
  156. riverctl map normal Super Left send-layout-cmd rivertile "main-location left"
  157.  
  158. # Declare a passthrough mode. This mode has only a single mapping to return to
  159. # normal mode. This makes it useful for testing a nested wayland compositor
  160. riverctl declare-mode passthrough
  161.  
  162. # Super+F11 to enter passthrough mode
  163. riverctl map normal Super F11 enter-mode passthrough
  164.  
  165. # Super+F11 to return to normal mode
  166. riverctl map passthrough Super F11 enter-mode normal
  167.  
  168. # Various media key mapping examples for both normal and locked mode which
  169. # do not have a modifier
  170. for mode in normal locked
  171. do
  172. # Eject the optical drive (well if you still have one that is)
  173. riverctl map $mode None XF86Eject spawn 'eject -T'
  174.  
  175. # Control pulse audio volume with pamixer (https://github.com/cdemoulins/pamixer)
  176. riverctl map -repeat $mode None XF86AudioRaiseVolume spawn 'pamixer -i 5'
  177. riverctl map -repeat $mode None XF86AudioLowerVolume spawn 'pamixer -d 5'
  178. riverctl map -repeat $mode None XF86AudioMute spawn 'pamixer --toggle-mute'
  179.  
  180. # Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl)
  181. riverctl map -repeat $mode None XF86AudioMedia spawn 'playerctl play-pause'
  182. riverctl map -repeat $mode None XF86AudioPlay spawn 'playerctl play-pause'
  183. riverctl map -repeat $mode None XF86AudioPrev spawn 'playerctl previous'
  184. riverctl map -repeat $mode None XF86AudioNext spawn 'playerctl next'
  185.  
  186. # Control screen backlight brighness with light (https://github.com/haikarainen/light)
  187. riverctl map -repeat $mode None XF86MonBrightnessUp spawn 'brightnessctl s +5%'
  188. riverctl map -repeat $mode None XF86MonBrightnessDown spawn 'brightnessctl s 5%-'
  189. done
  190.  
  191. # Set background and border color
  192. riverctl background-color 0x002b36
  193. riverctl border-color-focused 0x93a1a1
  194. riverctl border-color-unfocused 0x586e75
  195.  
  196. # Set keyboard repeat rate
  197. riverctl set-repeat 50 300
  198.  
  199. # Make certain views start floating
  200. riverctl float-filter-add app-id float
  201. riverctl float-filter-add title "popup title with spaces"
  202.  
  203. ## Autostart
  204. # Sets keybinds
  205. riverctl spawn "doas keyd"
  206. # Starts kanshi
  207. riverctl spawn kanshi
  208. # Starts Pipewire audio
  209. riverctl spawn pipewire
  210. riverctl spawn pipewire-pulse
  211. riverctl spawn pipewire-media-session
  212. # Sets wallpaper and launches Waybar
  213. riverctl spawn "swaybg -i $HOME/.config/wall.jpg"
  214. riverctl spawn waybar
  215. # Starts music player daemon and button support
  216. riverctl spawn mpd
  217. riverctl spawn mpris-proxy
  218. riverctl spawn mpDris2
  219. # Allows GUI programs to be run as root
  220. riverctl spawn /usr/lib/polkit-1/polkitd
  221. # Starts Syncthing
  222. riverctl spawn "syncthing --no-browser"
  223. # Starts KeePassXC and moves it to scratchpad
  224. riverctl spawn keepassxc
  225. riverctl set-view-tags ${scratch_tag}
  226.  
  227. # Set and exec into the default layout generator, rivertile.
  228. # River will send the process group of the init executable SIGTERM on exit.
  229. riverctl default-layout rivertile
  230. exec rivertile -view-padding 0 -outer-padding 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement