This commit is contained in:
2025-11-08 12:35:53 +01:00
parent eae4e0cf7b
commit 33a66fc273
172 changed files with 230 additions and 81 deletions

View File

@@ -97,16 +97,79 @@ Personally, I'm getting a rare chance to critically examine all the little confi
* Appendix A: Transient Terminal Sources
=togglescratch=
#+INCLUDE: "~/Scripts/togglescratch" src fish
#+BEGIN_SRC fish
#!/usr/bin/env fish
if test ! -e /tmp/scratch_id
exec xst -e makescratch
end
set nid (cat /tmp/scratch_id)
if test -e /tmp/scratch_on
rm /tmp/scratch_on
bspc node $nid --to-desktop z
else
touch /tmp/scratch_on
bspc node $nid --to-desktop focused --focus --state fullscreen --flag private=on
end
#+END_SRC
=makescratch=
#+INCLUDE: "~/Scripts/makescratch" src fish
#+BEGIN_SRC fish
#!/bin/fish
set nid (xdo id)
echo $nid > /tmp/scratch_id
bspc node $nid --state fullscreen --flag private=on --to-desktop focused
touch /tmp/scratch_on
set decid (printf '%d' $nid)
xdotool set_window --name "scratchterminal" $decid
exec "$HOME/Scripts/cleanscratch"
#+END_SRC
=cleanscratch=
#+INCLUDE: "~/Scripts/cleanscratch" src fish
#+BEGIN_SRC fish
#!/usr/bin/env fish
$SHELL
rm /tmp/scratch_id
rm /tmp/scratch_on
#+END_SRC
=picom.conf=
#+INCLUDE: "~/.config/picom.conf" src
#+BEGIN_SRC
fading = true;
no-fading-openclose = true;
fade-delta = 5;
vsync = true;
backend="glx";
opacity-rule=["90:name = 'scratchterminal'"];
#opacity-rule=["90:class_g = 'xst-256color'"];
#+END_SRC
* Appendix B: lock.py
#+INCLUDE: "~/Scripts/lock.py" src python
#+BEGIN_SRC fish
#!/usr/bin/python3
import os
import sys
import time
if __name__ == "__main__":
width, height, lwidth, lheight = 2256, 1504, 320, 320
icon = "$HOME/Pictures/lock_small.png"
pape = os.popen("cat /tmp/wallpaper").read()[:-1]
cache = os.popen("cat /tmp/lockscreen_cache").read()[:-1]
if pape != cache or '--ignore-cache' in sys.argv:
os.popen(f"convert {pape} -resize {width}x{height} -background black -gravity center -extent {width}x{height} /tmp/wallpaper.png").read()
os.popen(f"convert -composite /tmp/wallpaper.png {icon} -geometry +{width//2 - lwidth//2}+{height//2 - lheight//2} /tmp/wallpaper.png").read()
os.popen(f"echo {pape} > /tmp/lockscreen_cache")
os.popen("i3lock -u -i /tmp/wallpaper.png")
time.sleep(0.5)
os.popen("loginctl suspend")
#+END_SRC