From 8eba2ef76489f155a0cdfd32e5406e6c24c8ae87 Mon Sep 17 00:00:00 2001 From: q3aql Date: Sun, 24 Apr 2022 17:53:11 +0200 Subject: [PATCH] Dotfiles config update (2022-04-24) --- .config/qtile/checkUpdates.sh | 22 ++++++++++++++++++++++ .config/qtile/settings/widgets.py | 5 ++--- 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100755 .config/qtile/checkUpdates.sh diff --git a/.config/qtile/checkUpdates.sh b/.config/qtile/checkUpdates.sh new file mode 100755 index 0000000..eb792f0 --- /dev/null +++ b/.config/qtile/checkUpdates.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Check updates on Arch Linux +# Note: Create cron on /etc/cron.d/checkupdates with the following lines: +# 0 * * * * root /usr/bin/pacman -Sy +# 30 * * * * root /usr/bin/pacman -Sy +if [ -f /usr/bin/pacman ] ; then + num_packages=$(pacman -Qu | wc -l) + echo "${num_packages}" + +# Check updates on Ubuntu/Debian/Devuan +# Note: Create cron on /etc/cron.d/checkupdates with the following lines: +# 0 * * * * root /usr/bin/aptitude update +# 30 * * * * root /usr/bin/aptitude update +elif [ -f /usr/bin/aptitude ] ; then + num_packages=$(aptitude search "~U" | wc -l) + echo "${num_packages}" + +# Disable for other distros +else + echo "0" +fi diff --git a/.config/qtile/settings/widgets.py b/.config/qtile/settings/widgets.py index 5f5d887..13063c0 100644 --- a/.config/qtile/settings/widgets.py +++ b/.config/qtile/settings/widgets.py @@ -9,11 +9,9 @@ def base(fg='text', bg='dark'): 'background': colors[bg] } - def separator(): return widget.Sep(**base(), linewidth=0, padding=5) - def icon(fg='text', bg='dark', fontsize=16, text="?"): return widget.TextBox( **base(fg, bg), @@ -78,7 +76,8 @@ primary_widgets = [ no_update_string='0', display_format='{updates}', update_interval=1800, - custom_command='checkupdates', + #custom_command='checkupdates', + custom_command='bash ~/.config/qtile/checkUpdates.sh', ), powerline('color3', 'color5'),