From 222b23bb4c45b47c4bafbcacabd5a2eae18ca89e Mon Sep 17 00:00:00 2001 From: Stephan Raabe Date: Thu, 11 Jan 2024 16:03:36 +0100 Subject: [PATCH] Updates --- .bashrc | 2 +- .install/general-packages.sh | 1 + .install/restore.sh | 28 +++++++ .version/name | 2 +- .version/version.sh | 2 + CHANGELOG | 14 ++++ README.md | 79 ++++++++----------- hypr/conf/animations/animation-moving.conf | 18 +++++ hypr/conf/animations/animations-fast.conf | 4 + hypr/conf/ml4w.conf | 11 +++ hypr/conf/restorevariations.sh | 51 ++++++++++++ hypr/conf/windowrules/default.conf | 3 - hypr/hyprland.conf | 9 ++- hypr/scripts/loadconfig.sh | 5 -- hypr/scripts/lockscreentime.sh | 3 + hypr/scripts/settings.sh | 2 - hypr/settings/.library/library.sh | 2 +- .../modules/system/swaylock/config.sh | 2 + .../modules/system/swaylock/module.sh | 34 ++++++++ .../modules/waybar/appslabel/module.sh | 2 +- .../modules/waybar/bluetooth/module.sh | 4 +- .../settings/modules/waybar/chatgpt/module.sh | 4 +- .../modules/waybar/defaults/browser/module.sh | 2 +- .../waybar/defaults/filemanager/module.sh | 2 +- .../waybar/defaults/networkmanager/module.sh | 1 + .../waybar/defaults/software/module.sh | 2 +- .../modules/waybar/swaylock/config.sh | 2 + .../modules/waybar/swaylock/module.sh | 40 ++++++++++ scripts/cleanup.sh | 22 +++--- waybar/launch.sh | 8 +- waybar/modules.json | 9 ++- waybar/themes/ml4w-blur-bottom/config | 2 + waybar/themes/ml4w-blur/config | 2 + waybar/themes/ml4w-blur/style.css | 35 ++------ waybar/themes/ml4w-bottom/config | 2 + waybar/themes/ml4w/config | 2 + waybar/themes/ml4w/style.css | 16 ++-- 37 files changed, 303 insertions(+), 126 deletions(-) create mode 100755 .version/version.sh create mode 100644 hypr/conf/animations/animation-moving.conf create mode 100644 hypr/conf/ml4w.conf create mode 100755 hypr/conf/restorevariations.sh delete mode 100755 hypr/scripts/loadconfig.sh delete mode 100755 hypr/scripts/settings.sh create mode 100644 hypr/settings/modules/system/swaylock/config.sh create mode 100755 hypr/settings/modules/system/swaylock/module.sh create mode 100644 hypr/settings/modules/waybar/swaylock/config.sh create mode 100755 hypr/settings/modules/waybar/swaylock/module.sh diff --git a/.bashrc b/.bashrc index a4da514..0489ef5 100644 --- a/.bashrc +++ b/.bashrc @@ -35,13 +35,13 @@ alias od='~/private/onedrive.sh' alias rw='~/dotfiles/waybar/reload.sh' alias winclass="xprop | grep 'CLASS'" alias dot="cd ~/dotfiles" +alias cleanup='~/dotfiles/scripts/cleanup.sh' # ----------------------------------------------------- # Window Managers # ----------------------------------------------------- alias Qtile='startx' -# alias QtileWayland='qtile start -b wayland' # Hyprland with Hyprland # ----------------------------------------------------- diff --git a/.install/general-packages.sh b/.install/general-packages.sh index 9920da1..ec60154 100644 --- a/.install/general-packages.sh +++ b/.install/general-packages.sh @@ -46,6 +46,7 @@ packagesPacman=( "xdg-user-dirs" "networkmanager" "network-manager-applet" + "xclip" ); packagesYay=( diff --git a/.install/restore.sh b/.install/restore.sh index 652e515..705cd53 100755 --- a/.install/restore.sh +++ b/.install/restore.sh @@ -269,6 +269,23 @@ echo -e "${NONE}" echo "Waybar Network restored." fi + # Restore Waybar Idle + targetFile1="$HOME/dotfiles/waybar/themes/ml4w/config" + targetFile2="$HOME/dotfiles/waybar/themes/ml4w-blur/config" + targetFile3="$HOME/dotfiles/waybar/themes/ml4w-blur-bottom/config" + targetFile4="$HOME/dotfiles/waybar/themes/ml4w-bottom/config" + settingsFile="$HOME/dotfiles/.settings/waybar_swaylock" + if [ -f $settingsFile ] ;then + startMarker="START IDLE TOOGLE" + endMarker="END IDLE TOOGLE" + customtext="$(cat $settingsFile)" + _replaceInFile "$startMarker" "$endMarker" "$customtext" "$targetFile1" + _replaceInFile "$startMarker" "$endMarker" "$customtext" "$targetFile2" + _replaceInFile "$startMarker" "$endMarker" "$customtext" "$targetFile3" + _replaceInFile "$startMarker" "$endMarker" "$customtext" "$targetFile4" + echo "Waybar Idle restored." + fi + # Restore Waybar nmapplet targetFile="$HOME/dotfiles-versions/$version/hypr/conf/autostart.conf" settingsFile="$HOME/dotfiles/.settings/waybar_nmapplet" @@ -290,5 +307,16 @@ echo -e "${NONE}" echo "keyboard natural_scroll restored." fi + # Restore Start Swaylock + targetFile="$HOME/dotfiles/hypr/scripts/lockscreentime.sh" + settingsFile="$HOME/dotfiles/.settings/hypr_lockscreen" + if [ -f $settingsFile ] ;then + startMarker="START SWAYIDLE" + endMarker="END SWAYIDLE" + customtext="$(cat $settingsFile)" + _replaceInFile "$startMarker" "$endMarker" "$customtext" "$targetFile" + echo "Swaylock start restored." + fi + echo "" fi diff --git a/.version/name b/.version/name index 5588ae8..6b9cd07 100644 --- a/.version/name +++ b/.version/name @@ -1 +1 @@ -2.7.1 \ No newline at end of file +2.7.2RC1 \ No newline at end of file diff --git a/.version/version.sh b/.version/version.sh new file mode 100755 index 0000000..750b1f5 --- /dev/null +++ b/.version/version.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo $(cat ~/dotfiles/.version/name) $(cat ~/dotfiles/.version/version) diff --git a/CHANGELOG b/CHANGELOG index 04d8518..1bdbc94 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,17 @@ +Version 2.7.2 +https://gitlab.com/stephan-raabe/dotfiles/-/releases/2.7.2 +-------------------------------------------------------- +Hyprland: +- New waybar icon to enable/disable swaylock. Left mouse click to toggle swaylock, right mouse click to start swaylock +- Show/Hide idle_inhibitor module (swaylock) in Settings script +- Start of swayidle can be deactivated in the settings script +- New animation variation animation-moving.conf + +General: +- Installation script bug fixing +- Alias cleanup added to .bashrc for Arch Linux maintenance +- New Hyprland configuration variation script to roll back to default variations via tty + Version 2.7.1 https://gitlab.com/stephan-raabe/dotfiles/-/releases/2.7.1 -------------------------------------------------------- diff --git a/README.md b/README.md index c11d025..e555010 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ -# ML4W dotfiles 2.7.1 +# ML4W dotfiles 2.7.2 RC1 This is my configuration of Hyprland (Wayland) and Qtile (X11) for Arch Linux based distributions. This package includes an installation script to install and setup the required components. Click to watch on YouTube -PLEASE NOTE: This branch is the rolling release of my dotfiles and includes the latest changes. -Please be aware that this version is not a tested release. +PLEASE NOTE: This branch is the rolling release of the ML4W dotfiles and includes the latest changes. + +Latest official release You can find the installation video on YouTube: Install Arch Linux with Hyprland & Qtile @@ -45,14 +46,14 @@ The reference installation on the dotfiles is based on Arch Linux installed with Please watch the video on YouTube: https://youtu.be/kHG5czrQ7WA -## Installation with GIT (Rolling Release of main branch) +## Installation with GIT of Rolling Release ``` # 1.) Change into your Downloads folder cd ~/Downloads # 2.) Clone the dotfiles repository into the Downloads folder -git clone --depth=1 https://gitlab.com/stephan-raabe/dotfiles.git +git clone https://gitlab.com/stephan-raabe/dotfiles.git # 3.) Change into the dotfiles folder cd dotfiles @@ -61,11 +62,36 @@ cd dotfiles ./install.sh ``` -## Update with GIT (Rolling Release of main branch) + +## Installation with GIT of the latest release + +``` +# 1.) Change into your Downloads folder where you have downloaded the release to +cd ~/Downloads + +# 2.) Unzip +git clone --branch 2.7.1 https://gitlab.com/stephan-raabe/dotfiles.git + +# 3.) Change into the new dotfiles folder +cd dotfiles + +# 4.) Start the installation to update +./install.sh + +``` + +## Update with GIT + ``` # 1.) Change into your Downloads folder cd ~/Downloads/dotfiles +# Switch to rolling release +# git checkout origin/main + +# Switch to other version +# git checkout 2.7.1 + # 2.) Pull the latest version and update the repository git stash; git pull @@ -74,46 +100,7 @@ git stash; git pull ``` -## Update with GIT (Rolling Release of main branch) (fresh update) - -You can also update by deleting the ~/Downloads/dotfiles folder and clone again. - -``` -# 1.) Change into your Downloads folder -cd ~/Downloads - -# 2.) Delete existing dotfiles folder from Downloads folder -rm -rf ~/Downloads/dotfiles - -# 3.) Clone the dotfiles repository into the Downloads folder -git clone --depth=1 https://gitlab.com/stephan-raabe/dotfiles.git - -# 4.) Change into the dotfiles folder -cd dotfiles - -# 5.) Start the installation to update -./install.sh - -``` - -## Installation by downloading the latest release - -If you don't want to use the rolling release, you can download the latest release the latest release https://gitlab.com/stephan-raabe/dotfiles/-/releases or choose the the latest tag https://gitlab.com/stephan-raabe/dotfiles/-/tags and download the zip. - -``` -# 1.) Change into your Downloads folder where you have downloaded the release to -cd ~/Downloads - -# 2.) Unzip -unzip dotfiles-2.6.zip - -# 3.) Change into the new dotfiles folder -cd dotfiles-2.6 - -# 4.) Start the installation to update -./install.sh - -``` +## Dotfiles Installer You can also use the dotfiles installer script to download and install the latest release: https://gitlab.com/stephan-raabe/installer diff --git a/hypr/conf/animations/animation-moving.conf b/hypr/conf/animations/animation-moving.conf new file mode 100644 index 0000000..7c43e04 --- /dev/null +++ b/hypr/conf/animations/animation-moving.conf @@ -0,0 +1,18 @@ +# ----------------------------------------------------- +# Animations +# name "Moving" +# ----------------------------------------------------- +animations { + enabled = true + bezier = overshot, 0.05, 0.9, 0.1, 1.05 + bezier = smoothOut, 0.5, 0, 0.99, 0.99 + bezier = smoothIn, 0.5, -0.5, 0.68, 1.5 + animation = windows, 1, 5, overshot, slide + animation = windowsOut, 1, 3, smoothOut + animation = windowsIn, 1, 3, smoothOut + animation = windowsMove, 1, 4, smoothIn, slide + animation = border, 1, 5, default + animation = fade, 1, 5, smoothIn + animation = fadeDim, 1, 5, smoothIn + animation = workspaces, 1, 6, default +} diff --git a/hypr/conf/animations/animations-fast.conf b/hypr/conf/animations/animations-fast.conf index 68a02e7..a74f411 100644 --- a/hypr/conf/animations/animations-fast.conf +++ b/hypr/conf/animations/animations-fast.conf @@ -1,3 +1,7 @@ +# ----------------------------------------------------- +# Animations +# name "Fast" +# ----------------------------------------------------- animations { enabled = true bezier = linear, 0, 0, 1, 1 diff --git a/hypr/conf/ml4w.conf b/hypr/conf/ml4w.conf new file mode 100644 index 0000000..b186b7b --- /dev/null +++ b/hypr/conf/ml4w.conf @@ -0,0 +1,11 @@ +# ----------------------------------------------------- +# ML4W configurations +# ----------------------------------------------------- + +windowrulev2 = float,class:(ml4w-about) +windowrulev2 = size 60% 60%,class:(ml4w-about) +windowrulev2 = center,class:(ml4w-about) + +windowrulev2 = float,class:(dotfiles-floating) +windowrulev2 = size 60% 60%,class:(dotfiles-floating) +windowrulev2 = center,class:(dotfiles-floating) \ No newline at end of file diff --git a/hypr/conf/restorevariations.sh b/hypr/conf/restorevariations.sh new file mode 100755 index 0000000..be234f9 --- /dev/null +++ b/hypr/conf/restorevariations.sh @@ -0,0 +1,51 @@ +#!/bin/bash +clear +cat <<"EOF" + ____ _ +| _ \ ___ ___| |_ ___ _ __ ___ +| |_) / _ \/ __| __/ _ \| '__/ _ \ +| _ < __/\__ \ || (_) | | | __/ +|_| \_\___||___/\__\___/|_| \___| + +__ __ _ _ _ +\ \ / /_ _ _ __(_) __ _| |_(_) ___ _ __ ___ + \ \ / / _` | '__| |/ _` | __| |/ _ \| '_ \/ __| + \ V / (_| | | | | (_| | |_| | (_) | | | \__ \ + \_/ \__,_|_| |_|\__,_|\__|_|\___/|_| |_|___/ + + +EOF +echo "You can restore to the default Hyprland Variations." +echo "PLEASE NOTE: You can reactivate to a customized variation or selection in the settings script." +echo "Your customized variation will not be overwritten or deleted." + +if gum confirm "Do you want to restore all variations to the default values?" ;then + echo + + echo "source = ~/dotfiles/hypr/conf/keybindings/default.conf" > ~/dotfiles/hypr/conf/keybinding.conf + echo "Hyprland keybinding.conf restored!" + + echo "source = ~/dotfiles/hypr/conf/environments/default.conf" > ~/dotfiles/hypr/conf/environment.conf + echo "Hyprland environment.conf restored!" + + echo "source = ~/dotfiles/hypr/conf/windowrules/default.conf" > ~/dotfiles/hypr/conf/windowrule.conf + echo "Hyprland windowrule.conf restored!" + + echo "source = ~/dotfiles/hypr/conf/animations/default.conf" > ~/dotfiles/hypr/conf/animation.conf + echo "Hyprland animation.conf restored!" + + echo "source = ~/dotfiles/hypr/conf/decorations/default.conf" > ~/dotfiles/hypr/conf/decoration.conf + echo "Hyprland decoration.conf restored!" + + echo "source = ~/dotfiles/hypr/conf/windows/default.conf" > ~/dotfiles/hypr/conf/window.conf + echo "Hyprland window.conf restored!" + + echo "source = ~/dotfiles/hypr/conf/monitors/default.conf" > ~/dotfiles/hypr/conf/monitor.conf + echo "Hyprland monitor.conf restored!" + + echo + echo ":: Restore done!" +else + echo ":: Restore canceled!" + exit +fi \ No newline at end of file diff --git a/hypr/conf/windowrules/default.conf b/hypr/conf/windowrules/default.conf index 486a342..69dd42e 100644 --- a/hypr/conf/windowrules/default.conf +++ b/hypr/conf/windowrules/default.conf @@ -9,6 +9,3 @@ windowrule = float,^(pavucontrol)$ windowrule = float,^(blueman-manager)$ windowrule = float,^(nm-connection-editor)$ -windowrulev2 = float,class:(dotfiles-floating) -windowrulev2 = size 60% 60%,class:(dotfiles-floating) -windowrulev2 = center,class:(dotfiles-floating) diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index 0fbd1b6..12f123d 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -48,11 +48,16 @@ source = ~/dotfiles/hypr/conf/windowrule.conf source = ~/dotfiles/hypr/conf/animation.conf # ----------------------------------------------------- -# Animation +# Custom # ----------------------------------------------------- source = ~/dotfiles/hypr/conf/custom.conf +# ----------------------------------------------------- +# Custom +# ----------------------------------------------------- +source = ~/dotfiles/hypr/conf/ml4w.conf + # ----------------------------------------------------- # Environment for xdg-desktop-portal-hyprland # ----------------------------------------------------- -# exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP \ No newline at end of file +exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP \ No newline at end of file diff --git a/hypr/scripts/loadconfig.sh b/hypr/scripts/loadconfig.sh deleted file mode 100755 index 471602c..0000000 --- a/hypr/scripts/loadconfig.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -if [ -f ~/.hyprland.sh ]; then - sleep 1 - ~/.hyprland.sh -fi \ No newline at end of file diff --git a/hypr/scripts/lockscreentime.sh b/hypr/scripts/lockscreentime.sh index 4026efb..85bc3e6 100755 --- a/hypr/scripts/lockscreentime.sh +++ b/hypr/scripts/lockscreentime.sh @@ -9,6 +9,9 @@ # by Stephan Raabe (2023) # ----------------------------------------------------- +# START SWAYIDLE +# exit +# END SWAYIDLE source ~/dotfiles/.settings/swayidle.sh if [ -f "/usr/bin/swayidle" ]; then echo "swayidle is installed." diff --git a/hypr/scripts/settings.sh b/hypr/scripts/settings.sh deleted file mode 100755 index 40159f0..0000000 --- a/hypr/scripts/settings.sh +++ /dev/null @@ -1,2 +0,0 @@ -cd ~/hyprland-settings -./settings.sh dotfiles \ No newline at end of file diff --git a/hypr/settings/.library/library.sh b/hypr/settings/.library/library.sh index 1258aad..47abaf7 100644 --- a/hypr/settings/.library/library.sh +++ b/hypr/settings/.library/library.sh @@ -95,7 +95,7 @@ _getModules() { nameList+=("BACK") fi echo "" - selected=$(gum choose ${nameList[@]}) + selected=$(gum choose --height 12 ${nameList[@]}) case $selected in BACK) _goBack diff --git a/hypr/settings/modules/system/swaylock/config.sh b/hypr/settings/modules/system/swaylock/config.sh new file mode 100644 index 0000000..79a9967 --- /dev/null +++ b/hypr/settings/modules/system/swaylock/config.sh @@ -0,0 +1,2 @@ +name="Enable/Disable Swaylock" +order=1 diff --git a/hypr/settings/modules/system/swaylock/module.sh b/hypr/settings/modules/system/swaylock/module.sh new file mode 100755 index 0000000..9e6e401 --- /dev/null +++ b/hypr/settings/modules/system/swaylock/module.sh @@ -0,0 +1,34 @@ +#!/bin/bash +_getHeader "$name" "$author" + +echo "Enable/Disable the start of Swaylock. Restart of Hyprland is required after a change." + +# Define File +targetFile="$HOME/dotfiles/hypr/scripts/lockscreentime.sh" +settingsFile="$HOME/dotfiles/.settings/hypr_lockscreen" + +# Define Markers +startMarker="START SWAYIDLE" +endMarker="END SWAYIDLE" + +# Select Value +customvalue=$(gum choose "ENABLE" "DISABLE") + +if [ ! -z $customvalue ]; then + if [ "$customvalue" == "ENABLE" ] ;then + customtext="# exit" + else + customtext="exit" + fi + + _replaceInFile $startMarker $endMarker $customtext $targetFile + _writeSettings $settingsFile $customtext + + # Reload Waybar + setsid $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 & + _goBack +else + echo "ERROR: Define a value." + sleep 2 + _goBack +fi diff --git a/hypr/settings/modules/waybar/appslabel/module.sh b/hypr/settings/modules/waybar/appslabel/module.sh index 4383aff..f1c8bc6 100755 --- a/hypr/settings/modules/waybar/appslabel/module.sh +++ b/hypr/settings/modules/waybar/appslabel/module.sh @@ -1,7 +1,7 @@ #!/bin/bash _getHeader "$name" "$author" -echo "Define the label of the Apps Starter" +echo "Define the label of the Apps Starter (Default is Apps). " # Define File targetFile="$HOME/dotfiles/waybar/modules.json" diff --git a/hypr/settings/modules/waybar/bluetooth/module.sh b/hypr/settings/modules/waybar/bluetooth/module.sh index 6546661..4ef9de5 100755 --- a/hypr/settings/modules/waybar/bluetooth/module.sh +++ b/hypr/settings/modules/waybar/bluetooth/module.sh @@ -15,11 +15,13 @@ startMarker="START BT TOOGLE" endMarker="END BT TOOGLE" # Select Value -customvalue=$(gum choose "SHOW" "HIDE") +customvalue=$(gum choose "SHOW" "HIDE" "DEFAULT") if [ ! -z $customvalue ]; then if [ "$customvalue" == "SHOW" ] ;then customtext=" \"bluetooth\"," + elif [ "$customvalue" == "DEFAULT" ] ;then + customtext=" \"bluetooth\"," else customtext=" \/\/\"bluetooth\"," fi diff --git a/hypr/settings/modules/waybar/chatgpt/module.sh b/hypr/settings/modules/waybar/chatgpt/module.sh index a19f8cb..36b8bc6 100755 --- a/hypr/settings/modules/waybar/chatgpt/module.sh +++ b/hypr/settings/modules/waybar/chatgpt/module.sh @@ -12,11 +12,13 @@ startMarker="START CHATGPT TOOGLE" endMarker="END CHATGPT TOOGLE" # Select Value -customvalue=$(gum choose "SHOW" "HIDE") +customvalue=$(gum choose "SHOW" "HIDE" "DEFAULT") if [ ! -z $customvalue ]; then if [ "$customvalue" == "SHOW" ] ;then customtext=" \"custom\/chatgpt\"," + elif [ "$customvalue" == "DEFAULT" ] ;then + customtext=" \"custom\/chatgpt\"," else customtext=" \/\/\"custom\/chatgpt\"," fi diff --git a/hypr/settings/modules/waybar/defaults/browser/module.sh b/hypr/settings/modules/waybar/defaults/browser/module.sh index d47b5a1..d956de8 100755 --- a/hypr/settings/modules/waybar/defaults/browser/module.sh +++ b/hypr/settings/modules/waybar/defaults/browser/module.sh @@ -1,7 +1,7 @@ #!/bin/bash _getHeader "$name" "$author" -echo "Define the start command to start the browser." +echo "Define the start command to start the browser (Default: chromium)." # Define File targetFile="$HOME/dotfiles/.settings/browser.sh" diff --git a/hypr/settings/modules/waybar/defaults/filemanager/module.sh b/hypr/settings/modules/waybar/defaults/filemanager/module.sh index 2e02420..4eb1731 100755 --- a/hypr/settings/modules/waybar/defaults/filemanager/module.sh +++ b/hypr/settings/modules/waybar/defaults/filemanager/module.sh @@ -1,7 +1,7 @@ #!/bin/bash _getHeader "$name" "$author" -echo "Define the start command to start the filemanager." +echo "Define the start command to start the filemanager (Default: thunar)." # Define File targetFile="$HOME/dotfiles/.settings/filemanager.sh" diff --git a/hypr/settings/modules/waybar/defaults/networkmanager/module.sh b/hypr/settings/modules/waybar/defaults/networkmanager/module.sh index c38e5a4..42b3f12 100755 --- a/hypr/settings/modules/waybar/defaults/networkmanager/module.sh +++ b/hypr/settings/modules/waybar/defaults/networkmanager/module.sh @@ -2,6 +2,7 @@ _getHeader "$name" "$author" echo "Define the start command to start the networkmanager (Must be installed on your system)." +echo "(Default: nm-connection-editor)" echo "Possible values: alacritty -e nmtui, nm-connection-editor, etc." # Define File diff --git a/hypr/settings/modules/waybar/defaults/software/module.sh b/hypr/settings/modules/waybar/defaults/software/module.sh index fef12ac..fc82987 100755 --- a/hypr/settings/modules/waybar/defaults/software/module.sh +++ b/hypr/settings/modules/waybar/defaults/software/module.sh @@ -1,7 +1,7 @@ #!/bin/bash _getHeader "$name" "$author" -echo "Define the start command to start the software manager." +echo "Define the start command to start the software manager (Default: alacritty -e pacseek)." # Define File targetFile="$HOME/dotfiles/.settings/software.sh" diff --git a/hypr/settings/modules/waybar/swaylock/config.sh b/hypr/settings/modules/waybar/swaylock/config.sh new file mode 100644 index 0000000..fdf6365 --- /dev/null +++ b/hypr/settings/modules/waybar/swaylock/config.sh @@ -0,0 +1,2 @@ +name="Show/Hide Swaylock" +order=1 diff --git a/hypr/settings/modules/waybar/swaylock/module.sh b/hypr/settings/modules/waybar/swaylock/module.sh new file mode 100755 index 0000000..7662262 --- /dev/null +++ b/hypr/settings/modules/waybar/swaylock/module.sh @@ -0,0 +1,40 @@ +#!/bin/bash +_getHeader "$name" "$author" + +echo "Hide or show the swaylock (idle_inhibitor) module in ML4W waybar themes." + +# Define File +targetFile1="$HOME/dotfiles/waybar/themes/ml4w/config" +targetFile2="$HOME/dotfiles/waybar/themes/ml4w-blur/config" +targetFile3="$HOME/dotfiles/waybar/themes/ml4w-blur-bottom/config" +targetFile4="$HOME/dotfiles/waybar/themes/ml4w-bottom/config" +settingsFile="$HOME/dotfiles/.settings/waybar_swaylock" + +# Define Markers +startMarker="START IDLE TOOGLE" +endMarker="END IDLE TOOGLE" + +# Select Value +customvalue=$(gum choose "SHOW" "HIDE") + +if [ ! -z $customvalue ]; then + if [ "$customvalue" == "SHOW" ] ;then + customtext=" \"idle_inhibitor\"," + else + customtext=" \/\/\"idle_inhibitor\"," + fi + + _replaceInFile $startMarker $endMarker $customtext $targetFile1 + _replaceInFile $startMarker $endMarker $customtext $targetFile2 + _replaceInFile $startMarker $endMarker $customtext $targetFile3 + _replaceInFile $startMarker $endMarker $customtext $targetFile4 + _writeSettings $settingsFile $customtext + + # Reload Waybar + setsid $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 & + _goBack +else + echo "ERROR: Define a value." + sleep 2 + _goBack +fi diff --git a/scripts/cleanup.sh b/scripts/cleanup.sh index b22455f..446ea37 100755 --- a/scripts/cleanup.sh +++ b/scripts/cleanup.sh @@ -1,15 +1,13 @@ #!/bin/bash -# _ -# ___| | ___ __ _ _ __ _ _ _ __ -# / __| |/ _ \/ _` | '_ \ | | | | '_ \ -# | (__| | __/ (_| | | | | | |_| | |_) | -# \___|_|\___|\__,_|_| |_| \__,_| .__/ -# |_| -# -# by Stephan Raabe (2023) -# ----------------------------------------------------- +clear +cat <<"EOF" + ____ _ + / ___| | ___ __ _ _ __ _ _ _ __ +| | | |/ _ \/ _` | '_ \ | | | | '_ \ +| |___| | __/ (_| | | | | | |_| | |_) | + \____|_|\___|\__,_|_| |_| \__,_| .__/ + |_| -yay -Scc -su -c 'pacman -Qtdq | pacman -Rns -' -su -c 'pacman -Qqd | pacman -Rsu -' +EOF +sudo pacman -Rns $(pacman -Qtdq) diff --git a/waybar/launch.sh b/waybar/launch.sh index 385097b..423e1bc 100755 --- a/waybar/launch.sh +++ b/waybar/launch.sh @@ -12,7 +12,9 @@ # Quit all running waybar instances # ----------------------------------------------------- killall waybar +pkill waybar sleep 0.2 + # ----------------------------------------------------- # Default theme: /THEMEFOLDER;/VARIATION # ----------------------------------------------------- @@ -29,7 +31,7 @@ else fi IFS=';' read -ra arrThemes <<< "$themestyle" -echo ${arrThemes[0]} +echo "Theme: ${arrThemes[0]}" if [ ! -f ~/dotfiles/waybar/themes${arrThemes[1]}/style.css ]; then themestyle="/ml4w;/ml4w/light" @@ -49,8 +51,4 @@ if [ -f ~/dotfiles/waybar/themes${arrThemes[1]}/style-custom.css ] ;then style_file="style-custom.css" fi -# Check used files -echo "Config: $config_file" -echo "Style: $style_file" - waybar -c ~/dotfiles/waybar/themes${arrThemes[0]}/$config_file -s ~/dotfiles/waybar/themes${arrThemes[1]}/$style_file & diff --git a/waybar/modules.json b/waybar/modules.json index 2fe82dc..9092c35 100644 --- a/waybar/modules.json +++ b/waybar/modules.json @@ -353,10 +353,11 @@ "idle_inhibitor": { "format": "{icon}", - "tooltip": false, + "tooltip": true, "format-icons":{ - "activated": "Auto lock OFF", - "deactivated": "ON" - } + "activated": "", + "deactivated": "" + }, + "on-click-right": "swaylock" } } diff --git a/waybar/themes/ml4w-blur-bottom/config b/waybar/themes/ml4w-blur-bottom/config index f292359..3ae85e0 100644 --- a/waybar/themes/ml4w-blur-bottom/config +++ b/waybar/themes/ml4w-blur-bottom/config @@ -61,7 +61,9 @@ "group/hardware", "group/settings", "custom/cliphist", + // START IDLE TOOGLE "idle_inhibitor", + // END IDLE TOOGLE // START TRAY TOOGLE "tray", // END TRAY TOOGLE diff --git a/waybar/themes/ml4w-blur/config b/waybar/themes/ml4w-blur/config index 4cbfe5d..694ba89 100644 --- a/waybar/themes/ml4w-blur/config +++ b/waybar/themes/ml4w-blur/config @@ -60,7 +60,9 @@ // END NETWORK TOOGLE "group/hardware", "custom/cliphist", + // START IDLE TOOGLE "idle_inhibitor", + // END IDLE TOOGLE // START TRAY TOOGLE "tray", // END TRAY TOOGLE diff --git a/waybar/themes/ml4w-blur/style.css b/waybar/themes/ml4w-blur/style.css index 4046175..b058920 100644 --- a/waybar/themes/ml4w-blur/style.css +++ b/waybar/themes/ml4w-blur/style.css @@ -189,20 +189,18 @@ window#waybar.empty #window { #idle_inhibitor { margin-right: 15px; - font-size: 16px; + font-size: 22px; font-weight: bold; opacity: 0.8; color: @iconcolor; } #idle_inhibitor.activated { - background-color: #dc2f2f; - font-size: 16px; - color: #FFFFFF; - border-radius: 15px; - padding: 2px 10px 0px 10px; - margin: 8px 15px 8px 0px; - opacity:0.8; + margin-right: 15px; + font-size: 20px; + font-weight: bold; + opacity: 0.8; + color: #dc2f2f; } /* ----------------------------------------------------- @@ -418,24 +416,3 @@ window#waybar.empty #window { #tray > .needs-attention { -gtk-icon-effect: highlight; } - -/* ----------------------------------------------------- - * Other - * ----------------------------------------------------- */ -/* -label:focus { - background-color: #000000; -} - -#backlight { - background-color: #90b1b1; -} - -#network { - background-color: #2980b9; -} - -#network.disconnected { - background-color: #f53c3c; -} -*/ diff --git a/waybar/themes/ml4w-bottom/config b/waybar/themes/ml4w-bottom/config index 9b48987..9951224 100644 --- a/waybar/themes/ml4w-bottom/config +++ b/waybar/themes/ml4w-bottom/config @@ -60,7 +60,9 @@ // END NETWORK TOOGLE "group/hardware", "custom/cliphist", + // START IDLE TOOGLE "idle_inhibitor", + // END IDLE TOOGLE // START TRAY TOOGLE "tray", // END TRAY TOOGLE diff --git a/waybar/themes/ml4w/config b/waybar/themes/ml4w/config index 24a3df3..c7e5c4f 100644 --- a/waybar/themes/ml4w/config +++ b/waybar/themes/ml4w/config @@ -60,7 +60,9 @@ // END NETWORK TOOGLE "group/hardware", "custom/cliphist", + // START IDLE TOOGLE "idle_inhibitor", + // END IDLE TOOGLE // START TRAY TOOGLE "tray", // END TRAY TOOGLE diff --git a/waybar/themes/ml4w/style.css b/waybar/themes/ml4w/style.css index 7037bf4..58973a4 100644 --- a/waybar/themes/ml4w/style.css +++ b/waybar/themes/ml4w/style.css @@ -188,22 +188,20 @@ window#waybar.empty #window { * Idle Inhibator * ----------------------------------------------------- */ -#idle_inhibitor { + #idle_inhibitor { margin-right: 15px; - font-size: 16px; + font-size: 22px; font-weight: bold; opacity: 0.8; color: @iconcolor; } #idle_inhibitor.activated { - background-color: #dc2f2f; - font-size: 16px; - color:#ffffff; - border-radius: 15px; - padding: 2px 10px 0px 10px; - margin: 5px 15px 5px 0px; - opacity:0.8; + margin-right: 15px; + font-size: 20px; + font-weight: bold; + opacity: 0.8; + color: #dc2f2f; } /* -----------------------------------------------------