diff --git a/home/.config/eww/bar/bar.yuck b/home/.config/eww/bar/bar.yuck index 9fc2dbf..f627213 100644 --- a/home/.config/eww/bar/bar.yuck +++ b/home/.config/eww/bar/bar.yuck @@ -4,6 +4,7 @@ (include "./bar/kbd-layout.yuck") (include "./bar/media.yuck") (include "./bar/power.yuck") +(include "./bar/updates.yuck") (include "./bar/weather.yuck") (include "./bar/workspaces.yuck") @@ -26,7 +27,11 @@ (box :class "bar" :orientation "h" (workspaces :monitor-workspaces monitor-workspaces) (active-window) - (bar-tray) + + (box :orientation "h" :halign "end" :space-evenly false :spacing 8 + (pacman-updates-widget) + (bar-tray) + ) ) ) diff --git a/home/.config/eww/bar/updates.yuck b/home/.config/eww/bar/updates.yuck new file mode 100644 index 0000000..09e06d1 --- /dev/null +++ b/home/.config/eww/bar/updates.yuck @@ -0,0 +1,13 @@ +(defpoll pacman-updates :initial 0 :interval "3s" "checkupdates | wc -l") + +(defwidget pacman-updates-widget [] + (box :class "pacman-update-widget" + (eventbox + :class "pacman-update-widget-inner ${pacman-updates > 0 ? 'has-updates' : ''}" + :cursor "pointer" + :onclick "${pacman-updates > 0 ? 'alacritty -e sudo pacman -Syu &' : ''}" + + (label :class "update-text" :text " ${pacman-updates}") + ) + ) +) diff --git a/home/.config/eww/styles/tray.scss b/home/.config/eww/styles/tray.scss index 4aff1cd..4de9755 100644 --- a/home/.config/eww/styles/tray.scss +++ b/home/.config/eww/styles/tray.scss @@ -1,5 +1,29 @@ $tray-item-interactive-margin: 6px 0; +.pacman-update-widget { + margin: $tray-item-interactive-margin; + + .pacman-update-widget-inner { + border-radius: 4px; + + + &.has-updates { + background-color: rgb(228, 137, 137); + color: #fff; + font-weight: bold; + transition: background-color 0.4s ease; + + &:hover { + background-color: rgb(187, 100, 100); + } + + .update-text { + padding: 0 8px; + } + } + } +} + .kbd-layout-tray-item { margin: $tray-item-interactive-margin; diff --git a/home/.config/hypr/autorun.conf b/home/.config/hypr/autorun.conf index 334e00f..688c941 100644 --- a/home/.config/hypr/autorun.conf +++ b/home/.config/hypr/autorun.conf @@ -10,4 +10,4 @@ exec-once = swww-daemon --format xrgb & exec-once = swaync & -exec-once = blueman-applet & +exec-once = blueman-applet & nm-applet & diff --git a/home/.config/hypr/scripts/run-apps.sh b/home/.config/hypr/scripts/run-apps.sh index efd48de..1ccb85f 100755 --- a/home/.config/hypr/scripts/run-apps.sh +++ b/home/.config/hypr/scripts/run-apps.sh @@ -5,4 +5,6 @@ hyprctl dispatch -- exec '[workspace 3 silent]' telegram-desktop & sleep 1 hyprctl dispatch -- exec '[workspace 3 silent]' todoist & sleep 1 -hyprctl dispatch -- exec '[workspace 3 silent]' alacritty -e btop & +hyprctl dispatch -- exec '[workspace 3 silent]' alacritty -e ~/Scripts/start-tmux & + +tmux send -t default 'btop' ENTER;