Files
repo-badwitch
repo-ptgdp
.directory
.gitignore
.gitmodules
README.md
add-appimage-to-apps
cconvert
colortest
cowsayeternal
domainfind
fetch
fork
g910-lights
i3-settree
i3lock-custom
mclevel
packetloss
ps1test
rmbspam
switchsession
te
test-notifications
tick
tmp
tubetop
tubetop2
xephwrap
xrdbupdate
bin/switchsession

11 lines
453 B
Bash
Executable File

#!/bin/bash
set -e
which busctl > /dev/null 2>&1
# Get the current Seat
SEAT=$(busctl get-property org.freedesktop.login1 /org/freedesktop/login1/session/auto org.freedesktop.login1.Session Seat | awk '{print $2}' | tr -d '"' | sed 's/^./\U&/')
# Call out to switch the current session
busctl call org.freedesktop.DisplayManager "/org/freedesktop/DisplayManager/${SEAT}" org.freedesktop.DisplayManager.Seat SwitchToGreeter
# Lock
loginctl lock-session