blob: afb5571273b28fb2df5c2f274c7f70b8da9ae3d3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#!/usr/bin/env bash
# ==================================================
# KoolDots (2026)
# Project URL: https://github.com/LinuxBeginnings
# License: GNU GPLv3
# SPDX-License-Identifier: GPL-3.0-or-later
# ==================================================
# 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
launch_files() {
if [[ -z "$files" ]]; then
notify-send -u low -i "$HOME/.config/swaync/images/error.png" "Waybar: files" "Set \$files in 01-UserDefaults.conf or install a default file manager."
return 1
fi
eval "$files &"
}
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 &
elif [[ "$1" == "--files" ]]; then
launch_files
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"
echo "--files : Launch a file manager"
fi
|