migration

This commit is contained in:
kokopi-dev
2025-10-28 16:23:11 +09:00
commit 2f27c335cf
116 changed files with 8221 additions and 0 deletions

6
X11/lockscreen/README.md Normal file
View File

@@ -0,0 +1,6 @@
`i3lockscreen@.service` -> /etc/systemd/system/i3lockscreen@.service
`i3-main lock-on-suspend` -> /home/$USER/.local/bin
## Enable
`sudo systemctl enable i3lockscreen@USERNAME.service`
test: `sudo systemctl start i3lockscreen@USERNAME.service`

View File

@@ -0,0 +1,27 @@
#!/bin/bash
###
# --keyhl = color of inside the ring when typing
# --bshl = color of inside the ring when backspacing
###
i3lock --image=/home/$USER/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

View 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

View 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