From a701919885fcc7ee5d209d48ead39281eb6d8c3a Mon Sep 17 00:00:00 2001 From: faulty Date: Mon, 20 Feb 2023 17:12:29 +0100 Subject: [PATCH] feat(dwm): startup apps --- files/dwm/config.h | 13 ++++++------ files/dwm/dwm-start.sh | 46 +++++++++++++++++++++++------------------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/files/dwm/config.h b/files/dwm/config.h index 9d8701c..b92e5a0 100644 --- a/files/dwm/config.h +++ b/files/dwm/config.h @@ -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) */ diff --git a/files/dwm/dwm-start.sh b/files/dwm/dwm-start.sh index 8bf86b8..3941ea8 100755 --- a/files/dwm/dwm-start.sh +++ b/files/dwm/dwm-start.sh @@ -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