This commit is contained in:
Stephan Raabe 2024-01-01 11:40:15 +01:00
parent 27ff21fc2b
commit 984c69ea59
24 changed files with 157 additions and 39 deletions

View File

@ -4,6 +4,7 @@
echo -e "${GREEN}"
figlet "Cleanup"
echo -e "${NONE}"
# Check for ttf-ms-fonts
if [[ $(_isInstalledPacman "ttf-ms-fonts") == 0 ]]; then
echo "The script has detected ttf-ms-fonts. This can cause conflicts with icons in Waybar."
@ -11,4 +12,14 @@ if [[ $(_isInstalledPacman "ttf-ms-fonts") == 0 ]]; then
sudo pacman --noconfirm -R ttf-ms-fonts
fi
fi
# Check for running NetworkManager.service
# if [[ $(systemctl list-units --all -t service --full --no-legend "NetworkManager.service" | sed 's/^\s*//g' | cut -f1 -d' ') == "NetworkManager.service" ]];then
# echo "NetworkManager.service already running."
# else
# sudo systemctl enable NetworkManager.service
# sudo systemctl start NetworkManager.service
# echo "NetworkManager.service activated successfully."
# fi
echo "Cleanup done."

View File

@ -38,6 +38,7 @@ packagesPacman=(
"gum"
"man-pages"
"xdg-desktop-portal"
"nm-connection-editor"
);
packagesYay=(

View File

@ -9,5 +9,7 @@ echo -e "${NONE}"
if gum confirm "Do you want to run the script now?"; then
source ~/dotfiles-versions/hook.sh
echo "hook.sh executed!"
else
echo "Execution of hook.sh skipped."
fi
fi

View File

@ -175,14 +175,7 @@ _startRestore() {
if [ -d ~/dotfiles ]; then
echo -e "${GREEN}"
cat <<"EOF"
____ _
| _ \ ___ ___| |_ ___ _ __ ___
| |_) / _ \/ __| __/ _ \| '__/ _ \
| _ < __/\__ \ || (_) | | | __/
|_| \_\___||___/\__\___/|_| \___|
EOF
figlet "Restore"
echo -e "${NONE}"
restored=0
echo "The script will try to restore existing configurations."
@ -248,5 +241,33 @@ echo -e "${NONE}"
echo "Waybar Systray restored."
fi
# Restore Waybar Network
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"
settingsFile="$HOME/dotfiles/.settings/waybar_network"
if [ -f $settingsFile ] ;then
startMarker="START NETWORK TOOGLE"
endMarker="END NETWORK TOOGLE"
customtext="$(cat $settingsFile)"
_replaceInFile "$startMarker" "$endMarker" "$customtext" "$targetFile1"
_replaceInFile "$startMarker" "$endMarker" "$customtext" "$targetFile2"
_replaceInFile "$startMarker" "$endMarker" "$customtext" "$targetFile3"
_replaceInFile "$startMarker" "$endMarker" "$customtext" "$targetFile4"
echo "Waybar Network restored."
fi
# Restore Waybar nmapplet
targetFile="$HOME/dotfiles-versions/$version/hypr/conf/autostart.conf"
settingsFile="$HOME/dotfiles/.settings/waybar_nmapplet"
if [ -f $settingsFile ] ;then
startMarker="START NM APPLET"
endMarker="END NM APPLET"
customtext="$(cat $settingsFile)"
_replaceInFile "$startMarker" "$endMarker" "$customtext" "$targetFile"
echo "nm-applet restored."
fi
echo ""
fi

View File

@ -1 +1 @@
version="2.7"
version="2.7.1BETA1"

View File

@ -1 +1 @@
273
274

View File

@ -1 +1 @@
alacritty -e nmtui
nm-connection-editor

View File

@ -1,3 +1,10 @@
Version 2.7.1
https://gitlab.com/stephan-raabe/dotfiles/-/releases/2.7.1
--------------------------------------------------------
Hyprland:
- Add optional network-manager applet support. Can be activated in Settings script System/nm-applet
- Settings: Show/Hide network module
Version 2.7
https://gitlab.com/stephan-raabe/dotfiles/-/releases/2.7
--------------------------------------------------------

View File

@ -1,4 +1,4 @@
# ML4W dotfiles 2.7
# ML4W dotfiles 2.7.1BETA1
This is my configuration of Hyprland (Wayland) and Qtile (X11) for Arch Linux based distributions. This package includes an installation script to install and setup the required components.

View File

@ -20,6 +20,11 @@ exec-once = ~/dotfiles/gtk/gtk.sh
# Load swayidle and define the lock screen time
exec-once = ~/dotfiles/hypr/scripts/lockscreentime.sh
# Load network manager applet
# START NM APPLET
# exec-once = nm-applet --indicator
# END NM APPLET
# Load cliphist history
exec-once = wl-paste --watch cliphist store

View File

@ -7,6 +7,7 @@ windowrule = tile,^(Brave-browser)$
windowrule = tile,^(Chromium)$
windowrule = float,^(pavucontrol)$
windowrule = float,^(blueman-manager)$
windowrule = float,^(nm-connection-editor)$
windowrulev2 = float,class:(dotfiles-floating)
windowrulev2 = size 60% 60%,class:(dotfiles-floating)

View File

@ -0,0 +1,2 @@
name="nw-applet "
order=1

View File

@ -0,0 +1,35 @@
#!/bin/bash
_getHeader "$name" "$author"
echo "Enable or disable the network manager applet (nw-applet) in the Systray."
echo "(nw-applet must be installed on your system)"
echo "IMPORTANT: Please reboot your system after a change."
echo
# Define File
targetFile1="$HOME/dotfiles/hypr/conf/autostart.conf"
settingsFile="$HOME/dotfiles/.settings/waybar_nmapplet"
# Define Markers
startMarker="START NM APPLET"
endMarker="END NM APPLET"
# Select Value
customvalue=$(gum choose "Enable" "Disable")
if [ ! -z $customvalue ]; then
if [ "$customvalue" == "Enable" ] ;then
customtext="exec-once = nm-applet"
else
customtext="# exec-once = nm-applet"
fi
_replaceInFile $startMarker $endMarker $customtext $targetFile1
_writeSettings $settingsFile $customtext
# Reload Waybar
_goBack
else
echo "ERROR: Define a value."
sleep 2
_goBack
fi

View File

@ -1,7 +1,7 @@
#!/bin/bash
_getHeader "$name" "$author"
echo "Hide or show the bluetooth icon in ML4W waybar themes."
echo "Hide or show the bluetooth module in ML4W waybar themes."
# Define File
targetFile1="$HOME/dotfiles/waybar/themes/ml4w/config"

View File

@ -1,7 +1,8 @@
#!/bin/bash
_getHeader "$name" "$author"
echo "Define the start command to start the networkmanager."
echo "Define the start command to start the networkmanager (Must be installed on your system)."
echo "Possible values: alacritty -e nmtui, nm-connection-editor, etc."
# Define File
targetFile="$HOME/dotfiles/.settings/networkmanager.sh"

View File

@ -0,0 +1,2 @@
name="Show/Hide Network"
order=1

View File

@ -0,0 +1,40 @@
#!/bin/bash
_getHeader "$name" "$author"
echo "Hide or show the network 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"
settingsFile="$HOME/dotfiles/.settings/waybar_network"
# Define Markers
startMarker="START NETWORK TOOGLE"
endMarker="END NETWORK TOOGLE"
# Select Value
customvalue=$(gum choose "SHOW" "HIDE")
if [ ! -z $customvalue ]; then
if [ "$customvalue" == "SHOW" ] ;then
customtext=" \"network\","
else
customtext=" \/\/\"network\","
fi
_replaceInFile $startMarker $endMarker $customtext $targetFile1
_replaceInFile $startMarker $endMarker $customtext $targetFile2
_replaceInFile $startMarker $endMarker $customtext $targetFile3
_replaceInFile $startMarker $endMarker $customtext $targetFile4
_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

View File

@ -285,11 +285,11 @@
"network": {
"format": "{ifname}",
"format-wifi": " {signalStrength}%",
"format-ethernet": " {ipaddr}",
"format-disconnected": "Not connected", //An empty format will hide the module.
"format-ethernet": " {ifname}",
"format-disconnected": "Disconnected",
"tooltip-format": " {ifname} via {gwaddri}",
"tooltip-format-wifi": " {essid} ({signalStrength}%)",
"tooltip-format-ethernet": " {ifname} ({ipaddr}/{cidr})",
"tooltip-format-wifi": " {ifname} @ {essid}\nIP: {ipaddr}\nStrength: {signalStrength}%\nFreq: {frequency}MHz\nUp: {bandwidthUpBits} Down: {bandwidthDownBits}",
"tooltip-format-ethernet": " {ifname}\nIP: {ipaddr}\n up: {bandwidthUpBits} down: {bandwidthDownBits}",
"tooltip-format-disconnected": "Disconnected",
"max-length": 50,
"on-click": "~/dotfiles/.settings/networkmanager.sh"

View File

@ -55,7 +55,9 @@
"bluetooth",
// END BT TOOGLE
"battery",
// START NETWORK TOOGLE
"network",
// END NETWORK TOOGLE
"group/hardware",
"group/settings",
"custom/cliphist",

View File

@ -55,7 +55,9 @@
"bluetooth",
// END BT TOOGLE
"battery",
// START NETWORK TOOGLE
"network",
// END NETWORK TOOGLE
"group/hardware",
"custom/cliphist",
"idle_inhibitor",

View File

@ -408,6 +408,7 @@ window#waybar.empty #window {
#tray {
padding: 0px 15px 0px 0px;
color: @textcolor3;
}
#tray > .passive {
@ -421,7 +422,7 @@ window#waybar.empty #window {
/* -----------------------------------------------------
* Other
* ----------------------------------------------------- */
/*
label:focus {
background-color: #000000;
}
@ -437,4 +438,4 @@ label:focus {
#network.disconnected {
background-color: #f53c3c;
}
*/

View File

@ -55,7 +55,9 @@
"bluetooth",
// END BT TOOGLE
"battery",
// START NETWORK TOOGLE
"network",
// END NETWORK TOOGLE
"group/hardware",
"custom/cliphist",
"idle_inhibitor",

View File

@ -55,7 +55,9 @@
"bluetooth",
// END BT TOOGLE
"battery",
// START NETWORK TOOGLE
"network",
// END NETWORK TOOGLE
"group/hardware",
"custom/cliphist",
"idle_inhibitor",

View File

@ -419,23 +419,4 @@ window#waybar.empty #window {
-gtk-icon-effect: highlight;
}
/* -----------------------------------------------------
* Other
* ----------------------------------------------------- */
label:focus {
background-color: #000000;
}
#backlight {
background-color: #90b1b1;
}
#network {
background-color: #2980b9;
}
#network.disconnected {
background-color: #f53c3c;
}