feat(dwm): startup apps

This commit is contained in:
Didier Slof 2023-02-20 17:12:29 +01:00
parent 46c84486a3
commit a701919885
Signed by: didier
GPG key ID: 01E71F18AA4398E5
2 changed files with 32 additions and 27 deletions

View file

@ -31,12 +31,13 @@ static const char *colors[][3] = {
static const char *tags[] = { "main", "term", "www", "chat", "5", "6", "7", "8", "9", }; static const char *tags[] = { "main", "term", "www", "chat", "5", "6", "7", "8", "9", };
static const Rule rules[] = { static const Rule rules[] = {
/* class instance title tags mask isfloating monitor */ /* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, True, -1 }, { "Gimp", NULL, NULL, 0, True, -1 },
{ "Firefox", NULL, NULL, 0, False, -1 }, { "firefox", NULL, NULL, 1 << 2, False, -1 },
{ "Thunderbird", NULL, NULL, 2, False, -1 }, { "discord", NULL, NULL, 1 << 3, False, -1 },
{ "stalonetray", NULL, NULL, 1, False, -1 }, { "Thunderbird", NULL, NULL, 2, False, -1 },
{ "chrome", NULL, NULL, 4, False, -1 }, { "stalonetray", NULL, NULL, 1, False, -1 },
{ "chrome", NULL, NULL, 4, False, -1 },
}; };
/* layout(s) */ /* layout(s) */

View file

@ -5,22 +5,23 @@ xsetroot -solid black
#while loop to update statusbar with some goodies #while loop to update statusbar with some goodies
while true; do while true; do
#memfreak to get it in MB #memfreak to get it in MB
memfreak2=$(grep MemUsed /proc/meminfo | awk '{ print $2 }') memfree=$(grep MemFree /proc/meminfo | awk '{ print $2 }')
memfreak=$(($memfreak2 / 1024)) memtotal=$(grep MemTotal /proc/meminfo | awk '{ print $2 }')
#time memfreak=$(((memtotal - memfree) / 1024))
CLK=$(date +'%a %b %d %R:%S %Z') #time
#volume CLK=$(date +'%a %b %d %R:%S %Z')
VOL=$(amixer get Master | tail -1 | awk '{ print $5 }' | tr -d '[]') #volume
#loadavg VOL=$(amixer get Master | tail -1 | awk '{ print $5 }' | tr -d '[]')
AVG=$(cat /proc/loadavg | cut -d ' ' -f -3) #loadavg
#network stats in Bytes AVG=$(cat /proc/loadavg | cut -d ' ' -f -3)
NW=$(dstat -n --nocolor 1 1 | tail -1 | awk '{ print $1, $2}') #network stats in Bytes
battper=$(cat /sys/class/power_supply/BAT0/capacity) NW=$(dstat -n --nocolor 1 1 | tail -1 | awk '{ print $1, $2}')
#this one is not so good, increases a delay of 1-2s of the updating. battper=$(cat /sys/class/power_supply/BAT0/capacity)
#put it in the xsetrootname plz (tip of the day, do not put | as first char after " #this one is not so good, increases a delay of 1-2s of the updating.
xsetroot -name "$AVG | $memfreak MB | Bat: $battper% | Vol: $VOL | $CLK | " #put it in the xsetrootname plz (tip of the day, do not put | as first char after "
sleep 1 xsetroot -name "$AVG | $memfreak MB | Bat: $battper% | Vol: $VOL | $CLK | "
sleep 1
done & done &
@ -29,8 +30,11 @@ mate-volume-control-status-icon &
flameshot & flameshot &
feh -z -Z --bg-scale $HOME/Pictures/background.* feh -z -Z --bg-scale $HOME/Pictures/background.*
touch /tmp/restart-dwm start_apps() {
while [ -f /tmp/restart-dwm ]; do discord &
rm -rf /tmp/restart-dwm firefox &
exec dwm >/dev/null }
done
(sleep 1 && start_apps) &
exec dwm >/dev/null