Experiment with emacs keybinds

This commit is contained in:
Andrew Scott 2023-06-18 03:57:48 -04:00
parent 813e050632
commit ad3dc5d3a9
Signed by: a
GPG key ID: 7CD5A5977E4931C1
2 changed files with 55 additions and 20 deletions

View file

@ -1,4 +1,9 @@
#!/bin/sh #!/bin/bash
# Do some logging
#exec 3>&1 4>&2
#trap 'exec 2>&4 1>&3' 0 1 2 3 RETURN
#exec 1>"${XDG_STATE_HOME}"/river.log 2>&1
# Start kitty # Start kitty
riverctl map normal Super Return spawn kitty riverctl map normal Super Return spawn kitty
@ -6,8 +11,12 @@ riverctl map normal Super Return spawn kitty
# Start fuzzel # Start fuzzel
riverctl map normal Super Space spawn fuzzel riverctl map normal Super Space spawn fuzzel
# Lock screen
riverctl map normal Control+Alt L spawn 'waylock-launcher'
# Logout # Logout
riverctl map normal Super End spawn 'wleave -p layer-shell' riverctl map normal Super End spawn 'wleave -p layer-shell'
riverctl map locked Super+Alt+Control End spawn 'loginctl kill-session $XDG_SESSION_ID'
# Screenshot entire display to clipboard # Screenshot entire display to clipboard
riverctl map normal Control Print spawn 'grim -t png - | wl-copy -t image/png' riverctl map normal Control Print spawn 'grim -t png - | wl-copy -t image/png'
@ -30,14 +39,23 @@ riverctl map normal Super+Shift E exit
# Focus the next/previous view in the layout stack # Focus the next/previous view in the layout stack
riverctl map normal Super J focus-view next riverctl map normal Super J focus-view next
riverctl map normal Super K focus-view previous riverctl map normal Super K focus-view previous
# emacs
riverctl map normal Super N focus-view next
riverctl map normal Super P focus-view previous
# Swap the focused view with the next/previous view in the layout stack # Swap the focused view with the next/previous view in the layout stack
riverctl map normal Super+Shift J swap next riverctl map normal Super+Alt J swap next
riverctl map normal Super+Shift K swap previous riverctl map normal Super+Alt K swap previous
# emacs
riverctl map normal Super+Alt N swap next
riverctl map normal Super+Alt P swap previous
# Focus the next/previous output # Focus the next/previous output
riverctl map normal Super L focus-output next riverctl map normal Super L focus-output next
riverctl map normal Super H focus-output previous riverctl map normal Super H focus-output previous
# emacs
riverctl map normal Super V focus-output next
riverctl map normal Super+Alt V focus-output previous
# Send the focused view to the next/previous output # Send the focused view to the next/previous output
riverctl map normal Super+Shift Grave send-to-output next riverctl map normal Super+Shift Grave send-to-output next
@ -49,22 +67,38 @@ riverctl map normal Super+Shift Return zoom
# Increase/decrease the main ratio of rivertile(1) # Increase/decrease the main ratio of rivertile(1)
riverctl map normal Super+Alt+Shift L send-layout-cmd rivertile "main-ratio -0.05" riverctl map normal Super+Alt+Shift L send-layout-cmd rivertile "main-ratio -0.05"
riverctl map normal Super+Alt+Shift H send-layout-cmd rivertile "main-ratio +0.05" riverctl map normal Super+Alt+Shift H send-layout-cmd rivertile "main-ratio +0.05"
#emacs
riverctl map normal Super B send-layout-cmd rivertile "main-ratio -0.05"
riverctl map normal Super F send-layout-cmd rivertile "main-ratio +0.05"
# Increment/decrement the main count of rivertile(1) # Increment/decrement the main count of rivertile(1)
riverctl map normal Super+Alt+Shift J send-layout-cmd rivertile "main-count +1" riverctl map normal Super+Alt+Shift J send-layout-cmd rivertile "main-count +1"
riverctl map normal Super+Alt+Shift K send-layout-cmd rivertile "main-count -1" riverctl map normal Super+Alt+Shift K send-layout-cmd rivertile "main-count -1"
#emacs
# Move views riverctl map normal Super+Alt F send-layout-cmd rivertile "main-count +1"
riverctl map normal Super+Alt H move left 100 riverctl map normal Super+Alt B send-layout-cmd rivertile "main-count -1"
riverctl map normal Super+Alt J move down 100
riverctl map normal Super+Alt K move up 100
riverctl map normal Super+Alt L move right 100
# Snap views to screen edges # Snap views to screen edges
riverctl map normal Super+Alt+Control H snap left riverctl map normal Super+Alt+Control H snap left
riverctl map normal Super+Alt+Control J snap down riverctl map normal Super+Alt+Control J snap down
riverctl map normal Super+Alt+Control K snap up riverctl map normal Super+Alt+Control K snap up
riverctl map normal Super+Alt+Control L snap right riverctl map normal Super+Alt+Control L snap right
#emacs
riverctl map normal Super+Alt+Control B snap left
riverctl map normal Super+Alt+Control N snap down
riverctl map normal Super+Alt+Control P snap up
riverctl map normal Super+Alt+Control F snap right
# Move views
riverctl map normal Super+Alt Left move left 100
riverctl map normal Super+Alt Down move down 100
riverctl map normal Super+Alt Up move up 100
riverctl map normal Super+Alt Right move right 100
#emacs
riverctl map normal Super+Alt+Shift B move left 100
riverctl map normal Super+Alt+Shift N move down 100
riverctl map normal Super+Alt+Shift P move up 100
riverctl map normal Super+Alt+Shift F move right 100
# Resize views # Resize views
riverctl map normal Super Right resize horizontal -100 riverctl map normal Super Right resize horizontal -100
@ -72,6 +106,12 @@ riverctl map normal Super Up resize vertical 100
riverctl map normal Super Down resize vertical -100 riverctl map normal Super Down resize vertical -100
riverctl map normal Super Left resize horizontal 100 riverctl map normal Super Left resize horizontal 100
# Change layout
riverctl map normal Super+Shift K send-layout-cmd rivertile "main-location top"
riverctl map normal Super+Shift L send-layout-cmd rivertile "main-location right"
riverctl map normal Super+Shift J send-layout-cmd rivertile "main-location bottom"
riverctl map normal Super+Shift H send-layout-cmd rivertile "main-location left"
# Move views with mouse # Move views with mouse
riverctl map-pointer normal Super BTN_LEFT move-view riverctl map-pointer normal Super BTN_LEFT move-view
@ -108,13 +148,7 @@ riverctl map normal Super+Shift 0 set-view-tags $all_tags
riverctl map normal Super S toggle-float riverctl map normal Super S toggle-float
# Toggle fullscreen # Toggle fullscreen
riverctl map normal Super F toggle-fullscreen riverctl map normal Super T toggle-fullscreen
# Change layout
riverctl map normal Super+Shift K send-layout-cmd rivertile "main-location top"
riverctl map normal Super+Shift L send-layout-cmd rivertile "main-location right"
riverctl map normal Super+Shift J send-layout-cmd rivertile "main-location bottom"
riverctl map normal Super+Shift H send-layout-cmd rivertile "main-location left"
# Declare a passthrough mode. This mode has only a single mapping to return to # Declare a passthrough mode. This mode has only a single mapping to return to
# normal mode. This makes it useful for testing a nested wayland compositor # normal mode. This makes it useful for testing a nested wayland compositor
@ -187,7 +221,7 @@ riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad scroll-method two-finger
riverctl map-switch normal lid close 'waylock-launcher' riverctl map-switch normal lid close 'waylock-launcher'
{{- end }} {{- end }}
### "rule-add" not implemented yet??? ### "rule-add" not until 0.3.0
# Make all views with an app-id that starts with "float" and title "foo" start floating. # Make all views with an app-id that starts with "float" and title "foo" start floating.
# riverctl rule-add float -app-id 'Bitwarden' # riverctl rule-add float -app-id 'Bitwarden'
# riverctl rule-add float -app-id 'Blueman-manager' # riverctl rule-add float -app-id 'Blueman-manager'
@ -206,6 +240,7 @@ riverctl default-layout rivertile
rivertile -view-padding 4 -outer-padding 4 -main-ratio .5 & rivertile -view-padding 4 -outer-padding 4 -main-ratio .5 &
# Autostart # Autostart
dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river &
/usr/lib/at-spi-bus-launcher --launch-immediately & /usr/lib/at-spi-bus-launcher --launch-immediately &
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
gnome-keyring-daemon --start --components=pkcs11 & gnome-keyring-daemon --start --components=pkcs11 &

View file

@ -19,17 +19,17 @@ swayidle -w \
resume 'wlr-randr --output eDP-1 --on && kanshictl reload' \ resume 'wlr-randr --output eDP-1 --on && kanshictl reload' \
timeout 3600 'loginctl suspend-then-hibernate' \ timeout 3600 'loginctl suspend-then-hibernate' \
resume 'wlr-randr --output eDP-1 --on && kanshictl reload' \ resume 'wlr-randr --output eDP-1 --on && kanshictl reload' \
2>&1 | "$LOG_FILE" & disown 2>&1 | tee -a "$LOG_FILE" & disown
{{- else if eq .chezmoi.hostname "hydrus" }} {{- else if eq .chezmoi.hostname "hydrus" }}
# lock: 5m, display: 15m # lock: 5m, display: 15m
swayidle -w \ swayidle -w \
timeout 300 'waylock-launcher' \ timeout 300 'waylock-launcher' \
timeout 900 'wlr-randr --output DP-1 --off --output DP-2 --off' \ timeout 900 'wlr-randr --output DP-1 --off --output DP-2 --off' \
resume 'wlr-randr --output DP-1 --on --output DP-2 --on && kanshictl reload' \ resume 'wlr-randr --output DP-1 --on --output DP-2 --on && kanshictl reload' \
2>&1 | "$LOG_FILE" & disown 2>&1 | tee -a "$LOG_FILE" & disown
{{- else }} {{- else }}
# lock after 5m # lock after 5m
swayidle -w \ swayidle -w \
timeout 300 'waylock-launcher' \ timeout 300 'waylock-launcher' \
2>&1 | "$LOG_FILE" & disown 2>&1 | tee -a "$LOG_FILE" & disown
{{ end }} {{ end }}