river: Automatically choose layout engine
Prefers filtile as layouting engine but falls back to rivertile if it does not find it.
This commit is contained in:
parent
987e4459bf
commit
dd62c8a2d0
1 changed files with 29 additions and 20 deletions
|
@ -3,11 +3,24 @@
|
||||||
mod="Mod4"
|
mod="Mod4"
|
||||||
modemod="Mod1"
|
modemod="Mod1"
|
||||||
term=${TERMINAL:-foot}
|
term=${TERMINAL:-foot}
|
||||||
layout="filtile"
|
|
||||||
time_to_lockscreen=300
|
time_to_lockscreen=300
|
||||||
time_to_screendim=600
|
time_to_screendim=600
|
||||||
time_to_suspend=900
|
time_to_suspend=900
|
||||||
|
|
||||||
|
layout_cmd="rivertile"
|
||||||
|
layout_opt="-main-ratio 0.65\
|
||||||
|
-outer-padding 0\
|
||||||
|
-view-padding 6"
|
||||||
|
|
||||||
|
if command -v filtile >/dev/null 2>&1; then
|
||||||
|
layout_cmd="filtile"
|
||||||
|
layout_opt="--tags all --output all main-ratio 0.65,\
|
||||||
|
--tags all --output all view-padding 6,\
|
||||||
|
--tags all --output all outer-padding 0,\
|
||||||
|
--tags all --output all smart-padding on,\
|
||||||
|
--tags all --output all smart-padding 0"
|
||||||
|
fi
|
||||||
|
|
||||||
NO_RESTART="$1"
|
NO_RESTART="$1"
|
||||||
should_start() { # 1=program binary name
|
should_start() { # 1=program binary name
|
||||||
# not running, start
|
# not running, start
|
||||||
|
@ -129,10 +142,10 @@ riverctl map normal $mod+Shift K swap previous
|
||||||
riverctl map normal $mod+Shift Return zoom
|
riverctl map normal $mod+Shift Return zoom
|
||||||
|
|
||||||
# change layout orientation
|
# change layout orientation
|
||||||
riverctl map normal $mod Up send-layout-cmd $layout "main-location top"
|
riverctl map normal $mod Up send-layout-cmd $layout_cmd "main-location top"
|
||||||
riverctl map normal $mod Right send-layout-cmd $layout "main-location right"
|
riverctl map normal $mod Right send-layout-cmd $layout_cmd "main-location right"
|
||||||
riverctl map normal $mod Down send-layout-cmd $layout "main-location bottom"
|
riverctl map normal $mod Down send-layout-cmd $layout_cmd "main-location bottom"
|
||||||
riverctl map normal $mod Left send-layout-cmd $layout "main-location left"
|
riverctl map normal $mod Left send-layout-cmd $layout_cmd "main-location left"
|
||||||
|
|
||||||
# snap views to screen edges
|
# snap views to screen edges
|
||||||
riverctl map normal $mod+Control H snap left
|
riverctl map normal $mod+Control H snap left
|
||||||
|
@ -143,8 +156,8 @@ riverctl map normal $mod+Control L snap right
|
||||||
# Mod+F to toggle fullscreen
|
# Mod+F to toggle fullscreen
|
||||||
riverctl map normal $mod F toggle-fullscreen
|
riverctl map normal $mod F toggle-fullscreen
|
||||||
# if we are running filtile we also have access to monocle mode
|
# if we are running filtile we also have access to monocle mode
|
||||||
if [ "$layout" = "filtile" ]; then
|
if [ "$layout_cmd" = "filtile" ]; then
|
||||||
riverctl map normal $mod+Shift F spawn "riverctl send-layout-cmd $layout monocle"
|
riverctl map normal $mod+Shift F spawn "riverctl send-layout-cmd $layout_cmd monocle"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
riverctl map normal $mod+Shift v toggle-float
|
riverctl map normal $mod+Shift v toggle-float
|
||||||
|
@ -153,8 +166,8 @@ riverctl map normal $mod+Shift v toggle-float
|
||||||
# Make all connected outputs show the desktop and no windows at all
|
# Make all connected outputs show the desktop and no windows at all
|
||||||
riverctl map normal $mod+Shift M spawn 'for i in $(wlopm | wc -l); do riverctl set-focused-tags $((1 << 10)); riverctl focus-output next; done; riverctl set-focused-tags $((1 << 10)); riverctl focus-output next'
|
riverctl map normal $mod+Shift M spawn 'for i in $(wlopm | wc -l); do riverctl set-focused-tags $((1 << 10)); riverctl focus-output next; done; riverctl set-focused-tags $((1 << 10)); riverctl focus-output next'
|
||||||
|
|
||||||
riverctl map normal $mod+Shift F10 spawn "riverctl send-layout-cmd $layout '--tags all --output all view-padding 0'"
|
riverctl map normal $mod+Shift F10 spawn "riverctl send-layout-cmd $layout_cmd '--tags all --output all view-padding 0'"
|
||||||
riverctl map normal $mod F10 spawn "riverctl send-layout-cmd $layout '--tags all --output all view-padding 6'"
|
riverctl map normal $mod F10 spawn "riverctl send-layout-cmd $layout_cmd '--tags all --output all view-padding 6'"
|
||||||
|
|
||||||
# Mod + Left Mouse Button to move views
|
# Mod + Left Mouse Button to move views
|
||||||
riverctl map-pointer normal $mod BTN_LEFT move-view
|
riverctl map-pointer normal $mod BTN_LEFT move-view
|
||||||
|
@ -179,11 +192,11 @@ riverctl map -repeat interact_float $mod J resize vertical 100
|
||||||
riverctl map -repeat interact_float $mod K resize vertical -100
|
riverctl map -repeat interact_float $mod K resize vertical -100
|
||||||
riverctl map -repeat interact_float $mod L resize horizontal 100
|
riverctl map -repeat interact_float $mod L resize horizontal 100
|
||||||
# decrease/increase the main ratio of layout
|
# decrease/increase the main ratio of layout
|
||||||
riverctl map interact_float $mod+Shift H send-layout-cmd $layout "main-ratio -0.05"
|
riverctl map interact_float $mod+Shift H send-layout-cmd $layout_cmd "main-ratio -0.05"
|
||||||
riverctl map interact_float $mod+Shift L send-layout-cmd $layout "main-ratio +0.05"
|
riverctl map interact_float $mod+Shift L send-layout-cmd $layout_cmd "main-ratio +0.05"
|
||||||
# increment/decrement the main layout
|
# increment/decrement the main layout
|
||||||
riverctl map interact_float $mod+Shift J send-layout-cmd $layout "main-count +1"
|
riverctl map interact_float $mod+Shift J send-layout-cmd $layout_cmd "main-count +1"
|
||||||
riverctl map interact_float $mod+Shift K send-layout-cmd $layout "main-count -1"
|
riverctl map interact_float $mod+Shift K send-layout-cmd $layout_cmd "main-count -1"
|
||||||
# snap views to screen edges
|
# snap views to screen edges
|
||||||
riverctl map interact_float $mod+Control H snap left
|
riverctl map interact_float $mod+Control H snap left
|
||||||
riverctl map interact_float $mod+Control J snap down
|
riverctl map interact_float $mod+Control J snap down
|
||||||
|
@ -334,12 +347,8 @@ should_start wl-paste && riverctl spawn "wl-paste -t text --watch clipman store"
|
||||||
# killall polkit-gnome-authentication-agent-1
|
# killall polkit-gnome-authentication-agent-1
|
||||||
# /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
|
# /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
|
||||||
# start layouting engine
|
# start layouting engine
|
||||||
killall $layout
|
killall $layout_cmd
|
||||||
riverctl spawn "$layout --tags all --output all main-ratio 0.65,\
|
riverctl spawn "$layout_cmd $layout_opt"
|
||||||
--tags all --output all view-padding 6,\
|
|
||||||
--tags all --output all outer-padding 0,\
|
|
||||||
--tags all --output all smart-padding on,\
|
|
||||||
--tags all --output all smart-padding 0"
|
|
||||||
# River will send the process group of the init executable SIGTERM on exit.
|
# River will send the process group of the init executable SIGTERM on exit.
|
||||||
riverctl default-layout $layout
|
riverctl default-layout $layout_cmd
|
||||||
brightnessctl set 70%
|
brightnessctl set 70%
|
||||||
|
|
Loading…
Reference in a new issue