From 6e0bacd4f6390b7c9d5f3c81def905d3c7d05891 Mon Sep 17 00:00:00 2001 From: Stephan Raabe Date: Thu, 30 May 2024 14:05:19 +0200 Subject: [PATCH] Updates --- .version/name | 2 +- CHANGELOG.md | 2 + README.md | 2 +- hypr/scripts/hypridle.sh | 21 ++++++++-- scripts/updates.sh | 4 +- waybar/modules.json | 55 +++++++++++++-------------- waybar/themes/ml4w-blur-bottom/config | 4 +- waybar/themes/ml4w-blur/config | 2 +- waybar/themes/ml4w-blur/style.css | 14 ++++++- waybar/themes/ml4w-bottom/config | 3 +- waybar/themes/ml4w-minimal/config | 2 +- waybar/themes/ml4w-minimal/style.css | 14 ++++++- waybar/themes/ml4w/config | 2 +- waybar/themes/ml4w/style.css | 14 ++++++- waybar/themes/starter/config | 2 +- waybar/themes/starter/modules.json | 18 +++++++-- waybar/themes/starter/style.css | 14 ++++++- 17 files changed, 126 insertions(+), 49 deletions(-) diff --git a/.version/name b/.version/name index d582958..0590bf7 100644 --- a/.version/name +++ b/.version/name @@ -1 +1 @@ -2.9.1RC2 \ No newline at end of file +2.9.1RC3 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 864fd55..c49c477 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ For auto-activation at a dedicated time please set the filter to off and follow - Image conversions with imagemagick can be enabled for wallpapers. Right click on wallpaper module in waybar. You can add more effects in ~/dotfiles/hypr/effects/wallpaper - ChatGPT Window opens on the left screen side in floating mode - New default wallpaper +- Added hypridle inhibitor waybar module to toggle screen locking with hyprlock +- Tooltips added to all waybar modules Version 2.9 https://gitlab.com/stephan-raabe/dotfiles/-/releases/2.9 diff --git a/README.md b/README.md index 4d39e2c..79d552b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ML4W Dotfiles 2.9.1 RC2 +# ML4W Dotfiles 2.9.1 RC3 An advanced configuration of Hyprland and Qtile for Arch Linux based distributions. This package includes an installation script to install and setup the required components. diff --git a/hypr/scripts/hypridle.sh b/hypr/scripts/hypridle.sh index 852ab33..d3314b6 100755 --- a/hypr/scripts/hypridle.sh +++ b/hypr/scripts/hypridle.sh @@ -1,10 +1,25 @@ #!/bin/bash +# _ _ _ _ _ +# | | | |_ _ _ __ _ __(_) __| | | ___ +# | |_| | | | | '_ \| '__| |/ _` | |/ _ \ +# | _ | |_| | |_) | | | | (_| | | __/ +# |_| |_|\__, | .__/|_| |_|\__,_|_|\___| +# |___/|_| +# + SERVICE="hypridle" if [[ "$1" == "status" ]]; then + sleep 1 if pgrep -x "$SERVICE" >/dev/null ;then - echo ":: $SERVICE is running" + echo '{"text": "RUNNING", "class": "active", "tooltip": "Screen locking active"}' else - echo ":: $SERVICE is not running" + echo '{"text": "NOT RUNNING", "class": "notactive", "tooltip": "Screen locking deactivated"}' + fi +fi +if [[ "$1" == "toggle" ]]; then + if pgrep -x "$SERVICE" >/dev/null ;then + killall hypridle + else + hypridle & fi fi - diff --git a/scripts/updates.sh b/scripts/updates.sh index 88ee02c..a214f3f 100755 --- a/scripts/updates.sh +++ b/scripts/updates.sh @@ -58,7 +58,7 @@ if [ "$updates" -gt $threshhold_red ]; then fi if [ "$updates" -gt $threshhold_green ]; then - printf '{"text": "%s", "alt": "%s", "tooltip": "%s Updates", "class": "%s"}' "$updates" "$updates" "$updates" "$css_class" + printf '{"text": "%s", "alt": "%s", "tooltip": "Click to update your system", "class": "%s"}' "$updates" "$updates" "$updates" "$css_class" else - printf '{"text": "0", "alt": "0", "tooltip": "0 Updates", "class": "green"}' + printf '{"text": "0", "alt": "0", "tooltip": "No updates available", "class": "green"}' fi diff --git a/waybar/modules.json b/waybar/modules.json index 0b971e3..1055970 100644 --- a/waybar/modules.json +++ b/waybar/modules.json @@ -61,14 +61,14 @@ "on-click": "sleep 0.1 && ~/dotfiles/eww/ml4w-sidebar/launch.sh", "on-click-right": "sleep 0.1 && ~/dotfiles/apps/ML4W_Welcome-x86_64.AppImage", "format": " ", - "tooltip": false + "tooltip-format": "Open Sidebar" }, // ML4W Welcome App "custom/ml4w-hyprland-settings": { "on-click": "~/dotfiles/apps/ML4W_Hyprland_Settings-x86_64.AppImage", "format": " ", - "tooltip": false + "tooltip-format": "ML4W Hyprland Settings" }, // Empty @@ -91,20 +91,18 @@ "on-click": "sleep 0.1 && ~/dotfiles/scripts/cliphist.sh", "on-click-right": "sleep 0.1 && ~/dotfiles/scripts/cliphist.sh d", "on-click-middle": "sleep 0.1 && ~/dotfiles/scripts/cliphist.sh w", - "tooltip": false + "tooltip-format": "Clipboard Manager" }, // Updates Count "custom/updates": { "format": " {}", - "tooltip-format": "{}", "escape": true, "return-type": "json", "exec": "~/dotfiles/scripts/updates.sh", "restart-interval": 60, "on-click": "alacritty --class dotfiles-floating -e ~/dotfiles/scripts/installupdates.sh", - "on-click-right": "~/dotfiles/.settings/software.sh", - "tooltip": false + "on-click-right": "~/dotfiles/.settings/software.sh" }, // Wallpaper @@ -112,21 +110,21 @@ "format": "", "on-click": "~/dotfiles/hypr/scripts/wallpaper.sh select", "on-click-right": "~/dotfiles/hypr/scripts/wallpaper-effects.sh", - "tooltip": false + "tooltip-format": "Left: Select a wallpaper\nRight: Select wallpaper effect" }, // Waybar Themes "custom/waybarthemes": { "format": "", "on-click": "~/dotfiles/waybar/themeswitcher.sh", - "tooltip": false + "tooltip-format": "Select a waybar theme" }, // Settings "custom/settings": { "format": "", "on-click": "~/dotfiles/apps/ML4W_Dotfiles_Settings-x86_64.AppImage", - "tooltip": false + "tooltip-format": "ML4W Dotfiles Settings" }, // Keybindings @@ -140,21 +138,21 @@ "custom/filemanager": { "format": "", "on-click": "~/dotfiles/.settings/filemanager.sh", - "tooltip": false + "tooltip-format": "Open the filemanager" }, // Browser Launcher "custom/browser": { "format": "", "on-click": "~/dotfiles/.settings/browser.sh", - "tooltip": false + "tooltip-format": "Open the browser" }, // ChatGPT Launcher "custom/chatgpt": { "format": " ", "on-click": "chromium --app=https://chat.openai.com", - "tooltip": false + "tooltip-format": "Open ChatGPT" }, // Calculator @@ -178,7 +176,7 @@ // END APPS LABEL "on-click": "sleep 0.2;rofi -show drun -replace", "on-click-right": "~/dotfiles/hypr/scripts/keybindings.sh", - "tooltip": false + "tooltip-format": "Left: Open the application launcher\nRight: Show all keybindings" }, // Rofi Application Launcher @@ -186,22 +184,34 @@ "format": "", "on-click": "rofi -show drun -replace", "on-click-right": "~/dotfiles/hypr/scripts/keybindings.sh", - "tooltip": false + "tooltip-format": "Left: Open the application launcher\nRight: Show all keybindings" }, // Power Menu "custom/exit": { "format": "", "on-click": "wlogout", - "tooltip": false + "tooltip-format": "Power Menu" }, // Hyprshade "custom/hyprshade": { "format": "", + "tooltip-format": "Toggle Screen Shader", "on-click": "sleep 0.5; ~/dotfiles/hypr/scripts/hyprshade.sh", - "on-click-right": "sleep 0.5; ~/dotfiles/hypr/scripts/hyprshade.sh rofi", - "tooltip": false + "on-click-right": "sleep 0.5; ~/dotfiles/hypr/scripts/hyprshade.sh rofi" + }, + + // Hypridle inhibitor + "custom/hypridle": { + "format": "", + "return-type": "json", + "escape": true, + "exec-on-event": true, + "interval": 60, + "exec": "~/dotfiles/hypr/scripts/hypridle.sh status", + "on-click": "~/dotfiles/hypr/scripts/hypridle.sh toggle", + "on-click-right": "hyprlock" }, // Keyboard State @@ -378,16 +388,5 @@ "format": "{user}", "interval": 60, "icon": false, - }, - - // Idle Inhibator - "idle_inhibitor": { - "format": "{icon}", - "tooltip": true, - "format-icons":{ - "activated": "", - "deactivated": "" - }, - "on-click-right": "hyprlock" } } diff --git a/waybar/themes/ml4w-blur-bottom/config b/waybar/themes/ml4w-blur-bottom/config index 00f8fd9..4b9fdf2 100644 --- a/waybar/themes/ml4w-blur-bottom/config +++ b/waybar/themes/ml4w-blur-bottom/config @@ -45,9 +45,9 @@ "battery", "network", "group/hardware", - "group/settings", "custom/cliphist", - "idle_inhibitor", + "custom/hypridle", + "custom/hyprshade", "tray", "custom/exit", "custom/ml4w-welcome", diff --git a/waybar/themes/ml4w-blur/config b/waybar/themes/ml4w-blur/config index 2d1c73f..8009d43 100644 --- a/waybar/themes/ml4w-blur/config +++ b/waybar/themes/ml4w-blur/config @@ -46,7 +46,7 @@ "network", "group/hardware", "custom/cliphist", - "idle_inhibitor", + "custom/hypridle", "custom/hyprshade", "tray", "custom/exit", diff --git a/waybar/themes/ml4w-blur/style.css b/waybar/themes/ml4w-blur/style.css index 26f9688..65787f5 100644 --- a/waybar/themes/ml4w-blur/style.css +++ b/waybar/themes/ml4w-blur/style.css @@ -164,6 +164,7 @@ window#waybar.empty #window { #custom-wallpaper, #custom-system, #custom-hyprshade, +#custom-hypridle, #custom-waybarthemes { margin-right: 23px; font-size: 20px; @@ -173,10 +174,21 @@ window#waybar.empty #window { } #custom-hyprshade { - margin-left:4px; margin-right:12px; } +#custom-hypridle { + margin-right:18px; +} + +#custom-hypridle.active { + color: @iconcolor; +} + +#custom-hypridle.notactive { + color: #dc2f2f; +} + #custom-system { margin-right:15px; } diff --git a/waybar/themes/ml4w-bottom/config b/waybar/themes/ml4w-bottom/config index b6471b9..935fe98 100644 --- a/waybar/themes/ml4w-bottom/config +++ b/waybar/themes/ml4w-bottom/config @@ -46,7 +46,8 @@ "network", "group/hardware", "custom/cliphist", - "idle_inhibitor", + "custom/hypridle", + "custom/hyprshade", "tray", "custom/exit", "custom/ml4w-welcome", diff --git a/waybar/themes/ml4w-minimal/config b/waybar/themes/ml4w-minimal/config index 6c36883..bb8ef1d 100644 --- a/waybar/themes/ml4w-minimal/config +++ b/waybar/themes/ml4w-minimal/config @@ -44,7 +44,7 @@ "network", "group/hardware", "custom/cliphist", - "idle_inhibitor", + "custom/hypridle", "custom/hyprshade", "custom/exit", "clock", diff --git a/waybar/themes/ml4w-minimal/style.css b/waybar/themes/ml4w-minimal/style.css index 229be2e..55da7c5 100644 --- a/waybar/themes/ml4w-minimal/style.css +++ b/waybar/themes/ml4w-minimal/style.css @@ -135,6 +135,7 @@ window#waybar.empty #window { #custom-wallpaper, #custom-system, #custom-hyprshade, +#custom-hypridle, #custom-waybarthemes { margin-right: 23px; font-size: 14px; @@ -143,10 +144,21 @@ window#waybar.empty #window { } #custom-hyprshade { - margin-left:4px; margin-right:12px; } +#custom-hypridle { + margin-right:16px; +} + +#custom-hypridle.active { + color: @iconcolor; +} + +#custom-hypridle.notactive { + color: #dc2f2f; +} + #custom-settings { margin-right: 15px; } diff --git a/waybar/themes/ml4w/config b/waybar/themes/ml4w/config index 3a53b5d..ded798e 100644 --- a/waybar/themes/ml4w/config +++ b/waybar/themes/ml4w/config @@ -46,7 +46,7 @@ "network", "group/hardware", "custom/cliphist", - "idle_inhibitor", + "custom/hypridle", "custom/hyprshade", "tray", "custom/exit", diff --git a/waybar/themes/ml4w/style.css b/waybar/themes/ml4w/style.css index 22c1044..64a4620 100644 --- a/waybar/themes/ml4w/style.css +++ b/waybar/themes/ml4w/style.css @@ -165,6 +165,7 @@ window#waybar.empty #window { #custom-wallpaper, #custom-system, #custom-hyprshade, +#custom-hypridle, #custom-waybarthemes { margin-right: 23px; font-size: 20px; @@ -174,10 +175,21 @@ window#waybar.empty #window { } #custom-hyprshade { - margin-left:4px; margin-right:12px; } +#custom-hypridle { + margin-right:18px; +} + +#custom-hypridle.active { + color: @iconcolor; +} + +#custom-hypridle.notactive { + color: #dc2f2f; +} + #custom-system { margin-right:15px; } diff --git a/waybar/themes/starter/config b/waybar/themes/starter/config index b971c91..6674efd 100644 --- a/waybar/themes/starter/config +++ b/waybar/themes/starter/config @@ -54,7 +54,7 @@ "network", "group/hardware", "custom/cliphist", - "idle_inhibitor", + "custom/hypridle", "custom/hyprshade", "tray", "custom/exit", diff --git a/waybar/themes/starter/modules.json b/waybar/themes/starter/modules.json index ab88008..984b923 100644 --- a/waybar/themes/starter/modules.json +++ b/waybar/themes/starter/modules.json @@ -73,9 +73,21 @@ "tooltip": false }, + // Hypridle inhibitor + "custom/hypridle": { + "format": "", + "return-type": "json", + "escape": true, + "exec-on-event": true, + "interval": 60, + "exec": "~/dotfiles/hypr/scripts/hypridle.sh status", + "on-click": "~/dotfiles/hypr/scripts/hypridle.sh toggle", + "on-click-right": "hyprlock" + }, + // Updates Count "custom/updates": { - "format": " {}", + "format": " {}", "tooltip-format": "{}", "escape": true, "return-type": "json", @@ -95,7 +107,7 @@ "custom/wallpaper": { "format": "", "on-click": "~/dotfiles/hypr/scripts/wallpaper.sh select", - "on-click-right": "~/dotfiles/hypr/scripts/wallpaper.sh", + "on-click-right": "~/dotfiles/hypr/scripts/wallpaper-effects.sh", "tooltip": false }, @@ -291,7 +303,7 @@ // Pulseaudio "pulseaudio": { // "scroll-step": 1, // %, can be a float - "format": "{icon} {volume}%", + "format": "{icon} {volume}%", "format-bluetooth": "{volume}% {icon} {format_source}", "format-bluetooth-muted": " {icon} {format_source}", "format-muted": " {format_source}", diff --git a/waybar/themes/starter/style.css b/waybar/themes/starter/style.css index 941d77e..00aef52 100644 --- a/waybar/themes/starter/style.css +++ b/waybar/themes/starter/style.css @@ -165,6 +165,7 @@ window#waybar.empty #window { #custom-wallpaper, #custom-system, #custom-hyprshade, +#custom-hypridle, #custom-waybarthemes { margin-right: 23px; font-size: 20px; @@ -173,10 +174,21 @@ window#waybar.empty #window { } #custom-hyprshade { - margin-left:4px; margin-right:12px; } +#custom-hypridle { + margin-right:16px; +} + +#custom-hypridle.active { + color: @iconcolor; +} + +#custom-hypridle.notactive { + color: #dc2f2f; +} + #custom-waybarthemes,#custom-system { margin-right:15px; }