mirror of
https://github.com/pigmonkey/spark.git
synced 2026-01-23 10:25:39 +00:00
always adjust screen brightness on lock
This commit is contained in:
parent
0e0ba1fa68
commit
b4c70afa3b
3 changed files with 22 additions and 4 deletions
17
roles/screensaver/files/lock.sh
Executable file
17
roles/screensaver/files/lock.sh
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
hash light 2> /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
BRIGHTNESS=true
|
||||
fi
|
||||
|
||||
if ! pidof physlock > /dev/null; then
|
||||
if [ "$BRIGHTNESS" = true ]; then
|
||||
light -O
|
||||
light -S 10
|
||||
fi
|
||||
/usr/sbin/physlock -m
|
||||
if [ "$BRIGHTNESS" = true ]; then
|
||||
light -I
|
||||
fi
|
||||
fi
|
||||
|
|
@ -2,7 +2,5 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
if [ "$1" = "post" ]; then
|
||||
if ! pidof physlock > /dev/null; then
|
||||
/usr/sbin/physlock -m
|
||||
fi
|
||||
/usr/local/bin/lock
|
||||
fi
|
||||
|
|
@ -7,5 +7,8 @@
|
|||
tags:
|
||||
- aur
|
||||
|
||||
- name: Push lock script
|
||||
copy: src=lock.sh dest=/usr/local/bin/lock mode=0755
|
||||
|
||||
- name: Push sleep lock script
|
||||
template: src=lock.sh.j2 dest=/usr/lib/systemd/system-sleep/lock.sh mode=755
|
||||
copy: src=sleeplock.sh dest=/usr/lib/systemd/system-sleep/lock.sh mode=0755
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue