Autohide for waybar bluetooth module if no device detected
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
name="Show/Hide Bluetooth"
|
||||
order=1
|
||||
@@ -1,44 +0,0 @@
|
||||
#!/bin/bash
|
||||
_getHeader "$name" "$author"
|
||||
|
||||
echo "Hide or show the bluetooth 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"
|
||||
targetFile5="$HOME/dotfiles/waybar/themes/ml4w-minimal/config"
|
||||
settingsFile="$HOME/dotfiles/.settings/waybar_bluetooth"
|
||||
|
||||
# Define Markers
|
||||
startMarker="START BT TOOGLE"
|
||||
endMarker="END BT TOOGLE"
|
||||
|
||||
# Select Value
|
||||
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
|
||||
|
||||
_replaceInFile $startMarker $endMarker $customtext $targetFile1
|
||||
_replaceInFile $startMarker $endMarker $customtext $targetFile2
|
||||
_replaceInFile $startMarker $endMarker $customtext $targetFile3
|
||||
_replaceInFile $startMarker $endMarker $customtext $targetFile4
|
||||
_replaceInFile $startMarker $endMarker $customtext $targetFile5
|
||||
_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
|
||||
Reference in New Issue
Block a user