migration
This commit is contained in:
14
X11/systemd/root/README.md
Normal file
14
X11/systemd/root/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Root Systemd
|
||||
|
||||
Put services in `/etc/systemd/system/*`
|
||||
|
||||
Run:
|
||||
|
||||
```
|
||||
sudo systemctl enable myservice@USERNAME.service
|
||||
sudo systemctl start myservice@USERNAME.service
|
||||
```
|
||||
|
||||
Files:
|
||||
|
||||
Check the service file for where the scripts should be located
|
||||
15
X11/systemd/root/betterlockscreen.service
Normal file
15
X11/systemd/root/betterlockscreen.service
Normal file
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Lockscreen
|
||||
Before=sleep.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=kokopi
|
||||
Environment=DISPLAY=:0
|
||||
ExecStart=/bin/betterlockscreen -l
|
||||
ExecStartPost=/bin/sleep 1
|
||||
|
||||
[Install]
|
||||
WantedBy=sleep.target
|
||||
WantedBy=suspend.target
|
||||
WantedBy=hibernate.target
|
||||
26
X11/systemd/root/i3lock-main
Executable file
26
X11/systemd/root/i3lock-main
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
###
|
||||
# --keyhl = color of inside the ring when typing
|
||||
# --bshl = color of inside the ring when backspacing
|
||||
###
|
||||
i3lock --image=/home/kokopi/pictures/redjuice.png -F \
|
||||
--radius=120 --ring-width=8 \
|
||||
--inside-color=ffffffaa \
|
||||
--ring-color=333333aa \
|
||||
--line-color=00000000 \
|
||||
--separator-color=00000000 \
|
||||
--insidewrong-color=ff000033 \
|
||||
--ringwrong-color=ff0000aa \
|
||||
\
|
||||
--keyhl-color=000000 \
|
||||
--bshl-color=ff4444 \
|
||||
\
|
||||
--clock --indicator \
|
||||
--time-color=333333 \
|
||||
--date-color=555555 \
|
||||
--clock --indicator \
|
||||
--noinput-text="Empty" \
|
||||
\
|
||||
--insidever-color=ffffff22 \
|
||||
--ringver-color=ffffffaa \
|
||||
--verif-color=ffffff
|
||||
14
X11/systemd/root/i3lockscreen@.service
Normal file
14
X11/systemd/root/i3lockscreen@.service
Normal file
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Lock screen before suspend
|
||||
Before=sleep.target suspend.target hibernate.target
|
||||
|
||||
[Service]
|
||||
User=%i
|
||||
Type=forking
|
||||
Environment=DISPLAY=:0
|
||||
ExecStart=/bin/bash /home/%i/.local/bin/lock-on-suspend
|
||||
TimeoutSec=10
|
||||
RemainAfterExit=no
|
||||
|
||||
[Install]
|
||||
WantedBy=sleep.target suspend.target hibernate.target
|
||||
38
X11/systemd/root/lock-on-suspend
Executable file
38
X11/systemd/root/lock-on-suspend
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
# Lock on suspend script
|
||||
# Save as /usr/local/bin/lock-on-suspend
|
||||
|
||||
# Get the user who is logged in to X
|
||||
USER=$(who | grep '(:0)' | awk '{print $1}' | head -n1)
|
||||
|
||||
# If no user found, try alternative method
|
||||
if [[ -z "$USER" ]]; then
|
||||
USER=$(ps aux | grep -E "(xinit|startx)" | grep -v grep | awk '{print $1}' | head -n1)
|
||||
fi
|
||||
|
||||
# Exit if no user found
|
||||
if [[ -z "$USER" ]]; then
|
||||
echo "No X user found"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Get user's home directory
|
||||
USER_HOME=$(getent passwd "$USER" | cut -d: -f6)
|
||||
|
||||
# Set environment variables for the user's X session
|
||||
export DISPLAY=:0
|
||||
export XAUTHORITY="$USER_HOME/.Xauthority"
|
||||
|
||||
# Path to your lock script (adjust this to your actual lock script path)
|
||||
LOCK_SCRIPT="$USER_HOME/.local/bin/i3lock-main"
|
||||
|
||||
# Lock as the user
|
||||
if [[ -f "$LOCK_SCRIPT" ]]; then
|
||||
sudo -u "$USER" "$LOCK_SCRIPT" &
|
||||
else
|
||||
# Fallback to basic i3lock
|
||||
sudo -u "$USER" i3lock --color=1a1a1a --clock --indicator &
|
||||
fi
|
||||
|
||||
# Give lock time to start
|
||||
sleep 1
|
||||
Reference in New Issue
Block a user