-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautostart.sh
executable file
·47 lines (37 loc) · 1.63 KB
/
autostart.sh
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
37
38
39
40
41
42
43
44
45
46
#!/bin/sh
#location of this file was ~/.dwm/autostart.sh
# scripts
# if [[ $(ps -x | grep "bash /home/afshan/bin/pywal_do_magic.sh" | wc -l) -eq 1 ]]; then
# (bash /home/afshan/bin/pywal_do_magic.sh &>/home/afshan/bin/output.txt) &
# else
# echo "Already running pywall script" &> output.txt
# fi
# /usr/bin/setxkbmap -device 13 -option "ctrl:swapcaps"
# /usr/bin/setxkbmap -device 18 -option "ctrl:swapcaps"
logitechKeyboardId=$(xinput -list | grep -E "(Logitech Wireless Keyboard).*(slave[ ]+keyboard)" | awk '{print $6}' | awk -F '=' '{print $2}')
# echo "logitech keyboard id = $logitechKeyboardId"
acerKeyboardId=$(xinput -list | awk '/AT Translated Set 2 keyboard/ {print $7}' | cut -d '=' -f 2)
# echo "acer keyboard id = $acerKeyboardId"
/usr/bin/setxkbmap -device $acerKeyboardId -option "ctrl:swapcaps"
/usr/bin/setxkbmap -device $logitechKeyboardId -option "ctrl:swapcaps"
while [[ 1 ]]; do
bat=🔋
if [[ $(acpi -b | cut -d":" -f2 | cut -d"," -f1) == " Charging" ]]; then
bat=⚡
fi
conn=🔗
conn_ip=$(ifconfig | grep -A 1 "wlp3s0" | tail -1 | grep "inet" | cut -d" " -f10)
if [[ -z $conn_ip ]] ; then
conn_ip=$(ifconfig | grep -A 1 "bnep0" | tail -1 | grep "inet" | cut -d" " -f10)
fi
if [[ -z $conn_ip ]] ; then
conn=🚫
conn_ip="Not connected"
fi
mem="$(free --mega | grep "Mem" | awk '{print $3}') Mb"
# echo $conn $conn_ip;
xsetroot -name " $bat $( acpi -b | cut -d":" -f2 | cut -d"," -f2) | 🔰 $(date +'%A') | 📆 $(date +'%d %b %y') | ⏰ $(date +'%I:%M %p') | $conn $conn_ip | 💾 used: $mem "
# xsetroot -name "afshan"
/home/afshan/my_scripts/notify_batter_status.sh
sleep 10
done