dotfiles

my shiny new dotfiles
git clone git://git.jakekoroman.com/dotfiles
Log | Files | Refs | README

init (7621B)


      1 #!/bin/bash
      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 # Note: the "Super" modifier is also known as Logo, GUI, Windows, Mod4, etc.
     12 
     13 riverctl map normal Super Return spawn $TERMINAL
     14 riverctl map normal Super+Shift+Control+Alt N spawn '$TERMINAL -e newsboat'
     15 riverctl map normal Super+Shift+Control+Alt M spawn '$TERMINAL -e neomutt'
     16 riverctl map normal Super+Shift+Control+Alt R spawn fuzzel
     17 riverctl map normal Super+Shift+Control+Alt E spawn 'emacsclient -c -a "emacs"'
     18 riverctl map normal Super+Shift+Control+Alt Delete spawn myswaylock
     19 riverctl map normal Super+Shift+Control+Alt Period spawn rdpmenu
     20 riverctl map normal Super+Shift+Control+Alt Slash spawn bookmarks
     21 riverctl map normal Super+Shift+Control+Alt S spawn 'wayshot -s "$(slurp)" --stdout | swappy -f -'
     22 riverctl map normal Super+Shift+Control+Alt P spawn passmenu-otp
     23 
     24 riverctl map normal Super+Shift C close
     25 riverctl map normal Super+Control Q exit
     26 
     27 # Super+J and Super+K to focus the next/previous view in the layout stack
     28 riverctl map normal Super E focus-view next
     29 riverctl map normal Super I focus-view previous
     30 
     31 # Super+Shift+J and Super+Shift+K to swap the focused view with the next/previous
     32 # view in the layout stack
     33 riverctl map normal Super+Shift E swap next
     34 riverctl map normal Super+Shift I swap previous
     35 
     36 # Super+Period and Super+Comma to focus the next/previous output
     37 riverctl map normal Super Period focus-output right
     38 riverctl map normal Super Comma focus-output left
     39 
     40 # Super+Shift+{Period,Comma} to send the focused view to the next/previous output
     41 riverctl map normal Super+Shift Period send-to-output -current-tags right
     42 riverctl map normal Super+Shift Comma send-to-output -current-tags left
     43 
     44 # Super+Shift+Return to bump the focused view to the top of the layout stack
     45 riverctl map normal Super M zoom
     46 
     47 # Super+H and Super+L to decrease/increase the main ratio of rivertile(1)
     48 riverctl map normal Super N send-layout-cmd rivertile "main-ratio -0.05"
     49 riverctl map normal Super O send-layout-cmd rivertile "main-ratio +0.05"
     50 
     51 # Super+Shift+H and Super+Shift+L to increment/decrement the main count of rivertile(1)
     52 riverctl map normal Super+Shift N send-layout-cmd rivertile "main-count +1"
     53 riverctl map normal Super+Shift O send-layout-cmd rivertile "main-count -1"
     54 
     55 # Super+Alt+{H,J,K,L} to move views
     56 riverctl map normal Super+Alt N move left 100
     57 riverctl map normal Super+Alt E move down 100
     58 riverctl map normal Super+Alt I move up 100
     59 riverctl map normal Super+Alt O move right 100
     60 
     61 # Super+Alt+Control+{H,J,K,L} to snap views to screen edges
     62 riverctl map normal Super+Alt+Control N snap left
     63 riverctl map normal Super+Alt+Control E snap down
     64 riverctl map normal Super+Alt+Control I snap up
     65 riverctl map normal Super+Alt+Control O snap right
     66 
     67 # Super+Alt+Shift+{H,J,K,L} to resize views
     68 riverctl map normal Super+Alt+Shift N resize horizontal -100
     69 riverctl map normal Super+Alt+Shift E resize vertical 100
     70 riverctl map normal Super+Alt+Shift I resize vertical -100
     71 riverctl map normal Super+Alt+Shift O resize horizontal 100
     72 
     73 # Super + Left Mouse Button to move views
     74 riverctl map-pointer normal Super BTN_LEFT move-view
     75 
     76 # Super + Right Mouse Button to resize views
     77 riverctl map-pointer normal Super BTN_RIGHT resize-view
     78 
     79 # Super + Middle Mouse Button to toggle float
     80 riverctl map-pointer normal Super BTN_MIDDLE toggle-float
     81 
     82 tag_names=(x a r s t)
     83 for i in $(seq 1 5)
     84 do
     85     tags=$((1 << ($i - 1)))
     86 
     87     # Super+[1-9] to focus tag [0-8]
     88     riverctl map normal Super ${tag_names[$i]} set-focused-tags $tags
     89 
     90     # Super+Shift+[1-9] to tag focused view with tag [0-8]
     91     riverctl map normal Super+Shift ${tag_names[$i]} set-view-tags $tags
     92 
     93     # Super+Control+[1-9] to toggle focus of tag [0-8]
     94     riverctl map normal Super+Control ${tag_names[$i]} toggle-focused-tags $tags
     95 
     96     # Super+Shift+Control+[1-9] to toggle tag [0-8] of focused view
     97     riverctl map normal Super+Shift+Control ${tag_names[$i]} toggle-view-tags $tags
     98 done
     99 
    100 # Super+0 to focus all tags
    101 # Super+Shift+0 to tag focused view with all tags
    102 all_tags=$(((1 << 32) - 1))
    103 riverctl map normal Super 0 set-focused-tags $all_tags
    104 riverctl map normal Super+Shift 0 set-view-tags $all_tags
    105 
    106 # Super+Space to toggle float
    107 riverctl map normal Super Space toggle-float
    108 
    109 # Super+F to toggle fullscreen
    110 riverctl map normal Super F toggle-fullscreen
    111 
    112 # Super+{Up,Right,Down,Left} to change layout orientation
    113 riverctl map normal Super Up    send-layout-cmd rivertile "main-location top"
    114 riverctl map normal Super Right send-layout-cmd rivertile "main-location right"
    115 riverctl map normal Super Down  send-layout-cmd rivertile "main-location bottom"
    116 riverctl map normal Super Left  send-layout-cmd rivertile "main-location left"
    117 
    118 # Declare a passthrough mode. This mode has only a single mapping to return to
    119 # normal mode. This makes it useful for testing a nested wayland compositor
    120 riverctl declare-mode passthrough
    121 
    122 # Super+F11 to enter passthrough mode
    123 riverctl map normal Super F11 enter-mode passthrough
    124 
    125 # Super+F11 to return to normal mode
    126 riverctl map passthrough Super F11 enter-mode normal
    127 
    128 # Various media key mapping examples for both normal and locked mode which do
    129 # not have a modifier
    130 for mode in normal locked
    131 do
    132     # Eject the optical drive (well if you still have one that is)
    133     riverctl map $mode None XF86Eject spawn 'eject -T'
    134 
    135     # Control pulse audio volume with pamixer (https://github.com/cdemoulins/pamixer)
    136     riverctl map $mode None XF86AudioRaiseVolume  spawn 'pamixer -i 2'
    137     riverctl map $mode None XF86AudioLowerVolume  spawn 'pamixer -d 2'
    138     riverctl map $mode None XF86AudioMute         spawn 'pamixer --toggle-mute'
    139 
    140     # Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl)
    141     riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause'
    142     riverctl map $mode None XF86AudioPlay  spawn 'playerctl play-pause'
    143     riverctl map $mode None XF86AudioPrev  spawn 'playerctl previous'
    144     riverctl map $mode None XF86AudioNext  spawn 'playerctl next'
    145 
    146     # Control screen backlight brightness with brightnessctl (https://github.com/Hummer12007/brightnessctl)
    147     riverctl map $mode None XF86MonBrightnessUp   spawn 'brightnessctl set +10%'
    148     riverctl map $mode None XF86MonBrightnessDown spawn 'brightnessctl set 10%-'
    149 done
    150 
    151 # Set background and border color
    152 riverctl background-color 0x002b36
    153 #riverctl border-color-focused 0x93a1a1
    154 riverctl border-color-focused 0xf53c3c
    155 riverctl border-color-unfocused 0x586e75
    156 
    157 # Set keyboard repeat rate
    158 riverctl set-repeat 50 300
    159 
    160 # Make all views with an app-id that starts with "float" and title "foo" start floating.
    161 riverctl rule-add -app-id 'float*' -title 'foo' float
    162 
    163 # Make all views with app-id "bar" and any title use client-side decorations
    164 riverctl rule-add -app-id "bar" csd
    165 
    166 riverctl rule-add -app-id emacs ssd
    167 riverctl rule-add -app-id LibreWolf ssd
    168 riverctl rule-add -app-id firefox-esr ssd
    169 riverctl rule-add -app-id steam ssd
    170 riverctl rule-add -app-id sakura ssd
    171 riverctl rule-add -app-id pavucontrol ssd
    172 riverctl rule-add -app-id virt-manager ssd
    173 
    174 riverctl focus-follows-cursor normal
    175 
    176 # Set the default layout generator to be rivertile and start it.
    177 # River will send the process group of the init executable SIGTERM on exit.
    178 riverctl default-layout rivertile
    179 rivertile -main-ratio 0.55 -view-padding 6 -outer-padding 6 &
    180 
    181 # source device specific options
    182 . ~/.config/river/device