aboutsummaryrefslogtreecommitdiff
path: root/river
diff options
context:
space:
mode:
authorbozo.kopic <bozo@kopic.xyz>2024-01-08 18:50:10 +0100
committerbozo.kopic <bozo@kopic.xyz>2024-01-08 18:50:10 +0100
commit39abd6b00a427ac4d33564d9a00cde35abe90be8 (patch)
treec92ea389ab832929263612b556f8f141feb9ea1a /river
parent52ee08731eeebed097cf2d17c76597d7ded5b038 (diff)
.
Diffstat (limited to 'river')
-rwxr-xr-xriver/init54
-rwxr-xr-xriver/run-river.sh10
2 files changed, 49 insertions, 15 deletions
diff --git a/river/init b/river/init
index 5adcc00..8fb3a70 100755
--- a/river/init
+++ b/river/init
@@ -2,6 +2,9 @@
mod=Mod4
+# displays="$(wlr-randr | grep -e '^[[:alnum:]]' | cut -d ' ' -f 1)"
+# primary=eDP-1
+
# riverctl map normal None F12 spawn ~/.config/river/terminal.sh
# riverctl map normal None Print spawn spectacle
@@ -17,10 +20,22 @@ riverctl map normal $mod+Shift Q close
riverctl map normal $mod+Shift Return toggle-fullscreen
riverctl map normal $mod+Shift Space toggle-float
-for i in $(seq 1 9); do
- tags=$((1 << ($i - 1)))
- riverctl map normal $mod $i set-focused-tags $tags
- riverctl map normal $mod+Shift $i set-view-tags $tags
+riverctl map normal $mod h focus-view left
+riverctl map normal $mod j focus-view down
+riverctl map normal $mod k focus-view up
+riverctl map normal $mod l focus-view right
+
+riverctl map normal $mod+Shift H swap left
+riverctl map normal $mod+Shift J swap down
+riverctl map normal $mod+Shift K swap up
+riverctl map normal $mod+Shift L swap right
+
+for i in 1:1 2:2 3:3 4:4 5:a 6:s 7:d 8:f; do
+ index=${i%:*}
+ key=${i#*:}
+ tags=$((1 << ($index - 1)))
+ riverctl map normal $mod $key set-focused-tags $tags
+ riverctl map normal $mod+Shift $key set-view-tags $tags
done
riverctl focus-follows-cursor normal
@@ -30,19 +45,28 @@ riverctl xcursor-theme default 32
riverctl default-layout rivertile
# export GDK_DPI_SCALE=0.95
-gsettings set org.gnome.desktop.interface scaling-factor 1
-gsettings set org.gnome.desktop.interface text-scaling-factor 1
-gsettings set org.gnome.desktop.interface cursor-size 32
+if command -v gsettings > /dev/null; then
+ gsettings set org.gnome.desktop.interface scaling-factor 1
+ gsettings set org.gnome.desktop.interface text-scaling-factor 1
+ gsettings set org.gnome.desktop.interface cursor-size 32
+fi
export QT_QPA_PLATFORM=wayland
-systemctl --user import-environment \
- QT_QPA_PLATFORM \
- WAYLAND_DISPLAY \
- XDG_SESSION_TYPE \
- XDG_CURRENT_DESKTOP
-dbus-update-activation-environment --systemd --all
-
-systemctl --user restart plasma-kactivitymanagerd.service
+export XDG_CURRENT_DESKTOP=river
+
+if command -v systemctl > /dev/null; then
+ systemctl --user import-environment \
+ QT_QPA_PLATFORM \
+ SWAYSOCK \
+ WAYLAND_DISPLAY \
+ XDG_SESSION_TYPE \
+ XDG_CURRENT_DESKTOP
+ dbus-update-activation-environment --systemd --all
+
+ systemctl --user restart xdg-desktop-portal
+ systemctl --user restart xdg-desktop-portal-wlr
+ systemctl --user restart plasma-kactivitymanagerd
+fi
waybar -c ~/.config/waybar/river.conf &
diff --git a/river/run-river.sh b/river/run-river.sh
new file mode 100755
index 0000000..1fb1620
--- /dev/null
+++ b/river/run-river.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+exec > ~/.river.log 2>&1
+
+if ( ( command -v systemctl && systemctl --user is-system-running ) ||
+ pgrep -U $(id -u) dbus-daemon ) > /dev/null; then
+ exec river
+else
+ exec dbus-run-session -- river
+fi