feat(dwm): startup apps

This commit is contained in:
Strix 2023-10-14 22:38:08 +02:00
parent 2e38a18413
commit 7ae783532b
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774
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 Rule rules[] = {
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, True, -1 },
{ "Firefox", NULL, NULL, 0, False, -1 },
{ "Thunderbird", NULL, NULL, 2, False, -1 },
{ "stalonetray", NULL, NULL, 1, False, -1 },
{ "chrome", NULL, NULL, 4, False, -1 },
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, True, -1 },
{ "firefox", NULL, NULL, 1 << 2, False, -1 },
{ "discord", NULL, NULL, 1 << 3, False, -1 },
{ "Thunderbird", NULL, NULL, 2, False, -1 },
{ "stalonetray", NULL, NULL, 1, False, -1 },
{ "chrome", NULL, NULL, 4, False, -1 },
};
/* layout(s) */

View file

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