···11-#!/bin/sh
22-33-# -- Application shortcuts --
44-55-# Open foot terminal with Super+Shift+Return
66-riverctl map normal Super+Shift Return spawn alacritty
77-88-# Run fuzzel with Super+Space
99-riverctl map normal Super Space spawn fuzzel
1010-1111-# Take screenshots
1212-riverctl map normal Super+Shift S spawn ".config/river/screenshot.sh -s"
1313-riverctl map normal None Print spawn ".config/river/screenshot.sh -f"
1414-1515-# -- Window shortcuts --
1616-1717-# Close window with Super+Q
1818-riverctl map normal Super Q close
1919-2020-# Exit river with Super+Shift+E
2121-riverctl map normal Super+Shift E exit
2222-2323-# Snap windows with Super+Shift+arrows
2424-riverctl map normal Super+Shift Left send-layout-cmd rivertile "main-location left"
2525-riverctl map normal Super+Shift Right send-layout-cmd rivertile "main-location right"
2626-2727-# Cycle through windows with Super+Tab
2828-riverctl map normal Super Tab focus-view next
2929-riverctl map normal Control Tab focus-view next
3030-3131-# Add media buttons
3232-riverctl map normal None XF86MonBrightnessUp spawn ".config/river/overlay.sh brightness up"
3333-riverctl map normal None XF86MonBrightnessDown spawn ".config/river/overlay.sh brightness down"
3434-3535-riverctl map normal None XF86AudioRaiseVolume spawn ".config/river/overlay.sh volume up"
3636-riverctl map normal None XF86AudioLowerVolume spawn ".config/river/overlay.sh volume down"
3737-riverctl map normal None XF86AudioMute spawn ".config/river/overlay.sh volume mute"
3838-3939-# Move windows with Super + LMB
4040-riverctl map-pointer normal Super BTN_LEFT move-view
4141-4242-# Resize windows with Super + RMB
4343-riverctl map-pointer normal Super BTN_RIGHT resize-view
4444-4545-# -- Mouse settings --
4646-4747-# Add natural scrolling
4848-riverctl input touchpad natural-scroll enabled
4949-5050-# Slow touchpad scrolling
5151-riverctl input touchpad scroll-factor 0.5
5252-5353-# Disable middle click on touchpad
5454-riverctl input touchpad middle-emulation disabled
5555-5656-# -- Workspaces --
5757-5858-for i in $(seq 1 5)
5959-do
6060- tags=$((1 << ($i - 1)))
6161-6262- riverctl map normal Super $i set-focused-tags $tags
6363-6464- riverctl map normal Super+Shift $i set-view-tags $tags
6565-done
6666-6767-# -- Colors and icons --
6868-6969-riverctl background-color 0x2e3440
7070-riverctl border-color-focused 0x4c566a
7171-riverctl border-color-unfocused 0x3b4252
7272-riverctl xcursor-theme "Bibata-Modern-Classic"
7373-7474-# -- Autostart --
7575-7676-# Start notification daemon with swaync
7777-riverctl spawn "swaync"
7878-7979-# Spawning waybar with simple config
8080-riverctl spawn "waybar -c $HOME/.config/waybar/river.jsonc -s $HOME/.config/waybar/style.css"
8181-8282-# Setting background with swaybg
8383-riverctl spawn "swaybg -m fill -i $HOME/Pictures/wallpapers/blue-dragon.png"
8484-8585-# Add wob pipe
8686-riverctl spawn "mkfifo /tmp/wobpipe && tail -f /tmp/wobpipe | wob"
8787-8888-# Enable idle management
8989-riverctl spawn "swayidle -w \
9090- timeout 60 'swaylock -f -c 000000' \
9191- timeout 120 'systemctl suspend'"
9292-9393-# -- Window rules --
9494-9595-# Rivertile as default tiler
9696-riverctl default-layout rivertile
9797-rivertile -view-padding 4 -outer-padding 4 &
-72
river/.config/river/overlay.sh
···11-#!/bin/bash
22-33-type="$1"
44-action="$2"
55-icon=""
66-percent=0
77-88-Help() {
99- echo "An overlay script to display an overlay while changing certain settings."
1010- echo
1111- echo "Syntax: overlay [volume|brightness] [up|down]"
1212- echo "options:"
1313- echo "volume adjust the volume"
1414- echo "brightness adjust the brightness"
1515- echo "up increase selected setting"
1616- echo "down decrease selected setting"
1717- echo "mute mute (only for volume)"
1818- echo
1919-}
2020-2121-Overlay() {
2222- echo $percent > /tmp/wobpipe
2323-}
2424-2525-if [ $# -lt 2 ]; then
2626- Help
2727- exit
2828-fi
2929-3030-if [ "$type" == "volume" ]; then
3131- percent=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2}')
3232- percent=${percent//./}
3333- icon=""
3434-3535- if [ $action == "up" ]; then
3636- if [ $percent -lt 100 ]; then
3737- wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
3838- percent=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2}')
3939- percent=${percent//./}
4040- else
4141- exit
4242- fi
4343- elif [ $action == "down" ]; then
4444- wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
4545- percent=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2}')
4646- percent=${percent//./}
4747- elif [ $action == "mute" ]; then
4848- wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
4949- mute=$(echo $(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $3}'))
5050-5151- if [ $mute == "[MUTED]" ]; then
5252- percent=0
5353- icon=""
5454- elif [ $mute == "" ]; then
5555- percent=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2}')
5656- percent=${percent//./}
5757- icon=""
5858- fi
5959- fi
6060-elif [ $type == "brightness" ]; then
6161- icon=""
6262-6363- if [ $action == "up" ]; then
6464- brightnessctl set +5%
6565- elif [ $action == "down" ]; then
6666- brightnessctl set 5%-
6767- fi
6868-6969- percent=$(brightnessctl i | grep -E -o '[0-9]+' | sed -n 2p)
7070-fi
7171-7272-Overlay
-44
river/.config/river/screenshot.sh
···11-#!/bin/bash
22-33-Help() {
44- echo "This script is a simple frontend to use grim and slurp in a more simplistic way."
55- echo
66- echo "Syntax: screenshot [-s|f|h]"
77- echo "options:"
88- echo "s Select a portion of the screen and take a screenshot."
99- echo "f Screenshot the full screen."
1010- echo "h Display this help message."
1111- echo
1212-}
1313-1414-if [ $# -eq 0 ]; then
1515- Help
1616- exit
1717-1818-fi
1919-2020-if [ ! -d $HOME/Pictures/screenshots ]; then
2121- mkdir -p $HOME/Pictures/screenshots
2222-fi
2323-2424-SCREENSHOT_DATE=$(date +'%Y-%m-%d_%H.%M.%S')
2525-SCREENSHOT_PATH="$HOME/Pictures/screenshots/$SCREENSHOT_DATE.png"
2626-2727-while getopts ":hfs" option; do
2828- case $option in
2929- h) # displays help
3030- Help
3131- exit;;
3232- f) # screenshot full screen
3333- grim $SCREENSHOT_PATH
3434- notify-send -i $SCREENSHOT_PATH "Screenshot" "New screenshot saved as $SCREENSHOT_DATE.png"
3535- exit;;
3636- s) # select a portion and screenshot
3737- grim -g "$(slurp)" $SCREENSHOT_PATH
3838- notify-send -i $SCREENSHOT_PATH "Screenshot" "New screenshot saved as $SCREENSHOT_DATE"
3939- exit;;
4040- \?) # catchall
4141- Help
4242- exit;;
4343- esac
4444-done