forked from shapeshed/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xinitrc
36 lines (27 loc) · 881 Bytes
/
xinitrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
# vim: filetype=sh
xset +fp /usr/share/fonts/local
xset fp rehash
xbindkeys
xsetroot -solid "#333333"
xautolock -locker slock -time 2 -killer "systemctl suspend" -killtime 10 &
PACMANICON=$(echo -e '\u2691')
AURICON=$(echo -e '\u2690')
BATTICON=$(echo -e '\u26A1')
BATTSTATUS=''
while true; do
if which acpi &> /dev/null; then
BATT=$( acpi -b | sed 's/.*[charging|unknown], \([0-9]*\)%.*/\1/gi' )
STATUS=$( acpi -b | sed 's/.*: \([a-zA-Z]*\),.*/\1/gi' )
if [ $STATUS == 'Discharging' ]; then
BATTSTATUS="$BATTICON $BATT"
fi
fi
PACMAN_UPDATES=$(pacman -Qu | wc -l)
AUR_UPDATES=$(cower -u | wc -l)
xsetroot -name "$PACMANICON $PACMAN_UPDATES $AURICON $AUR_UPDATES $BATTSTATUS $(date +"%F %R")"
sleep 1m
done &
eval $(gpg-agent --daemon --enable-ssh-support --write-env-file ${HOME}/.gpg-agent-info)
setxkbmap -layout uk
exec dwm