slstatus, new texlive
authorMart Lubbers <mart@martlubbers.net>
Tue, 16 Jun 2020 19:14:24 +0000 (21:14 +0200)
committerMart Lubbers <mart@martlubbers.net>
Tue, 16 Jun 2020 19:14:24 +0000 (21:14 +0200)
config.h/slstatus/config.h [new file with mode: 0644]
email/.local/bin/newmail.sh
shell/.bashrc
x/.xinitrc

diff --git a/config.h/slstatus/config.h b/config.h/slstatus/config.h
new file mode 100644 (file)
index 0000000..5850292
--- /dev/null
@@ -0,0 +1,77 @@
+/* See LICENSE file for copyright and license details. */
+
+/* interval between updates (in ms) */
+const unsigned int interval = 30*1000;
+
+/* text to show if no value can be retrieved */
+static const char unknown_str[] = "n/a";
+
+/* maximum output string length */
+#define MAXLEN 2048
+
+/*
+ * function            description                     argument (example)
+ *
+ * battery_perc        battery percentage              battery name (BAT0)
+ *                                                     NULL on OpenBSD/FreeBSD
+ * battery_state       battery charging state          battery name (BAT0)
+ *                                                     NULL on OpenBSD/FreeBSD
+ * battery_remaining   battery remaining HH:MM         battery name (BAT0)
+ *                                                     NULL on OpenBSD/FreeBSD
+ * cpu_perc            cpu usage in percent            NULL
+ * cpu_freq            cpu frequency in MHz            NULL
+ * datetime            date and time                   format string (%F %T)
+ * disk_free           free disk space in GB           mountpoint path (/)
+ * disk_perc           disk usage in percent           mountpoint path (/)
+ * disk_total          total disk space in GB          mountpoint path (/")
+ * disk_used           used disk space in GB           mountpoint path (/)
+ * entropy             available entropy               NULL
+ * gid                 GID of current user             NULL
+ * hostname            hostname                        NULL
+ * ipv4                IPv4 address                    interface name (eth0)
+ * ipv6                IPv6 address                    interface name (eth0)
+ * kernel_release      `uname -r`                      NULL
+ * keyboard_indicators caps/num lock indicators        format string (c?n?)
+ *                                                     see keyboard_indicators.c
+ * keymap              layout (variant) of current     NULL
+ *                     keymap
+ * load_avg            load average                    NULL
+ * netspeed_rx         receive network speed           interface name (wlan0)
+ * netspeed_tx         transfer network speed          interface name (wlan0)
+ * num_files           number of files in a directory  path
+ *                                                     (/home/foo/Inbox/cur)
+ * ram_free            free memory in GB               NULL
+ * ram_perc            memory usage in percent         NULL
+ * ram_total           total memory size in GB         NULL
+ * ram_used            used memory in GB               NULL
+ * run_command         custom shell command            command (echo foo)
+ * swap_free           free swap in GB                 NULL
+ * swap_perc           swap usage in percent           NULL
+ * swap_total          total swap size in GB           NULL
+ * swap_used           used swap in GB                 NULL
+ * temp                temperature in degree celsius   sensor file
+ *                                                     (/sys/class/thermal/...)
+ *                                                     NULL on OpenBSD
+ *                                                     thermal zone on FreeBSD
+ *                                                     (tz0, tz1, etc.)
+ * uid                 UID of current user             NULL
+ * uptime              system uptime                   NULL
+ * username            username of current user        NULL
+ * vol_perc            OSS/ALSA volume in percent      mixer file (/dev/mixer)
+ * wifi_perc           WiFi signal in percent          interface name (wlan0)
+ * wifi_essid          WiFi ESSID                      interface name (wlan0)
+ */
+static const struct arg args[] = {
+       /* function format          argument */
+       { num_files,     "✉ %s | ",
+               "/home/mrl/.local/share/offlineimap/mail/INBOX/new" },
+       { keymap,        "%s | ",   NULL },
+       { ipv4,          "E %s | ", "enp0s31f6" },
+       { wifi_essid,    "W %s ",   "wlp1s0" },
+       { ipv4,          "(%s) | ", "wlp1s0" },
+       { battery_perc,  "⚡%s%%",  "BAT0"},
+       { battery_state, "(%s) | ", "BAT0"},
+       { disk_free,     "%s/",     "/" },
+       { disk_total,    "%s | ",   "/" },
+       { datetime,      "%s",      "%Y-%m-%d %H:%M" },
+};
index a1828a0..29e0638 100755 (executable)
@@ -1,11 +1,3 @@
 #!/bin/sh
-newmail="$(find ~/.local/share/offlineimap/mail/INBOX/new/ -type f | wc -l)"
-if [ "$newmail" -eq 1 ]
-then
-       notify-send "1 new email!"
-elif [ "$newmail" -ne 0 ]
-then
-       notify-send "$newmail new emails!"
-fi
 notmuch new
 vdirsyncer sync
index 29b3d3f..4457267 100644 (file)
@@ -24,9 +24,9 @@ export CLEAN_HOME=/opt/clean
 
 export PATH=~/.local/bin:$PATH
 export PATH=$PATH:$CLEAN_HOME/lib/exe:$CLEAN_HOME/bin
-export PATH=$PATH:/opt/texlive/2020/bin/x86_64-linux:/opt/zotero:/opt/arduino:/opt/beets/bin:/opt/firefox
+export PATH=$PATH:/opt/texlive/2019/bin/x86_64-linux:/opt/zotero:/opt/arduino:/opt/beets/bin:/opt/firefox
 
-export MANPATH=~/.local/share/man:/opt/texlive/2020/texmf-dist/doc/man:./arduino/java/man:$MANPATH
+export MANPATH=~/.local/share/man:/opt/texlive/2019/texmf-dist/doc/man:./arduino/java/man:$MANPATH
 
 export GTK_IM_MODULE=xim
 export QT_IM_MODULE=xim
index 2822f41..f910dad 100755 (executable)
@@ -24,8 +24,7 @@ if [ -d /etc/X11/xinit/xinitrc.d ]; then
 fi
 
 # status bar
-while true; do xsetroot -name "$(bar)"; sleep 1m; done &
+slstatus &
 
-#xrandr --setmonitor Presentation 3840/1040x1080/640+0+0 eDP1,HDMI1
-#xrandr --output eDP1 --mode 1920x1080 --output HDMI1 --mode 1920x1080 --right-of=eDP1
+# window manager
 while true; do dwm 1>/tmp/dwm.log 2>&1; done