Skip to content

Commit 7603bab

Browse files
committed
added scripts to dim and lock my screen
1 parent c42dd16 commit 7603bab

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

Makefile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
PREFIX ?= /usr/local
2+
3+
install:
4+
mkdir -p ${DESTDIR}${PREFIX}/bin
5+
cp -f screen-dim ${DESTDIR}${PREFIX}/bin
6+
cp -f screen-lock ${DESTDIR}${PREFIX}/bin
7+
8+
uninstall:
9+
rm -f ${DESTDIR}${PREFIX}/bin/screen-dim
10+
rm -f ${DESTDIR}${PREFIX}/bin/screen-lock
11+

screen-dim

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
get_brightness() {
4+
xrandr --verbose | awk '/Brightness/ { print $NF }'
5+
}
6+
7+
set_brightness() {
8+
xrandr --listactivemonitors| tail -n1 | awk '{ print $NF }' | xargs -i xrandr --output {} --brightness $1
9+
}
10+
11+
12+
trap 'exit 0' TERM INT
13+
trap "set_brightness $(get_brightness); kill %%" EXIT
14+
set_brightness 0.5
15+
sleep 2147483647 &
16+
wait

screen-lock

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
h=$(hostname)
4+
slock -m "login $USER@$h"
5+

0 commit comments

Comments
 (0)