Autohide for waybar bluetooth module if no device detected
This commit is contained in:
parent
d7aabb2599
commit
fec8e9fb96
@ -51,6 +51,11 @@ if [ -d ~/dotfiles/hypr/settings/modules/system/swaylock ] ;then
|
|||||||
echo "~/dotfiles/hypr/settings/modules/system/swaylock removed."
|
echo "~/dotfiles/hypr/settings/modules/system/swaylock removed."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d ~/dotfiles/hypr/settings/modules/waybar/bluetooth ] ;then
|
||||||
|
rm -rf ~/dotfiles/hypr/settings/modules/waybar/bluetooth
|
||||||
|
echo "~/dotfiles/hypr/settings/modules/waybar/bluetooth removed."
|
||||||
|
fi
|
||||||
|
|
||||||
# Create default folder structure
|
# Create default folder structure
|
||||||
xdg-user-dirs-update
|
xdg-user-dirs-update
|
||||||
echo "Default folders created..."
|
echo "Default folders created..."
|
||||||
|
@ -221,25 +221,6 @@ echo -e "${NONE}"
|
|||||||
echo "Waybar ChatGPT restored."
|
echo "Waybar ChatGPT restored."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restore Waybar Bluetooth
|
|
||||||
targetFile1="$HOME/dotfiles-versions/$version/waybar/themes/ml4w/config"
|
|
||||||
targetFile2="$HOME/dotfiles-versions/$version/waybar/themes/ml4w-blur/config"
|
|
||||||
targetFile3="$HOME/dotfiles-versions/$version/waybar/themes/ml4w-blur-bottom/config"
|
|
||||||
targetFile4="$HOME/dotfiles-versions/$version/waybar/themes/ml4w-bottom/config"
|
|
||||||
targetFile5="$HOME/dotfiles-versions/$version/waybar/themes/ml4w-minimal/config"
|
|
||||||
settingsFile="$HOME/dotfiles/.settings/waybar_bluetooth"
|
|
||||||
if [ -f $settingsFile ] ;then
|
|
||||||
startMarker="START BT TOOGLE"
|
|
||||||
endMarker="END BT TOOGLE"
|
|
||||||
customtext="$(cat $settingsFile)"
|
|
||||||
_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"
|
|
||||||
echo "Waybar Bluetooth restored."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Restore Waybar Systray
|
# Restore Waybar Systray
|
||||||
targetFile1="$HOME/dotfiles-versions/$version/waybar/themes/ml4w/config"
|
targetFile1="$HOME/dotfiles-versions/$version/waybar/themes/ml4w/config"
|
||||||
targetFile2="$HOME/dotfiles-versions/$version/waybar/themes/ml4w-blur/config"
|
targetFile2="$HOME/dotfiles-versions/$version/waybar/themes/ml4w-blur/config"
|
||||||
|
@ -4,6 +4,8 @@ https://gitlab.com/stephan-raabe/dotfiles/-/releases/2.8.2
|
|||||||
General:
|
General:
|
||||||
- Force installation of sddm to fix theme issue with sddm-sugar-candy theme. sddm-git doesn't work
|
- Force installation of sddm to fix theme issue with sddm-sugar-candy theme. sddm-git doesn't work
|
||||||
- Wallpaper script creates a blurred version with imagemagick for wlogout background
|
- Wallpaper script creates a blurred version with imagemagick for wlogout background
|
||||||
|
- snapshot.sh script check now for required timeshift and (optional) grub-btrfs packages
|
||||||
|
- Waybar Bluetooth module now hides automatically if no bluetooth device is detected
|
||||||
|
|
||||||
Version 2.8.1
|
Version 2.8.1
|
||||||
https://gitlab.com/stephan-raabe/dotfiles/-/releases/2.8.1
|
https://gitlab.com/stephan-raabe/dotfiles/-/releases/2.8.1
|
||||||
|
@ -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
|
|
@ -351,7 +351,8 @@
|
|||||||
"format-disabled": "",
|
"format-disabled": "",
|
||||||
"format-off": "",
|
"format-off": "",
|
||||||
"interval": 30,
|
"interval": 30,
|
||||||
"on-click": "blueman-manager"
|
"on-click": "blueman-manager",
|
||||||
|
"format-no-controller": ""
|
||||||
},
|
},
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
|
@ -306,7 +306,8 @@
|
|||||||
"format-disabled": "",
|
"format-disabled": "",
|
||||||
"format-off": "",
|
"format-off": "",
|
||||||
"interval": 30,
|
"interval": 30,
|
||||||
"on-click": "blueman-manager"
|
"on-click": "blueman-manager",
|
||||||
|
"format-no-controller": ""
|
||||||
},
|
},
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
|
Loading…
Reference in New Issue
Block a user