lock script and prayertimes managed by nix
This commit is contained in:
+1
-1
@@ -155,7 +155,7 @@ exec hash dbus-update-activation-environment 2>/dev/null && \
|
||||
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
|
||||
exec xfce4-power-manager
|
||||
#exec /usr/bin/uxplay -avdec
|
||||
bindsym $mod+l exec /home/shihaam/scripts/lock.sh
|
||||
bindsym $mod+l exec /home/shihaam/scripts/lock.sh # see home/lock.nix
|
||||
|
||||
# Notification centre: $mod+n opens the panel (past notifications, mpris,
|
||||
# DND toggle), $mod+Shift+n flips do-not-disturb. -sw closes it again on the
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# The screen lock bound to $mod+l in config/sway/config.
|
||||
#
|
||||
# It blanks the laptop panel, the keyboard backlight and the external monitor
|
||||
# (over DDC/CI) before swaylock, then restores whatever they were at. swaylock
|
||||
# itself comes from the sway module's default extraPackages, ddcutil from the
|
||||
# host's systemPackages, and brightnessctl from home/packages.nix.
|
||||
#
|
||||
# Linked as a plain executable rather than wrapped with writeShellApplication,
|
||||
# so it stays a file that can be edited and run on its own -- same reasoning as
|
||||
# home/prayertimes.nix.
|
||||
#
|
||||
# Iteration loop: edit scripts/lock.sh -> git add if new -> nixos-rebuild switch.
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
home.file."scripts/lock.sh" = {
|
||||
source = ../scripts/lock.sh;
|
||||
executable = true;
|
||||
};
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
ripdrag
|
||||
playerctl # waybar mediaplayer module + swaync's mpris widget
|
||||
libnotify # notify-send, used by config/waybar/scripts/monitor-brightness.sh
|
||||
brightnessctl # waybar backlight scroll + scripts/lock.sh
|
||||
fastfetch
|
||||
p7zip
|
||||
unrar # unfree
|
||||
|
||||
@@ -3,11 +3,6 @@
|
||||
#
|
||||
# Times come from github.com/WovenCoast/prayertimes-db and the lookup follows
|
||||
# git.shihaam.dev/flamexode/prayertimes-sh. Every island's table is vendored, so
|
||||
# switching island is an edit to config/prayertimes/islands.conf and a rebuild.
|
||||
#
|
||||
# Only the one script is linked out of scripts/, not the directory: ~/scripts
|
||||
# also holds unmanaged things, such as the lock.sh that config/sway/config binds
|
||||
# to $mod+l.
|
||||
#
|
||||
# Iteration loop: edit scripts/prayertimes.sh or config/prayertimes/islands.conf
|
||||
# -> git add if new -> nixos-rebuild switch -> prayertimes.sh today, and
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
./packages.nix
|
||||
./fonts.nix
|
||||
./kdeconnect.nix
|
||||
./lock.nix
|
||||
./nano.nix
|
||||
./obs.nix
|
||||
./prayertimes.nix
|
||||
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
prev_laptop=$(brightnessctl get)
|
||||
prev_monitor=$(ddcutil -d 1 getvcp 10 | awk '{print $9}' | tr -d ',')
|
||||
prev_kbd=$(brightnessctl -d tpacpi::kbd_backlight get)
|
||||
|
||||
ddcutil -d 1 setvcp 10 0 &
|
||||
brightnessctl set 0
|
||||
brightnessctl -d tpacpi::kbd_backlight set 0
|
||||
swaylock -e -c 000000
|
||||
ddcutil -d 1 setvcp 10 "$prev_monitor"
|
||||
brightnessctl set "$prev_laptop"
|
||||
brightnessctl -d tpacpi::kbd_backlight set "$prev_kbd"
|
||||
Reference in New Issue
Block a user