summaryrefslogtreecommitdiff
path: root/river/init
blob: 0e2f7d1d005f542484c8991d0c42bb830452ad54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/bin/sh

# Wayland stuff
export XDG_SESSION_TYPE=wayland
export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_DESKTOP=sway

export SDL_VIDEODRIVER=wayland

export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1

export VDPAU_DRIVER=radeonsi
export LIBVA_DRIVER_NAME=radeonsi

systemctl --user import-environment DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE
hash dbus-update-activation-environment 2>/dev/null && \
     dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE

# Input methods
riverctl keyboard-layout -options ctrl:swap_lalt_lctl,ctrl:swap_rwin_rctl vlomwide
riverctl input pointer-2362-628-PIXA3854:00_093A:0274_Touchpad tap enabled
riverctl xcursor-theme Adwaita 64
gsettings set org.gnome.desktop.interface cursor-theme Adwaita
gsettings set org.gnome.desktop.interface cursor-size 64

riverctl map normal Super Escape spawn 'riverctl keyboard-layout -options ctrl:swap_lalt_lctl,ctrl:swap_rwin_rctl vlomwide'
riverctl map normal Super+Shift Escape spawn 'riverctl keyboard-layout -options "" us'

# Basic execution
riverctl map normal Super T spawn foot
riverctl map normal Super D spawn run
riverctl map normal Super P spawn grim_slurp
riverctl map normal Super+Shift X spawn lock
riverctl map normal Super+Shift space spawn albumbler.py

# Close and Quit
riverctl map normal Super+Shift K close
riverctl map normal Super+Shift+Control Q exit

# Layouts
riverctl map normal Super S send-layout-cmd rivercarro "main-location right"
riverctl map normal Super R send-layout-cmd rivercarro "main-location top"
riverctl map normal Super A send-layout-cmd rivercarro "main-location monocle"

# Movement and focus
NEXT=I
PREV=C

riverctl map normal Super $NEXT focus-view next
riverctl map normal Super $PREV focus-view previous
riverctl map normal Super+Shift $NEXT swap next
riverctl map normal Super+Shift $PREV swap previous
riverctl map normal Super Return zoom

riverctl map normal Super Space toggle-float
riverctl map normal Super G toggle-fullscreen

# Outpus
riverctl map normal Super B focus-output next
riverctl map normal Super Comma focus-output previous
riverctl map normal Super+Shift B send-to-output next
riverctl map normal Super+Shift Comma send-to-output previous


# Ratio changes
LEFT=C
UPK=E
DNK=N
RIGHT=I
riverctl map normal Super $UPK send-layout-cmd rivercarro "main-ratio -0.05"
riverctl map normal Super $DNK send-layout-cmd rivercarro "main-ratio +0.05"
riverctl map normal Super+Shift $UPK send-layout-cmd rivercarro "main-count +1"
riverctl map normal Super+Shift $DNK send-layout-cmd rivercarro "main-count -1"

# Super+Alt+{H,J,K,L} to move views
riverctl map normal Super+Alt $LEFT move left 100
riverctl map normal Super+Alt $DNK move down 100
riverctl map normal Super+Alt $UPK move up 100
riverctl map normal Super+Alt $RIGHT move right 100

# Floating management i don't use
# riverctl map normal Super+Alt+Control $LEFT snap left
# riverctl map normal Super+Alt+Control $DNK snap down
# riverctl map normal Super+Alt+Control $UPK snap up
# riverctl map normal Super+Alt+Control $RIGHT snap right
# riverctl map normal Super+Alt+Shift $LEFT resize horizontal -100
# riverctl map normal Super+Alt+Shift $DNK resize vertical 100
# riverctl map normal Super+Alt+Shift $UPK resize vertical -100
# riverctl map normal Super+Alt+Shift $RIGHT resize horizontal 100

# Mouse floating management
riverctl map-pointer normal Super BTN_LEFT move-view
riverctl map-pointer normal Super+Shift BTN_LEFT resize-view
 # riverctl map-pointer normal Super BTN_MIDDLE toggle-float

riverctl map normal Super Tab focus-previous-tags
count=0
for i in F U H period V L O M; do
    tags=$((1 << count))
    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
    count=$(( 1 + count ))
done

# Passthrough mode
riverctl declare-mode passthrough
riverctl map normal Super F11 enter-mode passthrough
riverctl map passthrough Super F11 enter-mode normal

# Control keys
for mode in normal locked
do
    riverctl map $mode None XF86AudioRaiseVolume  spawn "pactl set-sink-volume 0 +2%"
    riverctl map $mode None XF86AudioLowerVolume  spawn "pactl set-sink-volume 0 -2%"
    riverctl map $mode None XF86AudioMute         spawn "pactl set-sink-mute 0 toggle"
    riverctl map $mode None XF86AudioPlay         spawn "mpc toggle"
    riverctl map $mode None XF86AudioPrev         spawn "mpc previous"
    riverctl map $mode None XF86AudioNext         spawn "mpc next"
    riverctl map $mode None XF86MonBrightnessUp   spawn "light -A 1"
    riverctl map $mode None XF86MonBrightnessDown spawn "light -U 1"
done

# Set background and border color
BG_COLOUR=002B36
AC_COLOUR=FF8C00
IN_COLOUR=586E75
riverctl background-color 0x"$BG_COLOUR"
riverctl border-color-focused 0x"$AC_COLOUR"
riverctl border-color-unfocused 0x"$IN_COLOUR"

# Set keyboard repeat rate
riverctl set-repeat 50 300

# Cursor follows focus
riverctl set-cursor-warp on-focus-change

# Set the default layout generator to be rivercarro and start it.
# River will send the process group of the init executable SIGTERM on exit.
riverctl default-layout rivercarro
rivercarro -main-location monocle &

# startup stuff
riverctl spawn bar
riverctl spawn "gammastep -l 52.2:4.5"