From 46f08ec666ddef1438e803bb218e5067d1e3262d Mon Sep 17 00:00:00 2001 From: Stephan Raabe Date: Wed, 13 Sep 2023 11:20:50 +0200 Subject: [PATCH] Minor bugfix --- hypr/hyprland.conf | 1 + scripts/updates.sh | 17 +++++++++++++---- waybar/config | 11 ++++++++++- waybar/launch.sh | 2 +- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index 76c528e..f58c52c 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -46,6 +46,7 @@ env = XCURSOR_SIZE,24 # ----------------------------------------------------- input { kb_layout = de + # kb_layout = en kb_variant = kb_model = kb_options = diff --git a/scripts/updates.sh b/scripts/updates.sh index b21c5d0..f71cde5 100755 --- a/scripts/updates.sh +++ b/scripts/updates.sh @@ -32,22 +32,31 @@ fi updates=$(("$updates_arch" + "$updates_aur")) +# ----------------------------------------------------- +# Testing +# ----------------------------------------------------- + +# Overwrite updates with numbers for testing +# updates=100 + +# test JSON output +# printf '{"text": "0", "alt": "0", "tooltip": "0 Updates", "class": "red"}' +# exit + # ----------------------------------------------------- # Output in JSON format for Waybar Module custom-updates # ----------------------------------------------------- css_class="green" -# test classes -# printf '{"text": "0", "alt": "0", "tooltip": "0 Updates", "class": "red"}' -# exit - if [ "$updates" -gt $threshhold_yellow ]; then css_class="yellow" fi + if [ "$updates" -gt $threshhold_red ]; then css_class="red" fi + if [ "$updates" -gt $threshhold_green ]; then printf '{"text": "%s", "alt": "%s", "tooltip": "%s Updates", "class": "%s"}' "$updates" "$updates" "$updates" "$css_class" else diff --git a/waybar/config b/waybar/config index 4866d90..61b193b 100644 --- a/waybar/config +++ b/waybar/config @@ -10,10 +10,19 @@ // { // General Settings + + // Position TOP "layer": "top", - "height": 16, "margin-top": 14, "margin-bottom": 0, + + // Position BOTTOM + // "position": "bottom", + // "margin-top": 0, + // "margin-bottom": 14, + + "layer": "top", + "height": 16, "margin-left": 0, "margin-right": 0, "spacing": 0, diff --git a/waybar/launch.sh b/waybar/launch.sh index 7eb606b..efeacd6 100755 --- a/waybar/launch.sh +++ b/waybar/launch.sh @@ -16,7 +16,7 @@ killall waybar # ----------------------------------------------------- # Loading the configuration based on the username # ----------------------------------------------------- -if [[ $USER = "raabe" ]] +if [[ $USER = "raabe2" ]] then waybar -c ~/dotfiles/waybar/myconfig & -s ~/dotfiles/waybar/style.css else