diff options
| author | Ja.KooLit <85185940+JaKooLit@users.noreply.github.com> | 2025-03-21 10:00:34 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-21 10:00:34 +0900 |
| commit | af7c7389f9bdb6f8da83bd51e261ed00106eea1f (patch) | |
| tree | a327f82a34d13768cb7cf5d0a3d9893cc61c3ea3 /config/hypr/scripts/WaybarScripts.sh | |
| parent | f113f871fe35acb5143e16648bcbcb2c7f675fef (diff) | |
| parent | 2d927892e5354abb14b9738d895b7084452886e2 (diff) | |
Merge branch 'development' into main-to-dev
Diffstat (limited to 'config/hypr/scripts/WaybarScripts.sh')
| -rwxr-xr-x | config/hypr/scripts/WaybarScripts.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/config/hypr/scripts/WaybarScripts.sh b/config/hypr/scripts/WaybarScripts.sh new file mode 100755 index 00000000..32b43f02 --- /dev/null +++ b/config/hypr/scripts/WaybarScripts.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# This file used on waybar modules sourcing defaults set in $HOME/.config/hypr/UserConfigs/01-UserDefaults.conf + +# Define the path to the config file +config_file=$HOME/.config/hypr/UserConfigs/01-UserDefaults.conf + +# Check if the config file exists +if [[ ! -f "$config_file" ]]; then + echo "Error: Configuration file not found!" + exit 1 +fi + +# Process the config file in memory, removing the $ and fixing spaces +config_content=$(sed 's/\$//g' "$config_file" | sed 's/ = /=/') + +# Source the modified content directly from the variable +eval "$config_content" + +# Check if $term is set correctly +if [[ -z "$term" ]]; then + echo "Error: \$term is not set in the configuration file!" + exit 1 +fi + +# Execute accordingly based on the passed argument +if [[ "$1" == "--btop" ]]; then + $term --title btop sh -c 'btop' +elif [[ "$1" == "--nvtop" ]]; then + $term --title nvtop sh -c 'nvtop' +elif [[ "$1" == "--nmtui" ]]; then + $term nmtui +elif [[ "$1" == "--term" ]]; then + $term & +else + echo "Usage: $0 [--btop | --nvtop | --nmtui | --term]" + echo "--btop : Open btop in a new term" + echo "--nvtop : Open nvtop in a new term" + echo "--nmtui : Open nmtui in a new term" + echo "--term : Launch a term window" +fi |
