Updates
This commit is contained in:
parent
7a8de31afe
commit
bd8fdde4d3
48
.install/general-packages.sh
Normal file
48
.install/general-packages.sh
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
packagesPacman=(
|
||||||
|
"pacman-contrib"
|
||||||
|
"vim"
|
||||||
|
"wget"
|
||||||
|
"unzip"
|
||||||
|
"alacritty"
|
||||||
|
"rofi"
|
||||||
|
"chromium"
|
||||||
|
"dunst"
|
||||||
|
"starship"
|
||||||
|
"neovim"
|
||||||
|
"mpv"
|
||||||
|
"freerdp"
|
||||||
|
"xfce4-power-manager"
|
||||||
|
"thunar"
|
||||||
|
"mousepad"
|
||||||
|
"ttf-font-awesome"
|
||||||
|
"otf-font-awesome"
|
||||||
|
"ttf-fira-sans"
|
||||||
|
"ttf-fira-code"
|
||||||
|
"ttf-firacode-nerd"
|
||||||
|
"figlet"
|
||||||
|
"vlc"
|
||||||
|
"eza"
|
||||||
|
"python-pip"
|
||||||
|
"python-psutil"
|
||||||
|
"python-rich"
|
||||||
|
"python-click"
|
||||||
|
"pavucontrol"
|
||||||
|
"tumbler"
|
||||||
|
"xautolock"
|
||||||
|
"blueman"
|
||||||
|
"papirus-icon-theme"
|
||||||
|
"polkit-gnome"
|
||||||
|
"qalculate-gtk"
|
||||||
|
"brightnessctl"
|
||||||
|
"gum"
|
||||||
|
"man-pages"
|
||||||
|
"xdg-desktop-portal"
|
||||||
|
);
|
||||||
|
|
||||||
|
packagesYay=(
|
||||||
|
"pfetch"
|
||||||
|
"bibata-cursor-theme"
|
||||||
|
"trizen"
|
||||||
|
"pacseek"
|
||||||
|
"sddm-sugar-candy-git"
|
||||||
|
);
|
3
.install/general.sh
Normal file
3
.install/general.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
echo -e "${GREEN}"
|
||||||
|
figlet "General"
|
||||||
|
echo -e "${NONE}"
|
@ -1,38 +1,5 @@
|
|||||||
packagesPacman=(
|
packagesPacman=(
|
||||||
"pacman-contrib"
|
|
||||||
"wget"
|
|
||||||
"unzip"
|
|
||||||
"alacritty"
|
|
||||||
"rofi"
|
|
||||||
"chromium"
|
|
||||||
"dunst"
|
|
||||||
"starship"
|
|
||||||
"neovim"
|
|
||||||
"mpv"
|
|
||||||
"freerdp"
|
|
||||||
"xfce4-power-manager"
|
|
||||||
"thunar"
|
|
||||||
"mousepad"
|
|
||||||
"ttf-font-awesome"
|
|
||||||
"otf-font-awesome"
|
|
||||||
"ttf-fira-sans"
|
|
||||||
"ttf-fira-code"
|
|
||||||
"ttf-firacode-nerd"
|
|
||||||
"figlet"
|
|
||||||
"vlc"
|
|
||||||
"eza"
|
|
||||||
"python-pip"
|
|
||||||
"python-psutil"
|
|
||||||
"python-rich"
|
|
||||||
"python-click"
|
|
||||||
"pavucontrol"
|
|
||||||
"tumbler"
|
|
||||||
"xautolock"
|
|
||||||
"blueman"
|
|
||||||
"papirus-icon-theme"
|
|
||||||
"polkit-gnome"
|
|
||||||
"hyprland"
|
"hyprland"
|
||||||
"xdg-desktop-portal"
|
|
||||||
"xdg-desktop-portal-hyprland"
|
"xdg-desktop-portal-hyprland"
|
||||||
"waybar"
|
"waybar"
|
||||||
"grim"
|
"grim"
|
||||||
@ -40,20 +7,11 @@ packagesPacman=(
|
|||||||
"swayidle"
|
"swayidle"
|
||||||
"swappy"
|
"swappy"
|
||||||
"cliphist"
|
"cliphist"
|
||||||
"qalculate-gtk"
|
|
||||||
"brightnessctl"
|
|
||||||
"gum"
|
|
||||||
"man-pages"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
packagesYay=(
|
packagesYay=(
|
||||||
"pfetch"
|
|
||||||
"bibata-cursor-theme"
|
|
||||||
"trizen"
|
|
||||||
"swww"
|
"swww"
|
||||||
"swaylock-effects-git"
|
"swaylock-effects-git"
|
||||||
"wlogout"
|
"wlogout"
|
||||||
"wlr-randr"
|
"wlr-randr"
|
||||||
"pacseek"
|
|
||||||
"sddm-sugar-candy-git"
|
|
||||||
);
|
);
|
||||||
|
@ -160,3 +160,73 @@ _isKVM() {
|
|||||||
echo 1
|
echo 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# _replaceInFile $startMarket $endMarker $customtext $targetFile
|
||||||
|
_replaceInFile() {
|
||||||
|
|
||||||
|
# Set function parameters
|
||||||
|
start_string=$1
|
||||||
|
end_string=$2
|
||||||
|
new_string="$3"
|
||||||
|
file_path="$4"
|
||||||
|
|
||||||
|
# Counters
|
||||||
|
start_line_counter=0
|
||||||
|
end_line_counter=0
|
||||||
|
start_found=0
|
||||||
|
end_found=0
|
||||||
|
|
||||||
|
if [ -f $file_path ] ;then
|
||||||
|
|
||||||
|
# Detect Start String
|
||||||
|
while read -r line
|
||||||
|
do
|
||||||
|
((start_line_counter++))
|
||||||
|
if [[ $line = *$start_string* ]]; then
|
||||||
|
# echo "Start found in $start_line_counter"
|
||||||
|
start_found=$start_line_counter
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done < "$file_path"
|
||||||
|
|
||||||
|
# Detect End String
|
||||||
|
while read -r line
|
||||||
|
do
|
||||||
|
((end_line_counter++))
|
||||||
|
if [[ $line = *$end_string* ]]; then
|
||||||
|
# echo "End found in $end_line_counter"
|
||||||
|
end_found=$end_line_counter
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done < "$file_path"
|
||||||
|
|
||||||
|
# Check that deliminters exists
|
||||||
|
if [[ "$start_found" == "0" ]] ;then
|
||||||
|
echo "ERROR: Start deliminter not found."
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
|
if [[ "$end_found" == "0" ]] ;then
|
||||||
|
echo "ERROR: End deliminter not found."
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Replace text between delimiters
|
||||||
|
if [[ ! "$start_found" == "0" ]] && [[ ! "$end_found" == "0" ]] && [ "$start_found" -le "$end_found" ] ;then
|
||||||
|
# Remove the old line
|
||||||
|
((start_found++))
|
||||||
|
|
||||||
|
if [ ! "$start_found" == "$end_found" ] ;then
|
||||||
|
((end_found--))
|
||||||
|
sed -i "$start_found,$end_found d" $file_path
|
||||||
|
fi
|
||||||
|
# Add the new line
|
||||||
|
sed -i "$start_found i $new_string" $file_path
|
||||||
|
else
|
||||||
|
echo "ERROR: Delimiters syntax."
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "ERROR: Target file not found."
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
@ -1,56 +1,13 @@
|
|||||||
packagesPacman=(
|
packagesPacman=(
|
||||||
"pacman-contrib"
|
|
||||||
"wget"
|
|
||||||
"unzip"
|
|
||||||
"alacritty"
|
|
||||||
"rofi"
|
|
||||||
"chromium"
|
|
||||||
"nitrogen"
|
|
||||||
"dunst"
|
|
||||||
"starship"
|
|
||||||
"neovim"
|
|
||||||
"mpv"
|
|
||||||
"freerdp"
|
|
||||||
"xfce4-power-manager"
|
|
||||||
"thunar"
|
|
||||||
"mousepad"
|
|
||||||
"ttf-font-awesome"
|
|
||||||
"otf-font-awesome"
|
|
||||||
"ttf-fira-sans"
|
|
||||||
"ttf-fira-code"
|
|
||||||
"ttf-firacode-nerd"
|
|
||||||
"figlet"
|
|
||||||
"vlc"
|
|
||||||
"eza"
|
|
||||||
"python-pip"
|
|
||||||
"python-psutil"
|
|
||||||
"python-rich"
|
|
||||||
"python-click"
|
|
||||||
"xdg-desktop-portal"
|
|
||||||
"pavucontrol"
|
|
||||||
"tumbler"
|
|
||||||
"xautolock"
|
|
||||||
"blueman"
|
|
||||||
"papirus-icon-theme"
|
|
||||||
"polkit-gnome"
|
|
||||||
"qtile"
|
"qtile"
|
||||||
"polybar"
|
"polybar"
|
||||||
"picom"
|
"picom"
|
||||||
"scrot"
|
"scrot"
|
||||||
"slock"
|
"slock"
|
||||||
"qalculate-gtk"
|
|
||||||
"brightnessctl"
|
|
||||||
"gum"
|
|
||||||
"xorg"
|
"xorg"
|
||||||
"xorg-xinit"
|
"xorg-xinit"
|
||||||
"man-pages"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
packagesYay=(
|
packagesYay=(
|
||||||
"pfetch"
|
|
||||||
"bibata-cursor-theme"
|
|
||||||
"trizen"
|
|
||||||
"qtile-extras"
|
"qtile-extras"
|
||||||
"pacseek"
|
|
||||||
"sddm-sugar-candy-git"
|
|
||||||
);
|
);
|
||||||
|
@ -192,5 +192,61 @@ echo -e "${NONE}"
|
|||||||
|
|
||||||
_showRestoreOptions
|
_showRestoreOptions
|
||||||
|
|
||||||
|
# Restore Waybar Workspaces
|
||||||
|
targetFile="$HOME/dotfiles-versions/$version/waybar/modules.json"
|
||||||
|
settingsFile="$HOME/dotfiles/.settings/waybar_workspaces"
|
||||||
|
if [ -f $settingsFile ] ;then
|
||||||
|
startMarker="START WORKSPACE"
|
||||||
|
endMarker="END WORKSPACES"
|
||||||
|
customtext="$(cat $settingsFile)"
|
||||||
|
_replaceInFile "$startMarker" "$endMarker" "$customtext" "$targetFile"
|
||||||
|
echo "Waybar Workspaces restored."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Restore Waybar Appslabel
|
||||||
|
targetFile="$HOME/dotfiles-versions/$version/waybar/modules.json"
|
||||||
|
settingsFile="$HOME/dotfiles/.settings/waybar_appslabel"
|
||||||
|
if [ -f $settingsFile ] ;then
|
||||||
|
startMarker="START APPS LABEL"
|
||||||
|
endMarker="END APPS LABEL"
|
||||||
|
customtext="$(cat $settingsFile)"
|
||||||
|
_replaceInFile "$startMarker" "$endMarker" "$customtext" "$targetFile"
|
||||||
|
echo "Waybar Appslabel restored."
|
||||||
|
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"
|
||||||
|
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"
|
||||||
|
echo "Waybar Bluetooth restored."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Restore Waybar Systray
|
||||||
|
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_systray"
|
||||||
|
if [ -f $settingsFile ] ;then
|
||||||
|
startMarker="START TRAY TOOGLE"
|
||||||
|
endMarker="END TRAY 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 Systray restored."
|
||||||
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
@ -197,19 +197,82 @@ _writeConf() {
|
|||||||
|
|
||||||
# _replaceInFile $startMarket $endMarker $customtext $targetFile
|
# _replaceInFile $startMarket $endMarker $customtext $targetFile
|
||||||
_replaceInFile() {
|
_replaceInFile() {
|
||||||
if grep -s "$1" $4 && grep -s "$2" $4 ;then
|
|
||||||
sed -i '/'"$1"'/,/'"$2"'/ {
|
# Set function parameters
|
||||||
//!d
|
start_string=$1
|
||||||
/'"$1"'/a\
|
end_string=$2
|
||||||
'"$3"'
|
new_string="$3"
|
||||||
}' $4
|
file_path=$4
|
||||||
|
|
||||||
|
# Counters
|
||||||
|
start_line_counter=0
|
||||||
|
end_line_counter=0
|
||||||
|
start_found=0
|
||||||
|
end_found=0
|
||||||
|
|
||||||
|
if [ -f $file_path ] ;then
|
||||||
|
|
||||||
|
# Detect Start String
|
||||||
|
while read -r line
|
||||||
|
do
|
||||||
|
((start_line_counter++))
|
||||||
|
if [[ $line = *$start_string* ]]; then
|
||||||
|
# echo "Start found in $start_line_counter"
|
||||||
|
start_found=$start_line_counter
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done < "$file_path"
|
||||||
|
|
||||||
|
# Detect End String
|
||||||
|
while read -r line
|
||||||
|
do
|
||||||
|
((end_line_counter++))
|
||||||
|
if [[ $line = *$end_string* ]]; then
|
||||||
|
# echo "End found in $end_line_counter"
|
||||||
|
end_found=$end_line_counter
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done < "$file_path"
|
||||||
|
|
||||||
|
# Check that deliminters exists
|
||||||
|
if [[ "$start_found" == "0" ]] ;then
|
||||||
|
echo "ERROR: Start deliminter not found."
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
|
if [[ "$end_found" == "0" ]] ;then
|
||||||
|
echo "ERROR: End deliminter not found."
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Replace text between delimiters
|
||||||
|
if [[ ! "$start_found" == "0" ]] && [[ ! "$end_found" == "0" ]] && [ "$start_found" -le "$end_found" ] ;then
|
||||||
|
# Remove the old line
|
||||||
|
((start_found++))
|
||||||
|
|
||||||
|
if [ ! "$start_found" == "$end_found" ] ;then
|
||||||
|
((end_found--))
|
||||||
|
sed -i "$start_found,$end_found d" $file_path
|
||||||
|
fi
|
||||||
|
# Add the new line
|
||||||
|
sed -i "$start_found i $new_string" $file_path
|
||||||
|
else
|
||||||
|
echo "ERROR: Delimiters syntax."
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "ERROR: $1 and/or $2 not found in $4"
|
echo "ERROR: Target file not found."
|
||||||
sleep 2
|
sleep 2
|
||||||
_goBack
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# _writeSettings $settingsFile $customtext
|
||||||
|
_writeSettings() {
|
||||||
|
if [ ! -f $1 ] ;then
|
||||||
|
touch $1
|
||||||
|
fi
|
||||||
|
echo "$2" > $1
|
||||||
|
}
|
||||||
|
|
||||||
# Return the version of the hyprland-settings script
|
# Return the version of the hyprland-settings script
|
||||||
_getVersion() {
|
_getVersion() {
|
||||||
echo $version
|
echo $version
|
||||||
|
@ -5,10 +5,11 @@ echo "Define the label of the Apps Starter"
|
|||||||
|
|
||||||
# Define File
|
# Define File
|
||||||
targetFile="$HOME/dotfiles/waybar/modules.json"
|
targetFile="$HOME/dotfiles/waybar/modules.json"
|
||||||
|
settingsFile="$HOME/dotfiles/.settings/waybar_appslabel"
|
||||||
|
|
||||||
# Define Markers
|
# Define Markers
|
||||||
startMarker="\/\/ START APPS LABEL"
|
startMarker="START APPS LABEL"
|
||||||
endMarker="\/\/ END APPS LABEL"
|
endMarker="END APPS LABEL"
|
||||||
|
|
||||||
# Define Replacement Template
|
# Define Replacement Template
|
||||||
customtemplate="\"format\": \"VALUE\","
|
customtemplate="\"format\": \"VALUE\","
|
||||||
@ -20,6 +21,7 @@ if [ ! -z $customvalue ]; then
|
|||||||
# Replace in Template
|
# Replace in Template
|
||||||
customtext="${customtemplate/VALUE/"$customvalue"}"
|
customtext="${customtemplate/VALUE/"$customvalue"}"
|
||||||
_replaceInFile $startMarker $endMarker $customtext $targetFile
|
_replaceInFile $startMarker $endMarker $customtext $targetFile
|
||||||
|
_writeSettings $settingsFile $customtext
|
||||||
|
|
||||||
# Reload Waybar
|
# Reload Waybar
|
||||||
setsid $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 &
|
setsid $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 &
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
name="Toggle Bluetooth"
|
name="Show/Hide Bluetooth"
|
||||||
order=1
|
order=1
|
||||||
|
@ -8,37 +8,27 @@ targetFile1="$HOME/dotfiles/waybar/themes/ml4w/config"
|
|||||||
targetFile2="$HOME/dotfiles/waybar/themes/ml4w-blur/config"
|
targetFile2="$HOME/dotfiles/waybar/themes/ml4w-blur/config"
|
||||||
targetFile3="$HOME/dotfiles/waybar/themes/ml4w-blur-bottom/config"
|
targetFile3="$HOME/dotfiles/waybar/themes/ml4w-blur-bottom/config"
|
||||||
targetFile4="$HOME/dotfiles/waybar/themes/ml4w-bottom/config"
|
targetFile4="$HOME/dotfiles/waybar/themes/ml4w-bottom/config"
|
||||||
|
settingsFile="$HOME/dotfiles/.settings/waybar_bluetooth"
|
||||||
if [ ! -f $targetFile1 ] || [ ! -f $targetFile2 ] || [ ! -f $targetFile3 ] || [ ! -f $targetFile4 ] ;then
|
|
||||||
echo "ERROR: Target file not found."
|
|
||||||
sleep 2
|
|
||||||
_goBack
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Define Markers
|
# Define Markers
|
||||||
startMarker="\/\/ START BT TOOGLE"
|
startMarker="START BT TOOGLE"
|
||||||
endMarker="\/\/ END BT TOOGLE"
|
endMarker="END BT TOOGLE"
|
||||||
|
|
||||||
# Define Replacement Template
|
|
||||||
customtemplate="VALUE\"bluetooth\","
|
|
||||||
|
|
||||||
# Select Value
|
# Select Value
|
||||||
customvalue=$(gum choose "SHOW" "HIDE")
|
customvalue=$(gum choose "SHOW" "HIDE")
|
||||||
|
|
||||||
if [ ! -z $customvalue ]; then
|
if [ ! -z $customvalue ]; then
|
||||||
if [ "$customvalue" == "SHOW" ] ;then
|
if [ "$customvalue" == "SHOW" ] ;then
|
||||||
customvalue=""
|
customtext=" \"bluetooth\","
|
||||||
else
|
else
|
||||||
customvalue="//"
|
customtext=" \/\/\"bluetooth\","
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Replace in Template
|
|
||||||
customtext="${customtemplate/VALUE/"$customvalue"}"
|
|
||||||
|
|
||||||
_replaceInFile $startMarker $endMarker $customtext $targetFile1
|
_replaceInFile $startMarker $endMarker $customtext $targetFile1
|
||||||
_replaceInFile $startMarker $endMarker $customtext $targetFile2
|
_replaceInFile $startMarker $endMarker $customtext $targetFile2
|
||||||
_replaceInFile $startMarker $endMarker $customtext $targetFile3
|
_replaceInFile $startMarker $endMarker $customtext $targetFile3
|
||||||
_replaceInFile $startMarker $endMarker $customtext $targetFile4
|
_replaceInFile $startMarker $endMarker $customtext $targetFile4
|
||||||
|
_writeSettings $settingsFile $customtext
|
||||||
|
|
||||||
# Reload Waybar
|
# Reload Waybar
|
||||||
setsid $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 &
|
setsid $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 &
|
||||||
|
@ -4,6 +4,7 @@ _getHeader "$name" "$author"
|
|||||||
echo "Define the date format for the clock module. Default: {:%Y-%m-%d}"
|
echo "Define the date format for the clock module. Default: {:%Y-%m-%d}"
|
||||||
# Define File
|
# Define File
|
||||||
targetFile="$HOME/dotfiles/waybar/modules.json"
|
targetFile="$HOME/dotfiles/waybar/modules.json"
|
||||||
|
settingsFile="$HOME/dotfiles/.settings/waybar_date"
|
||||||
|
|
||||||
# Define Markers
|
# Define Markers
|
||||||
startMarker="\/\/ START CLOCK FORMAT"
|
startMarker="\/\/ START CLOCK FORMAT"
|
||||||
@ -20,9 +21,11 @@ if [ ! -z $customvalue ]; then
|
|||||||
customtext="${customtemplate/VALUE/"$customvalue"}"
|
customtext="${customtemplate/VALUE/"$customvalue"}"
|
||||||
|
|
||||||
_replaceInFile $startMarker $endMarker $customtext $targetFile
|
_replaceInFile $startMarker $endMarker $customtext $targetFile
|
||||||
|
_writeSettings $settingsFile $customtext
|
||||||
|
|
||||||
# Reload Waybar
|
# Reload Waybar
|
||||||
setsid $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 &
|
setsid $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 &
|
||||||
|
_goBack
|
||||||
else
|
else
|
||||||
echo "ERROR: Define a value."
|
echo "ERROR: Define a value."
|
||||||
sleep 2
|
sleep 2
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
name="Toggle Systray"
|
name="Show/Hide Systray"
|
||||||
order=1
|
order=1
|
||||||
|
@ -8,37 +8,27 @@ targetFile1="$HOME/dotfiles/waybar/themes/ml4w/config"
|
|||||||
targetFile2="$HOME/dotfiles/waybar/themes/ml4w-blur/config"
|
targetFile2="$HOME/dotfiles/waybar/themes/ml4w-blur/config"
|
||||||
targetFile3="$HOME/dotfiles/waybar/themes/ml4w-blur-bottom/config"
|
targetFile3="$HOME/dotfiles/waybar/themes/ml4w-blur-bottom/config"
|
||||||
targetFile4="$HOME/dotfiles/waybar/themes/ml4w-bottom/config"
|
targetFile4="$HOME/dotfiles/waybar/themes/ml4w-bottom/config"
|
||||||
|
settingsFile="$HOME/dotfiles/.settings/waybar_systray"
|
||||||
if [ ! -f $targetFile1 ] || [ ! -f $targetFile2 ] || [ ! -f $targetFile3 ] || [ ! -f $targetFile4 ] ;then
|
|
||||||
echo "ERROR: Target file not found."
|
|
||||||
sleep 2
|
|
||||||
_goBack
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Define Markers
|
# Define Markers
|
||||||
startMarker="\/\/ START TRAY TOOGLE"
|
startMarker="START TRAY TOOGLE"
|
||||||
endMarker="\/\/ END TRAY TOOGLE"
|
endMarker="END TRAY TOOGLE"
|
||||||
|
|
||||||
# Define Replacement Template
|
|
||||||
customtemplate="VALUE\"tray\","
|
|
||||||
|
|
||||||
# Select Value
|
# Select Value
|
||||||
customvalue=$(gum choose "SHOW" "HIDE")
|
customvalue=$(gum choose "SHOW" "HIDE")
|
||||||
|
|
||||||
if [ ! -z $customvalue ]; then
|
if [ ! -z $customvalue ]; then
|
||||||
if [ "$customvalue" == "SHOW" ] ;then
|
if [ "$customvalue" == "SHOW" ] ;then
|
||||||
customvalue=""
|
customtext=" \"tray\","
|
||||||
else
|
else
|
||||||
customvalue="//"
|
customtext=" \/\/\"tray\","
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Replace in Template
|
|
||||||
customtext="${customtemplate/VALUE/"$customvalue"}"
|
|
||||||
|
|
||||||
_replaceInFile $startMarker $endMarker $customtext $targetFile1
|
_replaceInFile $startMarker $endMarker $customtext $targetFile1
|
||||||
_replaceInFile $startMarker $endMarker $customtext $targetFile2
|
_replaceInFile $startMarker $endMarker $customtext $targetFile2
|
||||||
_replaceInFile $startMarker $endMarker $customtext $targetFile3
|
_replaceInFile $startMarker $endMarker $customtext $targetFile3
|
||||||
_replaceInFile $startMarker $endMarker $customtext $targetFile4
|
_replaceInFile $startMarker $endMarker $customtext $targetFile4
|
||||||
|
_writeSettings $settingsFile $customtext
|
||||||
|
|
||||||
# Reload Waybar
|
# Reload Waybar
|
||||||
setsid $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 &
|
setsid $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 &
|
||||||
|
@ -3,10 +3,11 @@ _getHeader "$name" "$author"
|
|||||||
|
|
||||||
# Define File
|
# Define File
|
||||||
targetFile="$HOME/dotfiles/waybar/modules.json"
|
targetFile="$HOME/dotfiles/waybar/modules.json"
|
||||||
|
settingsFile="$HOME/dotfiles/.settings/waybar_workspaces"
|
||||||
|
|
||||||
# Define Markers
|
# Define Markers
|
||||||
startMarker="\/\/ START WORKSPACE"
|
startMarker="START WORKSPACE"
|
||||||
endMarker="\/\/ END WORKSPACES"
|
endMarker="END WORKSPACES"
|
||||||
|
|
||||||
# Define Replacement Template
|
# Define Replacement Template
|
||||||
customtemplate="\"*\": VALUE"
|
customtemplate="\"*\": VALUE"
|
||||||
@ -14,28 +15,17 @@ customtemplate="\"*\": VALUE"
|
|||||||
# Select Value
|
# Select Value
|
||||||
customvalue=$(gum choose 5 6 7 8 9 10)
|
customvalue=$(gum choose 5 6 7 8 9 10)
|
||||||
if [ ! -z $customvalue ] ;then
|
if [ ! -z $customvalue ] ;then
|
||||||
# Replace in Template
|
|
||||||
customtext="${customtemplate/VALUE/"$customvalue"}"
|
|
||||||
|
|
||||||
# Ensure that markers are in target file
|
# Replace in Template
|
||||||
if grep -s "$startMarker" $targetFile && grep -s "$endMarker" $targetFile; then
|
customtext="${customtemplate/VALUE/"$customvalue"}"
|
||||||
|
|
||||||
# Write into File
|
_replaceInFile $startMarker $endMarker $customtext $targetFile
|
||||||
sed -i '/'"$startMarker"'/,/'"$endMarker"'/ {
|
_writeSettings $settingsFile $customtext
|
||||||
//!d
|
|
||||||
/'"$startMarker"'/a\
|
|
||||||
'"$customtext"'
|
|
||||||
}' $targetFile
|
|
||||||
|
|
||||||
# Reload Waybar
|
# Reload Waybar
|
||||||
setsid $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 &
|
setsid $HOME/dotfiles/waybar/launch.sh 1>/dev/null 2>&1 &
|
||||||
_goBack
|
_goBack
|
||||||
|
|
||||||
else
|
|
||||||
echo "ERROR: Marker not found."
|
|
||||||
sleep 2
|
|
||||||
_goBack
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
_goBack
|
_goBack
|
||||||
fi
|
fi
|
||||||
|
@ -40,6 +40,10 @@ source .install/preparation.sh
|
|||||||
source .install/profile.sh
|
source .install/profile.sh
|
||||||
source .install/yay.sh
|
source .install/yay.sh
|
||||||
source .install/installer.sh
|
source .install/installer.sh
|
||||||
|
source .install/general.sh
|
||||||
|
source .install/general-packages.sh
|
||||||
|
source .install/install-packages.sh
|
||||||
|
|
||||||
if [[ $profile == *"Hyprland"* ]]; then
|
if [[ $profile == *"Hyprland"* ]]; then
|
||||||
source .install/hyprland.sh
|
source .install/hyprland.sh
|
||||||
source .install/hyprland-packages.sh
|
source .install/hyprland-packages.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user