diff --git a/.bashrc b/.bashrc index 02807a5..8fd0949 100644 --- a/.bashrc +++ b/.bashrc @@ -30,7 +30,7 @@ alias screenshot='scrot' # GIT alias gs="git status" alias ga="git add" -alias gc="git commit" +alias gc="git commit -m" alias gp="git push" # SCRIPTS diff --git a/qtile/__pycache__/config.cpython-310.pyc b/qtile/__pycache__/config.cpython-310.pyc index 484917b..bb33c6f 100644 Binary files a/qtile/__pycache__/config.cpython-310.pyc and b/qtile/__pycache__/config.cpython-310.pyc differ diff --git a/qtile/config.py b/qtile/config.py index f49ef91..ffc9852 100644 --- a/qtile/config.py +++ b/qtile/config.py @@ -62,6 +62,13 @@ if (os.path.isfile("/usr/bin/VBoxService")): else: terminal = "alacritty" +# -------------------------------------------------------- +# Check for Desktop/Laptop +# -------------------------------------------------------- + +# Use output from /sys/class/dmi/id/chassis_type +# 3 = Desktop + # -------------------------------------------------------- # Set default apps # -------------------------------------------------------- @@ -255,15 +262,6 @@ screens = [ text='|', foreground=ColorC, ), - # widget.CPU(), - # widget.DF( - # visible_on_warn=False, - # mouse_callbacks={"Button1": lambda: qtile.cmd_spawn(terminal + ' -e htop')}, - # ), - # widget.TextBox( - # text='|', - # foreground=ColorC, - # ), widget.Volume( fmt='Vol: {}', ), @@ -272,7 +270,17 @@ screens = [ foreground=ColorC, ), widget.Battery(), - # widget.Backlight(), + widget.TextBox( + text='|', + foreground=ColorC, + ), + widget.GenPollText( + name = "checkupdates", + fmt="Updates: {}", + update_interval = 3600, + func = lambda: subprocess.check_output("/home/raabe/dotfiles/scripts/checkupdates.sh").decode()[:-1], + mouse_callbacks={"Button1": lambda: qtile.cmd_spawn(terminal + ' -e yay')}, + ), widget.TextBox( text='|', foreground=ColorC, diff --git a/scripts/checkupdates.sh b/scripts/checkupdates.sh new file mode 100755 index 0000000..8113e1d --- /dev/null +++ b/scripts/checkupdates.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +format() { + if [ "$1" -eq 0 ]; then + echo '-' + else + echo "$1" + fi +} + +if ! updates_arch="$(checkupdates | wc -l)"; then + updates_arch=0 +fi + +if ! updates_aur="$(yay -Qum 2>/dev/null | wc -l)"; then + updates_aur=0 +fi + +echo "($(format $updates_arch)/$(format $updates_aur))"