Updates
This commit is contained in:
parent
c262871375
commit
37162cbab6
@ -22,7 +22,6 @@ if [ ! -z $customvalue ]; then
|
||||
|
||||
# Ensure that markers are in target file
|
||||
if grep -s "$startMarker" $targetFile && grep -s "$endMarker" $targetFile; then
|
||||
echo "Exists"
|
||||
|
||||
# Write into File
|
||||
sed -i '/'"$startMarker"'/,/'"$endMarker"'/ {
|
||||
|
2
hypr/settings/modules/waybar/bluetooth/config.sh
Normal file
2
hypr/settings/modules/waybar/bluetooth/config.sh
Normal file
@ -0,0 +1,2 @@
|
||||
name="Bluetooth"
|
||||
order=1
|
58
hypr/settings/modules/waybar/bluetooth/module.sh
Executable file
58
hypr/settings/modules/waybar/bluetooth/module.sh
Executable file
@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
_getHeader "$name" "$author"
|
||||
|
||||
echo "Hide the bluetooth icon in waybar."
|
||||
|
||||
# Define File
|
||||
targetFile="$HOME/dotfiles/waybar/themes/ml4w/config"
|
||||
|
||||
if [ ! -f $targetFile ] ;then
|
||||
echo "ERROR: Target file not found."
|
||||
sleep 2
|
||||
_goBack
|
||||
fi
|
||||
|
||||
# Define Markers
|
||||
startMarker="\/\/ START BT TOOGLE"
|
||||
endMarker="\/\/ END BT TOOGLE"
|
||||
|
||||
# Define Replacement Template
|
||||
customtemplate="VALUE\"bluetooth\","
|
||||
|
||||
# Select Value
|
||||
customvalue=$(gum choose "SHOW" "HIDE")
|
||||
|
||||
if [ ! -z $customvalue ]; then
|
||||
|
||||
if [ "$customvalue" == "SHOW" ] ;then
|
||||
customvalue=""
|
||||
else
|
||||
customvalue="//"
|
||||
fi
|
||||
# Replace in Template
|
||||
customtext="${customtemplate/VALUE/"$customvalue"}"
|
||||
|
||||
# Ensure that markers are in target file
|
||||
if grep -s "$startMarker" $targetFile && grep -s "$endMarker" $targetFile; then
|
||||
|
||||
# Write into File
|
||||
sed -i '/'"$startMarker"'/,/'"$endMarker"'/ {
|
||||
//!d
|
||||
/'"$startMarker"'/a\
|
||||
'"$customtext"'
|
||||
}' $targetFile
|
||||
|
||||
# Reload Waybar
|
||||
$HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1
|
||||
_goBack
|
||||
|
||||
else
|
||||
echo "ERROR: Marker not found."
|
||||
sleep 2
|
||||
_goBack
|
||||
fi
|
||||
else
|
||||
echo "ERROR: Define a value."
|
||||
sleep 2
|
||||
_goBack
|
||||
fi
|
@ -21,7 +21,6 @@ if [ ! -z $customvalue ]; then
|
||||
|
||||
# Ensure that markers are in target file
|
||||
if grep -s "$startMarker" $targetFile && grep -s "$endMarker" $targetFile; then
|
||||
echo "Exists"
|
||||
|
||||
# Write into File
|
||||
sed -i '/'"$startMarker"'/,/'"$endMarker"'/ {
|
||||
|
@ -19,7 +19,6 @@ customtext="${customtemplate/VALUE/"$customvalue"}"
|
||||
|
||||
# Ensure that markers are in target file
|
||||
if grep -s "$startMarker" $targetFile && grep -s "$endMarker" $targetFile; then
|
||||
echo "Exists"
|
||||
|
||||
# Write into File
|
||||
sed -i '/'"$startMarker"'/,/'"$endMarker"'/ {
|
||||
|
@ -48,4 +48,9 @@ fi
|
||||
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 &
|
||||
|
@ -49,7 +49,9 @@
|
||||
"modules-right": [
|
||||
"custom/updates",
|
||||
"pulseaudio",
|
||||
// START BT TOOGLE
|
||||
"bluetooth",
|
||||
// END BT TOOGLE
|
||||
"battery",
|
||||
"network",
|
||||
"group/hardware",
|
||||
|
Loading…
Reference in New Issue
Block a user