This commit is contained in:
Stephan Raabe
2023-12-27 23:19:24 +01:00
parent 7a8de31afe
commit bd8fdde4d3
15 changed files with 282 additions and 148 deletions

View 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
View File

@@ -0,0 +1,3 @@
echo -e "${GREEN}"
figlet "General"
echo -e "${NONE}"

View File

@@ -1,38 +1,5 @@
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"
"xdg-desktop-portal"
"xdg-desktop-portal-hyprland"
"waybar"
"grim"
@@ -40,20 +7,11 @@ packagesPacman=(
"swayidle"
"swappy"
"cliphist"
"qalculate-gtk"
"brightnessctl"
"gum"
"man-pages"
);
packagesYay=(
"pfetch"
"bibata-cursor-theme"
"trizen"
"swww"
"swaylock-effects-git"
"wlogout"
"wlr-randr"
"pacseek"
"sddm-sugar-candy-git"
);

View File

@@ -160,3 +160,73 @@ _isKVM() {
echo 1
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
}

View File

@@ -1,56 +1,13 @@
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"
"polybar"
"picom"
"scrot"
"slock"
"qalculate-gtk"
"brightnessctl"
"gum"
"xorg"
"xorg-xinit"
"man-pages"
);
packagesYay=(
"pfetch"
"bibata-cursor-theme"
"trizen"
"qtile-extras"
"pacseek"
"sddm-sugar-candy-git"
);

View File

@@ -191,6 +191,62 @@ echo -e "${NONE}"
echo ""
_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 ""
fi