dotfiles/.config/river/init
2025-08-12 23:01:17 -06:00

110 lines
4.1 KiB
Bash
Executable file

#!/bin/sh
source $HOME/.cache/wal/colors-wal-river
# Set background and border color
riverctl background-color "0x$background"
riverctl border-color-focused "0x$color1"
riverctl border-color-unfocused "0x$color2"
riverctl spawn "slstatus | dam"
riverctl spawn "wbg "$wallpaper""
riverctl spawn "swayidle"
riverctl spawn "mako"
riverctl focus-follows-cursor always
riverctl xcursor-theme macOS 28
riverctl keyboard-layout latam
riverctl input pointer-1739-0-Synaptics_TM3276-022 events disabled
# ModKey
mod="Super"
term="foot"
menu="mew-drun"
browser="librewolf"
# Shortcuts
riverctl map normal $mod+Shift Return spawn "$term" # Terminal
riverctl map normal $mod R spawn "$menu" # Launcher
riverctl map normal $mod+Shift Q spawn "sysutils"
riverctl map normal $mod+Shift Space spawn "emojimenu"
riverctl map normal $mod E spawn "$term --title lf lf"
riverctl map normal $mod V spawn "$term --title ncpamixer ncpamixer"
riverctl map normal $mod S spawn "$term --title Spotify spotify_player"
riverctl map normal $mod+Shift spawn "$browser"
riverctl map normal $mod+Shift C spawn "camera"
riverctl map normal $mod L spawn "swaylock"
riverctl map normal $mod+Shift S spawn "aws -r"
riverctl map normal None Print spawn "aws -f"
riverctl map normal None+Shift Print spawn "art"
riverctl map normal $mod Q close
riverctl map normal Super Return zoom
riverctl map-pointer normal $mod BTN_LEFT move-view
riverctl map-pointer normal $mod BTN_RIGHT resize-view
riverctl map normal $mod D spawn "river-shifttags --shift +1"
riverctl map normal $mod A spawn "river-shifttags --shift -1"
# River
riverctl default-attach-mode after 1
# Rivercarro
riverctl map normal $mod+Shift W send-layout-cmd rivercarro "main-location top"
riverctl map normal $mod+Shift D send-layout-cmd rivercarro "main-location right"
riverctl map normal $mod+Shift A send-layout-cmd rivercarro "main-location left"
riverctl map normal $mod+Shift M send-layout-cmd rivercarro "main-location monocle"
riverctl map normal $mod N send-layout-cmd rivercarro "main-location-cycle left,right,top,monocle"
riverctl map normal $mod Z send-layout-cmd rivercarro "main-ratio -0.05"
riverctl map normal $mod X send-layout-cmd rivercarro "main-ratio +0.05"
riverctl map normal $mod+Shift H send-layout-cmd rivercarro "main-count +1"
riverctl map normal $mod+Shift L send-layout-cmd rivercarro "main-count -1"
for i in $(seq 1 9)
do
tags=$((1 << ($i - 1)))
riverctl map normal Super $i set-focused-tags $tags
riverctl map normal Super+Shift $i set-view-tags $tags
riverctl map normal Super+Control $i toggle-focused-tags $tags
riverctl map normal Super+Shift+Control $i toggle-view-tags $tags
done
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
# Super+F to toggle fullscreen
riverctl map normal Super F toggle-fullscreen
for mode in normal locked
do
riverctl map normal None XF86AudioRaiseVolume spawn "wpctl set-volume -l 1.0 @DEFAULT_SINK@ 5%+ && pkill -RTMIN+2 slstatus"
riverctl map normal None XF86AudioLowerVolume spawn "wpctl set-volume -l 1.0 @DEFAULT_SINK@ 5%- && pkill -RTMIN+2 slstatus"
riverctl map normal None XF86AudioMute spawn "wpctl set-mute @DEFAULT_SINK@ toggle && pkill -RTMIN+2 slstatus"
riverctl map normal None XF86MonBrightnessUp spawn "brillo -a -u 125000 -q -A 5 && pkill -RTMIN+4 slstatus"
riverctl map normal None XF86MonBrightnessDown spawn "brillo -a -u 125000 -q -U 5 && pkill -RTMIN+4 slstatus"
done
riverctl set-repeat 25 600
riverctl hide-cursor when-typing enabled
# Make all views with an app-id that starts with "float" and title "foo" start floating.
riverctl rule-add -app-id "mpv" -title "webcam" float
# Make all views with app-id "bar" and any title use client-side decorations
riverctl rule-add -app-id "librewolf" ssd
riverctl rule-add -app-id "firefox" ssd
riverctl rule-add -app-id "org.pwmt.zathura" ssd
# River will send the process group of the init executable SIGTERM on exit.
riverctl default-layout rivercarro
rivercarro -outer-gaps 4 -inner-gaps 4 -per-tag -no-smart-gaps &