aboutsummaryrefslogtreecommitdiff
path: root/dotfiles
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-12-20 00:36:11 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-12-20 00:36:11 +0300
commit16971f5221dfa1b8154b9537432985ad2d43b659 (patch)
tree48121d70aba36266c78aad867fe74f56f12be11e /dotfiles
parentbf4229998a0f02b2ead99091e465b8314835e710 (diff)
downloadswayrice-16971f5221dfa1b8154b9537432985ad2d43b659.tar.gz
swayrice-16971f5221dfa1b8154b9537432985ad2d43b659.zip
sway session improvements
* Fix screen sharing * Config for xdpw * Better way of launching sway and dbus * Terminate all user processes on logout; this is to login to a clean session on after logout, can be worked around.
Diffstat (limited to 'dotfiles')
-rw-r--r--dotfiles/.config/sway/config2
-rw-r--r--dotfiles/.config/xdg-desktop-portal-wlr/config3
-rwxr-xr-xdotfiles/.local/bin/swayrecord2
-rw-r--r--dotfiles/.profile9
4 files changed, 12 insertions, 4 deletions
diff --git a/dotfiles/.config/sway/config b/dotfiles/.config/sway/config
index 40aef3b..f751362 100644
--- a/dotfiles/.config/sway/config
+++ b/dotfiles/.config/sway/config
@@ -66,6 +66,8 @@ exec blueman-applet
exec mako
# Environment variables for cron scripts
exec_always setsessionenv
+# xdg-desktop-portal screen sharing crap
+exec dbus-update-activation-environment DISPLAY I3SOCK SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
# Workspace names
# to display names or symbols instead of plain workspace numbers you can use
diff --git a/dotfiles/.config/xdg-desktop-portal-wlr/config b/dotfiles/.config/xdg-desktop-portal-wlr/config
new file mode 100644
index 0000000..31bf41a
--- /dev/null
+++ b/dotfiles/.config/xdg-desktop-portal-wlr/config
@@ -0,0 +1,3 @@
+[screencast]
+chooser_type = simple
+chooser_cmd = slurp -f %o -ro
diff --git a/dotfiles/.local/bin/swayrecord b/dotfiles/.local/bin/swayrecord
index b4e2aa6..3d16e07 100755
--- a/dotfiles/.local/bin/swayrecord
+++ b/dotfiles/.local/bin/swayrecord
@@ -81,7 +81,7 @@ screenshare () {
loopbackcam="$(v4l2-ctl --list-devices | \
grep v4l2loopback -m1 -A1 | \
sed -e '1d' -e 's/\s//g')"
- wf-recorder -o "$MONITOR" -x yuv420p -c rawvideo -m v4l2 -f $loopbackcam &
+ wf-recorder -o "$MONITOR" -c rawvideo -m v4l2 -f $loopbackcam -x yuv420p -t &
VIDEO_PID=$!
echo $$ > ~/.cache/recordingpid
echo "📺" > ~/.cache/recordingicon
diff --git a/dotfiles/.profile b/dotfiles/.profile
index 7cfd00d..00fed07 100644
--- a/dotfiles/.profile
+++ b/dotfiles/.profile
@@ -44,9 +44,12 @@ eval "$(dircolors "$HOME/.config/dir_colors")"
# Start sway automatically upon login on tty1 or tty2
if [ -z $DISPLAY ] && [ $(tty) = /dev/tty1 ] || [ $(tty) = /dev/tty2 ]; then
- # DBUS variables (for Artix)
- export $(dbus-launch)
- exec sway -d 2> ~/.cache/sway.log 1> /dev/null && clear && exit
+ dbus-run-session sway
+ if [ $? = 0 ] && [ ! -e ~/.cache/dont-kill ]; then
+ killall -u $(whoami)
+ clear
+ exit
+ fi
mv ~/.cache/sway.log ~/.cache/sway-crash-$(date +"%Y-%m-%dT%H:%M").log
fi