nix

configuration files that power my machines
Log | Files | Refs | README | LICENSE

init (5572B)


      1 #!/bin/bash
      2 set -x
      3 
      4 mod="Mod1"
      5 alt="Mod4"
      6 
      7 term="foot"
      8 wobsock="$XDG_RUNTIME_DIR/wob.sock"
      9 
     10 dmenu_args="-vi -fn 'Ttyp0 OTB:size=10' -l 10 -h 20 -nb '#0d1612' -nf '#d6deeb' -sb '#1d3b2e' -sf '#d6deeb' -nhb '#0d1612' -nhf '#7fdbca'"
     11 
     12 rivertile -view-padding 0 -outer-padding 0 -main-ratio 0.50 &
     13 
     14 riverctl background-color "0x0d1612"
     15 riverctl border-color-focused "0x7fdbca"
     16 riverctl border-color-unfocused "0x1d3b2e"
     17 riverctl border-width 1
     18 
     19 riverctl set-repeat 50 300
     20 
     21 riverctl default-layout rivertile
     22 
     23 riverctl xcursor-theme McMojave 16
     24 
     25 riverctl input "pointer-1189-32769-BenQ_ZOWIE_BenQ_ZOWIE_Gaming_Mouse" pointer-accel 0.0
     26 riverctl input "pointer-1133-45108-Logitech_MX_Master_3S" pointer-accel 0.0
     27 riverctl input "pointer-1133-16500-Logitech_G305" pointer-accel 0.0
     28 
     29 riverctl attach-mode top
     30 riverctl focus-follows-cursor normal
     31 
     32 riverctl map normal Super Return zoom
     33 
     34 riverctl map normal $mod+Shift Return spawn "$term"
     35 riverctl map normal $alt+Shift Return spawn "$term"
     36 
     37 riverctl map normal $mod p spawn "dmenu_run $dmenu_args"
     38 riverctl map normal $alt p spawn "dmenu_run $dmenu_args"
     39 
     40 riverctl map normal Control+$alt l spawn "waylock"
     41 riverctl map normal Control+$mod l spawn "monofetch"
     42 
     43 riverctl map normal $mod+Shift o spawn "todomenu $dmenu_args"
     44 riverctl map normal $alt+Shift d spawn "clipmenu $dmenu_args"
     45 riverctl map normal $alt+Shift l spawn "langmenu $dmenu_args"
     46 riverctl map normal $alt+Shift h spawn "huemenu $dmenu_args"
     47 
     48 riverctl map normal $mod+Shift m spawn "plsmenu $dmenu_args"
     49 riverctl map normal $alt+Shift m spawn "plsmenu $dmenu_args"
     50 
     51 riverctl map normal $mod+Shift b spawn "btmenu con $dmenu_args"
     52 riverctl map normal $alt+Shift b spawn "btmenu dis $dmenu_args"
     53 
     54 riverctl map normal $mod+Shift p spawn "passmenu $dmenu_args"
     55 riverctl map normal $alt+Shift p spawn "passmenu $dmenu_args"
     56 
     57 riverctl map normal $mod+Shift s spawn "screenshot"
     58 riverctl map normal $alt+Shift s spawn "screenshot"
     59 
     60 riverctl map normal $mod+Shift t spawn "yank-to-todo"
     61 riverctl map normal $alt+Shift t spawn "tempmenu $dmenu_args"
     62 
     63 riverctl map normal None XF86AudioMute spawn "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && (wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep -q MUTED && echo 0 > $wobsock) || wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g' > $wobsock"
     64 riverctl map normal None XF86AudioLowerVolume spawn "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- && wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g' > $wobsock"
     65 riverctl map normal None XF86AudioRaiseVolume spawn "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ && wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g' > $wobsock"
     66 
     67 riverctl map normal None XF86MonBrightnessUp spawn "brightnessctl set +5% | sed -En 's/.*\(([0-9]+)%\).*/\1/p' > $wobsock"
     68 riverctl map normal None XF86MonBrightnessDown spawn "brightnessctl set 5%- | sed -En 's/.*\(([0-9]+)%\).*/\1/p' > $wobsock"
     69 
     70 riverctl map normal $mod+Shift c close
     71 riverctl map normal $alt+Shift c close
     72 
     73 riverctl map normal $mod j focus-view next
     74 riverctl map normal $mod k focus-view previous
     75 
     76 riverctl map normal $mod+Shift j swap next
     77 riverctl map normal $mod+Shift k swap previous
     78 
     79 riverctl map normal $mod h send-layout-cmd rivertile "main-ratio -0.05"
     80 riverctl map normal $mod l send-layout-cmd rivertile "main-ratio +0.05"
     81 
     82 riverctl map normal $mod i send-layout-cmd rivertile "main-count +1"
     83 riverctl map normal $mod d send-layout-cmd rivertile "main-count -1"
     84 
     85 riverctl map normal $mod+Shift Space toggle-float
     86 
     87 riverctl map normal $mod+Shift f toggle-fullscreen
     88 riverctl map normal $alt+Shift f toggle-fullscreen
     89 
     90 riverctl map normal $mod Space spawn "dunstctl close"
     91 riverctl map normal $alt Space spawn "dunstctl history-pop"
     92 
     93 for i in $(seq 1 9); do
     94 	tags=$((1 << (i - 1)))
     95 	riverctl map normal $mod "$i" set-focused-tags "$tags"
     96 	riverctl map normal $mod+Shift "$i" set-view-tags "$tags"
     97 	riverctl map normal $mod+Control "$i" toggle-focused-tags "$tags"
     98 	riverctl map normal $mod+Shift+Control "$i" toggle-view-tags "$tags"
     99 
    100 	riverctl map normal $alt "$i" set-focused-tags "$tags"
    101 	riverctl map normal $alt+Shift "$i" set-view-tags "$tags"
    102 	riverctl map normal $alt+Control "$i" toggle-focused-tags "$tags"
    103 	riverctl map normal $alt+Shift+Control "$i" toggle-view-tags "$tags"
    104 done
    105 
    106 riverctl map normal $mod 0 set-focused-tags $(((1 << 32) - 1))
    107 riverctl map normal $mod 0 set-focused-tags $(((1 << 32) - 1))
    108 riverctl map normal $mod+Shift 0 set-view-tags $(((1 << 32) - 1))
    109 
    110 riverctl map normal $alt 0 set-focused-tags $(((1 << 32) - 1))
    111 riverctl map normal $alt 0 set-focused-tags $(((1 << 32) - 1))
    112 riverctl map normal $alt+Shift 0 set-view-tags $(((1 << 32) - 1))
    113 
    114 riverctl map-pointer normal $mod BTN_LEFT move-view
    115 riverctl map-pointer normal $mod BTN_RIGHT resize-view
    116 riverctl map-pointer normal $mod BTN_MIDDLE toggle-float
    117 
    118 riverctl map normal $mod period focus-output next
    119 riverctl map normal $mod comma focus-output previous
    120 
    121 riverctl map normal $mod+Shift period send-to-output next
    122 riverctl map normal $mod+Shift comma send-to-output previous
    123 
    124 riverctl map normal $alt Tab focus-previous-tags
    125 riverctl map normal $alt+Shift Tab send-to-previous-tags
    126 
    127 riverctl map normal $mod Tab focus-previous-tags
    128 riverctl map normal $mod+Shift Tab send-to-previous-tags
    129 
    130 swaybg -m fill -c "#0d1612" -i "$HOME/misc/random/wallpapers/curtains.jpg" &
    131 mkfifo "$wobsock" && tail -f "$wobsock" | wob &
    132 wl-paste --watch cliphist store &
    133 
    134 services_to_start=(
    135 	battery-notify
    136 	dunst
    137 	pipewire
    138 	kanshi
    139 	psi-notify
    140 	memcached
    141 	nix-daemon
    142 )
    143 
    144 for s in "${services_to_start[@]}"; do
    145 	"$s" 2>&1 | vlogger -t "$s" &
    146 done