2024-01-14 22:09:07 -05:00
|
|
|
{ pkgs, config, ... }:
|
|
|
|
{
|
|
|
|
xdg.configFile = {
|
2024-01-16 22:43:56 -05:00
|
|
|
"river/init" = {
|
2024-01-14 22:09:07 -05:00
|
|
|
enable = true;
|
|
|
|
executable = true;
|
|
|
|
text = ''
|
|
|
|
#!/usr/bin/env sh
|
|
|
|
# See the river(1), riverctl(1), and rivertile(1) man pages for complete
|
|
|
|
# documentation.
|
|
|
|
|
|
|
|
# Variables
|
|
|
|
TERMINAL="foot"
|
|
|
|
LOCKSCREEN="swaylock"
|
|
|
|
|
|
|
|
# Autostart
|
2024-03-01 22:20:02 -05:00
|
|
|
riverctl spawn "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river"
|
|
|
|
riverctl spawn "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river"
|
2024-01-15 11:42:05 -05:00
|
|
|
riverctl spawn "kanshi"
|
2024-01-15 22:30:48 -05:00
|
|
|
riverctl spawn "waybar"
|
2024-03-01 22:20:02 -05:00
|
|
|
riverctl spawn "river-tag-overlay --border-width 0 --square-inactive-background-colour "0x282A36" --square-inactive-border-colour "0x282A36" --square-padding 0 --square-inner-padding 4 --square-size 18 --anchors 1:0:0:1 --timeout 2000"
|
2024-01-15 22:30:48 -05:00
|
|
|
riverctl spawn "mako"
|
2024-01-14 22:09:07 -05:00
|
|
|
riverctl spawn "wl-paste --type text --watch cliphist store"
|
|
|
|
riverctl spawn "wl-paste --type image --watch cliphist store"
|
|
|
|
riverctl spawn "mullvad-gui"
|
2024-01-16 22:43:56 -05:00
|
|
|
riverctl spawn "nm-applet"
|
2024-01-14 22:09:07 -05:00
|
|
|
|
|
|
|
# Theme
|
2024-01-17 23:29:00 -05:00
|
|
|
riverctl background-color 0x282A36
|
2024-01-20 13:40:39 -05:00
|
|
|
riverctl border-color-focused 0xBD93F9
|
2024-01-17 23:29:00 -05:00
|
|
|
riverctl border-color-unfocused 0x282A36
|
2024-01-14 22:09:07 -05:00
|
|
|
|
|
|
|
# Launch Shortcuts
|
|
|
|
riverctl map normal Super Return spawn "$TERMINAL tmux.sh"
|
|
|
|
riverctl map normal Super+Shift Return spawn "$TERMINAL"
|
2024-02-13 00:25:27 -05:00
|
|
|
riverctl map normal Super Space spawn 'wmenu.sh'
|
|
|
|
riverctl map normal Super+Shift S spawn 'grim -g "$(slurp)" - | swappy -f -'
|
|
|
|
riverctl map normal Super+Shift V spawn "cliphist list | bemenu -p 'Cliphist ' -l 10 | cliphist decode | wl-copy"
|
2024-01-14 22:09:07 -05:00
|
|
|
|
|
|
|
# Focus Controls
|
2024-02-10 12:31:53 -05:00
|
|
|
riverctl map normal Super H focus-view previous
|
2024-01-14 22:09:07 -05:00
|
|
|
riverctl map normal Super J focus-view next
|
|
|
|
riverctl map normal Super K focus-view previous
|
2024-02-10 12:31:53 -05:00
|
|
|
riverctl map normal Super L focus-view next
|
2024-01-14 22:09:07 -05:00
|
|
|
riverctl map normal Alt Tab focus-view next
|
|
|
|
riverctl map normal Alt+Shift Tab focus-view previous
|
2024-03-01 22:20:02 -05:00
|
|
|
riverctl map normal Super P focus-previous-tags
|
|
|
|
riverctl map normal Super Tab focus-output next
|
|
|
|
|
|
|
|
riverctl map normal Super U focus-output next
|
|
|
|
riverctl map normal Super+Shift U send-to-output next
|
2024-01-14 22:09:07 -05:00
|
|
|
|
|
|
|
# Move Controls
|
2024-02-10 12:31:53 -05:00
|
|
|
riverctl map normal Super+Shift H swap previous
|
2024-01-14 22:09:07 -05:00
|
|
|
riverctl map normal Super+Shift J swap next
|
|
|
|
riverctl map normal Super+Shift K swap previous
|
2024-02-10 12:31:53 -05:00
|
|
|
riverctl map normal Super+Shift L swap next
|
|
|
|
riverctl map normal Super+Shift Space zoom
|
2024-03-01 22:20:02 -05:00
|
|
|
riverctl map normal Super+Shift P send-to-previous-tags
|
|
|
|
riverctl map normal Super+Shift Tab send-to-output next
|
2024-01-14 22:09:07 -05:00
|
|
|
|
|
|
|
# Layout Controls
|
|
|
|
riverctl map normal Super+Alt H send-layout-cmd rivertile "main-ratio -0.05"
|
|
|
|
riverctl map normal Super+Alt L send-layout-cmd rivertile "main-ratio +0.05"
|
|
|
|
riverctl map normal Super I send-layout-cmd rivertile "main-count +1"
|
2024-02-10 12:31:53 -05:00
|
|
|
riverctl map normal Super+Shift I send-layout-cmd rivertile "main-count -1"
|
2024-01-14 22:09:07 -05:00
|
|
|
riverctl map normal Super Up send-layout-cmd rivertile "main-location top"
|
|
|
|
riverctl map normal Super Right send-layout-cmd rivertile "main-location right"
|
|
|
|
riverctl map normal Super Down send-layout-cmd rivertile "main-location bottom"
|
|
|
|
riverctl map normal Super Left send-layout-cmd rivertile "main-location left"
|
|
|
|
|
|
|
|
# Floating Controls
|
2024-03-01 22:20:02 -05:00
|
|
|
riverctl map normal Super+Shift F toggle-float
|
2024-01-14 22:09:07 -05:00
|
|
|
riverctl map normal Super+Control H move left 100
|
|
|
|
riverctl map normal Super+Control J move down 100
|
|
|
|
riverctl map normal Super+Control K move up 100
|
|
|
|
riverctl map normal Super+Control L move right 100
|
|
|
|
riverctl map normal Super+Shift+Control H snap left
|
|
|
|
riverctl map normal Super+Shift+Control J snap down
|
|
|
|
riverctl map normal Super+Shift+Control K snap up
|
|
|
|
riverctl map normal Super+Shift+Control L snap right
|
|
|
|
riverctl map normal Super+Alt+Shift H resize horizontal -100
|
|
|
|
riverctl map normal Super+Alt+Shift J resize vertical 100
|
|
|
|
riverctl map normal Super+Alt+Shift K resize vertical -100
|
|
|
|
riverctl map normal Super+Alt+Shift L resize horizontal 100
|
|
|
|
riverctl map-pointer normal Super BTN_LEFT move-view
|
|
|
|
riverctl map-pointer normal Super BTN_RIGHT resize-view
|
|
|
|
|
|
|
|
# Close focused view
|
|
|
|
riverctl map normal Super W close
|
|
|
|
riverctl map normal Super Q close
|
|
|
|
# Exit River
|
|
|
|
riverctl map normal Super+Shift Q exit
|
|
|
|
|
|
|
|
for i in $(seq 1 9)
|
|
|
|
do
|
|
|
|
tags=$((1 << ($i - 1)))
|
|
|
|
|
|
|
|
# Super+[1-9] to focus tag [0-8]
|
2024-03-01 22:20:02 -05:00
|
|
|
riverctl map normal Super $i spawn "riverctl set-focused-tags $tags"
|
2024-01-14 22:09:07 -05:00
|
|
|
|
|
|
|
# Super+Shift+[1-9] to tag focused view with tag [0-8]
|
2024-03-01 22:20:02 -05:00
|
|
|
riverctl map normal Super+Shift $i spawn "riverctl set-view-tags $tags"
|
2024-01-14 22:09:07 -05:00
|
|
|
|
|
|
|
# Super+Control+[1-9] to toggle focus of tag [0-8]
|
2024-03-01 22:20:02 -05:00
|
|
|
riverctl map normal Super+Control $i spawn "riverctl toggle-focused-tags $tags"
|
2024-01-14 22:09:07 -05:00
|
|
|
|
|
|
|
# Super+Shift+Control+[1-9] to toggle tag [0-8] of focused view
|
2024-03-01 22:20:02 -05:00
|
|
|
riverctl map normal Super+Shift+Control $i spawn "riverctl toggle-view-tags $tags"
|
2024-01-14 22:09:07 -05:00
|
|
|
done
|
2024-03-01 22:20:02 -05:00
|
|
|
MINIMIZED=$((1 << 20 ))
|
|
|
|
riverctl map normal Super M toggle-focused-tags ''${MINIMIZED}
|
|
|
|
riverctl map normal Super+Shift M set-view-tags ''${MINIMIZED}
|
|
|
|
ALL_BUT_MINIMIZED=$(( ((1 << 32) - 1 ) ^ $MINIMIZED ))
|
|
|
|
riverctl spawn-tagmask ''${ALL_BUT_MINIMIZED}
|
2024-01-14 22:09:07 -05:00
|
|
|
|
|
|
|
# Super+0 to focus all tags
|
|
|
|
# Super+Shift+0 to tag focused view with all tags
|
|
|
|
all_tags=$(((1 << 32) - 1))
|
2024-03-01 22:20:02 -05:00
|
|
|
riverctl map normal Super 0 spawn "riverctl set-focused-tags $all_tags"
|
|
|
|
riverctl map normal Super+Shift 0 spawn "riverctl set-view-tags $all_tags"
|
2024-01-14 22:09:07 -05:00
|
|
|
|
|
|
|
# Toggle fullscreen
|
|
|
|
riverctl map normal None F11 toggle-fullscreen
|
2024-03-01 22:20:02 -05:00
|
|
|
riverctl map normal Super F toggle-fullscreen
|
2024-01-14 22:09:07 -05:00
|
|
|
|
2024-03-01 22:20:02 -05:00
|
|
|
# Passthrough Mode
|
2024-01-14 22:09:07 -05:00
|
|
|
riverctl declare-mode passthrough
|
|
|
|
riverctl map normal Super F11 enter-mode passthrough
|
|
|
|
riverctl map passthrough Super F11 enter-mode normal
|
|
|
|
|
2024-03-01 22:20:02 -05:00
|
|
|
# Command Mode
|
|
|
|
riverctl declare-mode command
|
|
|
|
riverctl map normal Super B enter-mode command
|
|
|
|
riverctl map command None+Shift Comma spawn 'playerctl previous'
|
|
|
|
riverctl map command None Space spawn 'playerctl play-pause'
|
|
|
|
riverctl map command None+Shift Period spawn 'playerctl next'
|
|
|
|
riverctl map command None 1 spawn 'mullvad-browser'
|
|
|
|
riverctl map command None 2 spawn 'librewolf'
|
|
|
|
riverctl map command None 3 spawn 'libreoffice'
|
|
|
|
riverctl map command None 4 spawn 'thunderbird'
|
|
|
|
riverctl map command None 5 spawn 'discord'
|
|
|
|
riverctl map command None 6 spawn 'signal-desktop'
|
|
|
|
riverctl map command None 9 spawn 'steam'
|
|
|
|
riverctl map command None Z spawn 'riverctl toggle-fullscreen; riverctl enter-mode normal'
|
|
|
|
riverctl map command None Escape enter-mode normal
|
|
|
|
|
2024-01-14 22:09:07 -05:00
|
|
|
# Various media key mapping examples for both normal and locked mode which do
|
|
|
|
# not have a modifier
|
|
|
|
for mode in normal locked
|
|
|
|
do
|
|
|
|
riverctl map $mode None XF86Eject spawn 'eject -T'
|
|
|
|
|
|
|
|
# Control pulse audio volume with pamixer (https://github.com/cdemoulins/pamixer)
|
|
|
|
riverctl map $mode None XF86AudioRaiseVolume spawn 'pamixer -i 5'
|
|
|
|
riverctl map $mode None XF86AudioLowerVolume spawn 'pamixer -d 5'
|
|
|
|
riverctl map $mode None XF86AudioMute spawn 'pamixer --toggle-mute'
|
|
|
|
|
|
|
|
# Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl)
|
|
|
|
riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause'
|
|
|
|
riverctl map $mode None XF86AudioPlay spawn 'playerctl play-pause'
|
|
|
|
riverctl map $mode None XF86AudioPrev spawn 'playerctl previous'
|
|
|
|
riverctl map $mode None XF86AudioNext spawn 'playerctl next'
|
|
|
|
|
|
|
|
# Control screen backlight brightness with light (https://github.com/haikarainen/light)
|
|
|
|
riverctl map $mode None XF86MonBrightnessUp spawn 'light -A 5'
|
|
|
|
riverctl map $mode None XF86MonBrightnessDown spawn 'light -U 5'
|
|
|
|
done
|
|
|
|
|
|
|
|
# Set keyboard repeat rate
|
|
|
|
riverctl set-repeat 50 300
|
|
|
|
|
|
|
|
# Make all views with an app-id that starts with "float" and title "foo" start floating.
|
|
|
|
riverctl rule-add -app-id 'float*' -title 'foo' float
|
|
|
|
|
|
|
|
# Make all views with app-id "bar" and any title use client-side decorations
|
|
|
|
riverctl rule-add -app-id "bar" csd
|
|
|
|
|
|
|
|
# Global Configuration Settings
|
|
|
|
riverctl default-layout rivertile
|
|
|
|
rivertile -view-padding 10 -outer-padding 10 &
|
2024-01-25 00:38:01 -05:00
|
|
|
riverctl attach-mode bottom
|
2024-01-14 22:09:07 -05:00
|
|
|
riverctl hide-cursor timeout 10000
|
|
|
|
riverctl hide-cursor when-typing enabled
|
|
|
|
riverctl set-cursor-warp on-focus-change
|
|
|
|
riverctl focus-follows-cursor always
|
2024-01-16 22:43:56 -05:00
|
|
|
|
|
|
|
riverctl focus-output DP-1
|
|
|
|
riverctl send-layout-cmd rivertile "main-location right"
|
|
|
|
riverctl focus-output DP-2
|
|
|
|
riverctl send-layout-cmd rivertile "main-location left"
|
2024-01-14 22:09:07 -05:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|