浏览代码

Merge pull request #8 from FrancescoXD/main

added pacman_updates and fixed termcmd
siduck76 3 年之前
父节点
当前提交
b0d8097ff2
共有 2 个文件被更改,包括 13 次插入2 次删除
  1. 12 1
      .dwm/bar
  2. 1 1
      chadwm/config.def.h

+ 12 - 1
.dwm/bar

@@ -24,6 +24,17 @@ xbps_updates() {
   fi
 }
 
+# only for arch user! it requires pacman-contrib package
+pacman_updates() {
+  updates=$(checkupdates | wc -l)
+
+  if [ -z "$updates" ]; then
+    printf "^c#94af7d^ Fully Updated"
+  else
+    printf "^c#94af7d^ $updates"
+  fi
+}
+
 # battery
 batt() {
   printf "^c#81A1C1^  "
@@ -61,7 +72,7 @@ clock() {
 while true; do
 
   # remove these 2 lines if u dont use void! or adjust the xbps-updates to get n.o of updates (according your distro ofc)
-  [ $interval == 0 ] || [ $(($interval % 3600)) == 0 ] && updates=$(xbps-updates)
+  [ $interval == 0 ] || [ $(($interval % 3600)) == 0 ] && updates=$(xbps-updates) # use updates=$(pacman_updates) for arch
   interval=$((interval + 1))
 
   sleep 1 && xsetroot -name "$(update_icon) $updates $(batt) $(brightness) $(cpu) $(mem) $(wlan) $(clock)"

+ 1 - 1
chadwm/config.def.h

@@ -143,7 +143,7 @@ static Key keys[] = {
 
     // if you dont use st my rm this and uncomment line below it!
     { MODKEY,                       XK_Return, spawn,   SHCMD("~/.local/bin/./st_settings && st")}, 
- // { MODKEY,                       XK_Return, spawn,    {.v = term }}, 
+ // { MODKEY,                       XK_Return, spawn,    {.v = termcmd }}, 
 
     {MODKEY | ControlMask, XK_u, spawn, SHCMD("maim | xclip -selection clipboard -t image/png")},
     {MODKEY, XK_u, spawn,   SHCMD("maim --select | xclip -selection clipboard -t image/png")},