Update all dotfiles

This commit is contained in:
2025-05-22 17:56:05 -05:00
parent 0280a88a7b
commit 4bb042584b
1651 changed files with 60533 additions and 2672 deletions

View File

@ -0,0 +1 @@
ags run

View File

@ -0,0 +1,6 @@
#!/bin/bash
clear
aur_helper="$(cat ~/.config/ml4w/settings/aur.sh)"
figlet -f smslant "Cleanup"
echo
$aur_helper -Scc

View File

@ -0,0 +1,66 @@
#!/bin/bash
# _____ _ _ _____ __
# | __ \ (_) | | / ____| / _|
# | |__) | __ _ _ __ | |_ ___ _ __ | | ___ _ __ | |_
# | ___/ '__| | '_ \| __/ _ \ '__| | | / _ \| '_ \| _|
# | | | | | | | | | || __/ | | |___| (_) | | | | |
# |_| |_| |_|_| |_|\__\___|_| \_____\___/|_| |_|_|
#
# By @krystalsavage
sleep 1
clear
figlet -f smslant "Printers"
# ------------------------------------------------------
# Confirm Start
# ------------------------------------------------------
if gum confirm "DO YOU WANT TO START TO INSTALL PRINTER SYSTEM NOW?" ;then
echo
echo ":: Install started."
elif [ $? -eq 130 ]; then
exit 130
else
echo
echo ":: Install canceled."
exit;
fi
if [[ $(_isInstalledYay "timeshift") == "0" ]] ;then
if gum confirm "DO YOU WANT TO CREATE A SNAPSHOT?" ;then
echo
c=$(gum input --placeholder "Enter a comment for the snapshot...")
sudo timeshift --create --comments "$c"
sudo timeshift --list
sudo grub-mkconfig -o /boot/grub/grub.cfg
echo ":: DONE. Snapshot $c created!"
echo
elif [ $? -eq 130 ]; then
echo ":: Snapshot canceled."
exit 130
else
echo ":: Snapshot canceled."
fi
echo
fi
yay -S cups cups-pdf cups-filters nss-mdns system-config-printer foomatic-db footmatic-db-engine foomatic-db-nonfree doomatic-db-nonfree-ppds foomatic-db-ppds cups-browsed libusb ipp-usb xdg-utils colord logrotate
notify-send "Installing printer system complete"
echo
echo ":: Installing printer system complete"
sleep 2
if [ -f ~/.config/ml4w/settings/printer-drivers.sh ] ;then
if gum confirm "DO YOU WANT TO INSTALL PRINTER DRIVERS NOW?" ;then
echo
echo ":: Install started."
elif [ $? -eq 130 ]; then
exit 130
else
echo
echo ":: Install cancelled."
exit;
fi
fi

View File

@ -0,0 +1,43 @@
#!/bin/bash
# _____ _ _ _ __ _
# |_ _(_)_ __ ___ ___ ___| |__ (_)/ _| |_
# | | | | '_ ` _ \ / _ \/ __| '_ \| | |_| __|
# | | | | | | | | | __/\__ \ | | | | _| |_
# |_| |_|_| |_| |_|\___||___/_| |_|_|_| \__|
#
sleep 1
clear
figlet -f smslant "Timeshift"
aur_helper="$(cat ~/.config/ml4w/settings/aur.sh)"
_isInstalledAUR() {
package="$1";
check="$($aur_helper -Qs --color always "${package}" | grep "local" | grep "${package} ")";
if [ -n "${check}" ] ; then
echo 0; #'0' means 'true' in Bash
return; #true
fi;
echo 1; #'1' means 'false' in Bash
return; #false
}
timeshift_installed=$(_isInstalledAUR "timeshift")
grubbtrfs_installed=$(_isInstalledAUR "grub-btrfs")
if [[ $timeshift_installed == "0" ]] ;then
echo ":: Timeshift is already installed"
else
if gum confirm "DO YOU WANT TO INSTALL Timeshift now?" ;then
$aur_helper -S timeshift
fi
fi
if [[ -d /boot/grub ]] && [[ $grubbtrfs_installed == "0" ]] ;then
echo ":: grub-btrfs is already installed"
else
echo ":: grub-btrfs is required to select a snapshot on grub bootloader."
if gum confirm "DO YOU WANT TO INSTALL grub-btrfs now?" ;then
$aur_helper -S grub-btrfs
fi
fi
sleep 3

View File

@ -0,0 +1,12 @@
#!/bin/bash
while IFS= read -r line; do
# If the line starts with # and the next line is not the lines to be added
if [[ $line == \#HandleLidSwitchDocked=ignore ]]; then
# Add the new lines
echo "HandleLidSwitchDocked=ignore" | sudo tee -a /etc/systemd/logind.conf > /dev/null
fi
if [[ $line == \#HoldoffTimeoutSec=5s ]]; then
# Add the new lines
echo "HoldoffTimeoutSec=5s" | sudo tee -a /etc/systemd/logind.conf > /dev/null
fi
done < /etc/systemd/logind.conf

View File

@ -0,0 +1,60 @@
#!/bin/bash
# ____
# | _ \ __ _ ___ _ __ ___ __ _ _ __
# | |_) / _` |/ __| '_ ` _ \ / _` | '_ \
# | __/ (_| | (__| | | | | | (_| | | | |
# |_| \__,_|\___|_| |_| |_|\__,_|_| |_|
#
sleep 1
clear
figlet -f smslant "pacman.conf"
echo
echo ":: This script will activate or deactivate additions for your pacman.conf."
echo
if grep -Fq "#ParallelDownloads" /etc/pacman.conf
then
if gum confirm "Do you want to activate parallel downloads?" ;then
sudo sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf
else
echo ":: Activation of parallel downloads skipped."
fi
else
echo ":: Parallel downloads are already activated."
fi
if grep -Fxq "#Color" /etc/pacman.conf
then
if gum confirm "Do you want to activate colors?" ;then
sudo sed -i 's/^#Color/Color/' /etc/pacman.conf
else
echo ":: Activation of Color skipped."
fi
else
echo ":: Color is already activated."
fi
if grep -Fxq "#VerbosePkgLists" /etc/pacman.conf
then
if gum confirm "Do you want to activate VerbosePkgLists?" ;then
sudo sed -i 's/^#VerbosePkgLists/VerbosePkgLists/' /etc/pacman.conf
else
echo ":: Activation of VerbosePkgLists skipped."
fi
else
echo ":: VerbosePkgLists is already activated."
fi
if grep -Fxq "ILoveCandy" /etc/pacman.conf
then
echo ":: ILoveCandy is already activated."
else
if gum confirm "Do you want to activate ILoveCandy?" ;then
sudo sed -i '/^ParallelDownloads = .*/a ILoveCandy' /etc/pacman.conf
else
echo ":: Activation of ILoveCandy skipped."
fi
fi
echo
echo "Press [ENTER] to close."
read

View File

@ -0,0 +1,61 @@
#!/bin/bash
# ____ _ _
# / ___| _ __ __ _ _ __ ___| |__ ___ | |_
# \___ \| '_ \ / _` | '_ \/ __| '_ \ / _ \| __|
# ___) | | | | (_| | |_) \__ \ | | | (_) | |_
# |____/|_| |_|\__,_| .__/|___/_| |_|\___/ \__|
# |_|
#
# by Stephan Raabe (2024)
# -----------------------------------------------------
sleep 1
clear
figlet -f smslant "Snapshot"
aur_helper="$(cat ~/.config/ml4w/settings/aur.sh)"
_isInstalledAUR() {
package="$1";
check="$($aur_helper -Qs --color always "${package}" | grep "local" | grep "${package} ")";
if [ -n "${check}" ] ; then
echo 0; #'0' means 'true' in Bash
return; #true
fi;
echo 1; #'1' means 'false' in Bash
return; #false
}
timeshift_installed=$(_isInstalledAUR "timeshift")
grubbtrfs_installed=$(_isInstalledAUR "grub-btrfs")
if [[ $timeshift_installed == "0" ]] ;then
c=$(gum input --placeholder "Enter a comment for the snapshot...")
sudo timeshift --create --comments "$c"
sudo timeshift --list
if [[ -d /boot/grub ]] ;then
if [[ -d /boot/grub ]] && [[ $grubbtrfs_installed == "1" ]] ;then
if gum confirm "DO YOU WANT TO INSTALL grub-btrfs now?" ;then
$aur_helper -S grub-btrfs
else
exit
fi
fi
sudo grub-mkconfig -o /boot/grub/grub.cfg
fi
echo "DONE. Snapshot $c created!"
else
echo "ERROR: Timeshift is not installed."
if gum confirm "DO YOU WANT TO INSTALL Timeshift now?" ;then
$aur_helper -S timeshift
echo
echo ":: Timeshift has been installed. Please restart this script."
if [[ -d /boot/grub ]] && [[ $grubbtrfs_installed == "1" ]] ;then
echo ":: grub-btrfs is required to select a snapshot on grub bootloader."
if gum confirm "DO YOU WANT TO INSTALL grub-btrfs now?" ;then
$aur_helper -S grub-btrfs
else
exit
fi
fi
fi
fi

View File

@ -0,0 +1,9 @@
#!/bin/bash
sleep 1
if [ -f /var/lib/pacman/db.lck ]; then
sudo rm /var/lib/pacman/db.lck
echo ":: Unlock complete"
else
echo ":: Pacman database is not locked"
fi
sleep 3

View File

@ -0,0 +1,21 @@
#!/bin/bash
# ____ _ _ _ _ _
# / ___| (_)_ __ | |__ (_)___| |_
# | | | | | '_ \| '_ \| / __| __|
# | |___| | | |_) | | | | \__ \ |_
# \____|_|_| .__/|_| |_|_|___/\__|
# |_|
#
case $1 in
d) cliphist list | rofi -dmenu -replace -config ~/.config/rofi/config-cliphist.rasi | cliphist delete
;;
w) if [ `echo -e "Clear\nCancel" | rofi -dmenu -config ~/.config/rofi/config-short.rasi` == "Clear" ] ; then
cliphist wipe
fi
;;
*) cliphist list | rofi -dmenu -replace -config ~/.config/rofi/config-cliphist.rasi | cliphist decode | wl-copy
;;
esac

View File

@ -0,0 +1,24 @@
#!/bin/bash
figlet -f smslant "Figlet"
echo
# ------------------------------------------------
# Script to create ascii font based header on user input
# and copy the result to the clipboard
# -----------------------------------------------------
read -p "Enter the text for ascii encoding: " mytext
if [ -f ~/figlet.txt ]; then
touch ~/figlet.txt
fi
echo "cat <<\"EOF\"" > ~/figlet.txt
figlet -f smslant "$mytext" >> ~/figlet.txt
echo "" >> ~/figlet.txt
echo "EOF" >> ~/figlet.txt
lines=$( cat ~/figlet.txt )
wl-copy "$lines"
xclip -sel clip ~/figlet.txt
echo "Text copied to clipboard!"

View File

@ -0,0 +1,101 @@
#!/bin/bash
# ____ __ ____ __ __
# / _/__ ___ / /____ _/ / / __ _____ ___/ /__ _/ /____ ___
# _/ // _ \(_-</ __/ _ `/ / / / // / _ \/ _ / _ `/ __/ -_|_-<
# /___/_//_/___/\__/\_,_/_/_/ \_,_/ .__/\_,_/\_,_/\__/\__/___/
# /_/
#
sleep 1
clear
install_platform="$(cat ~/.config/ml4w/settings/platform.sh)"
figlet -f smslant "Updates"
echo
# ------------------------------------------------------
# Confirm Start
# ------------------------------------------------------
if gum confirm "DO YOU WANT TO START THE UPDATE NOW?" ;then
echo
echo ":: Update started."
elif [ $? -eq 130 ]; then
exit 130
else
echo
echo ":: Update canceled."
exit;
fi
_isInstalled() {
package="$1";
case $install_platform in
arch)
check="$($aur_helper -Qs --color always "${package}" | grep "local" | grep "${package} ")";
;;
fedora)
check="$(dnf repoquery --quiet --installed ""${package}*"")"
;;
*)
;;
esac
if [ -n "${check}" ] ; then
echo 0; #'0' means 'true' in Bash
return; #true
fi;
echo 1; #'1' means 'false' in Bash
return; #false
}
# Check if platform is supported
case $install_platform in
arch)
aur_helper="$(cat ~/.config/ml4w/settings/aur.sh)"
if [[ $(_isInstalled "timeshift") == "0" ]] ;then
echo
if gum confirm "DO YOU WANT TO CREATE A SNAPSHOT?" ;then
echo
c=$(gum input --placeholder "Enter a comment for the snapshot...")
sudo timeshift --create --comments "$c"
sudo timeshift --list
sudo grub-mkconfig -o /boot/grub/grub.cfg
echo ":: DONE. Snapshot $c created!"
echo
elif [ $? -eq 130 ]; then
echo ":: Snapshot skipped."
exit 130
else
echo ":: Snapshot skipped."
fi
echo
fi
$aur_helper
if [[ $(_isInstalled "flatpak") == "0" ]] ;then
flatpak upgrade
fi
;;
fedora)
sudo dnf upgrade
if [[ $(_isInstalled "flatpak") == "0" ]] ;then
flatpak upgrade
fi
;;
*)
echo ":: ERROR - Platform not supported"
echo "Press [ENTER] to close."
read
;;
esac
notify-send "Update complete"
echo
echo ":: Update complete"
echo
echo
echo "Press [ENTER] to close."
read

View File

@ -0,0 +1,15 @@
#!/bin/bash
# Compare installed version with running dotfiles
if [ -f ~/.config/ml4w/version/compare.sh ] ;then
$HOME/.config/ml4w/version/compare.sh
fi
# Start ML4W Welcome App
if [ ! -f $HOME/.cache/ml4w-welcome-autostart ] ;then
echo ":: Starting ML4W Welcome App ..."
sleep 2
com.ml4w.welcome
else
echo ":: Autostart of ML4W Welcome App disabled."
fi

View File

@ -0,0 +1,21 @@
#!/bin/bash
# __ __
# ___ __ _ ___ ____ ___ / /__ / /_
# / _ \/ ' \/ _ `/ _ \/ _ \/ / -_) __/
# /_//_/_/_/_/\_,_/ .__/ .__/_/\__/\__/
# /_/ /_/
#
if [[ "$1" == "stop" ]]; then
killall nm-applet
elif [[ "$1" == "toggle" ]]; then
if pgrep -x "nm-applet" > /dev/null
then
echo "Running"
killall nm-applet
else
echo "Stopped"
nm-applet --indicator &
fi
else
nm-applet --indicator &
fi

View File

@ -0,0 +1,62 @@
#!/bin/bash
# _ _ _ _ _ _
# | | | |_ __ __| | __ _| |_ ___ ___ __| | __| |_ __ ___
# | | | | '_ \ / _` |/ _` | __/ _ \ / __|/ _` |/ _` | '_ ` _ \
# | |_| | |_) | (_| | (_| | || __/ \__ \ (_| | (_| | | | | | |
# \___/| .__/ \__,_|\__,_|\__\___| |___/\__,_|\__,_|_| |_| |_|
# |_|
#
# by Stephan Raabe (2024)
# -----------------------------------------------------
sleep 1
clear
cache_file="$HOME/.config/ml4w/cache/current_wallpaper"
current_wallpaper=$(cat "$cache_file")
extension="${current_wallpaper##*.}"
echo -e "${GREEN}"
figlet -f smslant "SDDM Wallpaper"
echo -e "${NONE}"
sddm_theme_name="sequoia"
sddm_asset_folder="/usr/share/sddm/themes/$sddm_theme_name/backgrounds"
sddm_theme_tpl="/usr/share/ml4w-hyprland/sddm/theme.conf"
if [ -f $HOME/.config/ml4w/settings/sddm/theme.conf ]; then
sddm_theme_tpl="$HOME/.config/ml4w/settings/sddm/theme.conf"
echo ":: Using custum theme.conf"
fi
if [ ! -f $current_wallpaper ]; then
gum spin --spinner dot --title "File $current_wallpaper does not exist" -- sleep 3
exit
fi
echo ":: Set the current wallpaper $current_wallpaper as SDDM wallpaper."
echo
if [ ! -d /etc/sddm.conf.d/ ]; then
sudo mkdir /etc/sddm.conf.d
echo ":: Folder /etc/sddm.conf.d created."
fi
sudo cp /usr/share/ml4w-hyprland/sddm/sddm.conf /etc/sddm.conf.d/
echo ":: File /etc/sddm.conf.d/sddm.conf updated."
sudo cp $current_wallpaper $sddm_asset_folder/current_wallpaper.$extension
echo ":: Current wallpaper copied into $sddm_asset_folder"
sudo cp $sddm_theme_tpl /usr/share/sddm/themes/$sddm_theme_name/
sudo sed -i 's/CURRENTWALLPAPER/'"current_wallpaper.$extension"'/' /usr/share/sddm/themes/$sddm_theme_name/theme.conf
echo ":: File theme.conf updated in /usr/share/sddm/themes/$sddm_theme_name/"
echo
echo ":: You can preview your updated SDDM Login screen. (Close it with SUPER+Q)"
echo
if gum confirm "Do you want to preview the result?"; then
sddm-greeter-qt6 --test-mode --theme /usr/share/sddm/themes/sequoia
fi
echo
gum spin --spinner dot --title "Please logout to see the result." -- sleep 3

View File

@ -0,0 +1,98 @@
#!/bin/bash
# ____ _ _ _
# / ___|| |__ ___| | |
# \___ \| '_ \ / _ \ | |
# ___) | | | | __/ | |
# |____/|_| |_|\___|_|_|
#
sleep 1
_isInstalledYay() {
package="$1";
check="$(yay -Qs --color always "${package}" | grep "local" | grep "\." | grep "${package} ")";
if [ -n "${check}" ] ; then
echo 0; #'0' means 'true' in Bash
return; #true
fi;
echo 1; #'1' means 'false' in Bash
return; #false
}
clear
figlet -f smslant "Shell"
echo ":: Please select your preferred shell"
echo
shell=$(gum choose "bash" "zsh" "Cancel")
# -----------------------------------------------------
# Activate bash
# -----------------------------------------------------
if [[ $shell == "bash" ]] ;then
# Change shell to bash
while ! chsh -s $(which bash); do
echo "ERROR: Authentication failed. Please enter the correct password."
sleep 1
done
echo ":: Shell is now bash."
gum spin --spinner dot --title "Please reboot your system." -- sleep 3
# -----------------------------------------------------
# Activate zsh
# -----------------------------------------------------
elif [[ $shell == "zsh" ]] ;then
# Change shell to shh
while ! chsh -s $(which zsh); do
echo "ERROR: Authentication failed. Please enter the correct password."
sleep 1
done
echo ":: Shell is now zsh."
# Installing oh-my-posh
yay -S oh-my-posh-bin
# Installing oh-my-zsh
if [ ! -d "$HOME/.oh-my-zsh" ]; then
echo ":: Installing oh-my-zsh"
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
cp ~/.config/ml4w/tpl/.zshrc ~/
else
echo ":: oh-my-zsh already installed"
fi
# Installing zsh-autosuggestions
if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions" ]; then
echo ":: Installing zsh-autosuggestions"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
else
echo ":: zsh-autosuggestions already installed"
fi
# Installing zsh-syntax-highlighting
if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" ]; then
echo ":: Installing zsh-syntax-highlighting"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
else
echo ":: zsh-syntax-highlighting already installed"
fi
# Installing fast-syntax-highlighting
if [ ! -d "$HOME/.oh-my-zsh/custom/plugins/fast-syntax-highlighting" ]; then
echo ":: Installing fast-syntax-highlighting"
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
else
echo ":: fast-syntax-highlighting already installed"
fi
gum spin --spinner dot --title "Please reboot your system." -- sleep 3
# -----------------------------------------------------
# Cencel
# -----------------------------------------------------
else
echo ":: Changing shell canceled"
exit
fi

View File

@ -0,0 +1,19 @@
#!/bin/bash
clear
if [ -f ~/.config/ml4w/settings/terminal.sh ]; then
terminal="$(cat ~/.config/ml4w/settings/terminal.sh)"
echo ":: Installing $terminal"
if [ -d ~/.config/xfce4 ]; then
if [ ! -f ~/.config/xfce4/helpers.rc ]; then
touch ~/.config/xfce4/helpers.rc
fi
echo "TerminalEmulator=$terminal" > ~/.config/xfce4/helpers.rc
echo ":: $terminal defined as Thunar Terminal Emulator."
else
echo "ERROR: ~/.config/xfce4 not found. Please open Thunar once to create it."
echo "Then start this script again."
fi
else
echo "ERROR: ~/.config/ml4w/settings/terminal.sh not found"
fi
sleep 3

View File

@ -0,0 +1,58 @@
#!/bin/bash
# _ _ _ _
# | | | |_ __ __| | __ _| |_ ___ ___
# | | | | '_ \ / _` |/ _` | __/ _ \/ __|
# | |_| | |_) | (_| | (_| | || __/\__ \
# \___/| .__/ \__,_|\__,_|\__\___||___/
# |_|
#
# -----------------------------------------------------
# Define threshholds for color indicators
# -----------------------------------------------------
threshhold_green=0
threshhold_yellow=25
threshhold_red=100
install_platform="$(cat ~/.config/ml4w/settings/platform.sh)"
# Check if platform is supported
case $install_platform in
arch)
aur_helper="$(cat ~/.config/ml4w/settings/aur.sh)"
# -----------------------------------------------------
# Calculate available updates
# -----------------------------------------------------
# flatpak remote-ls --updates
updates=$(checkupdates-with-aur | wc -l)
;;
fedora)
updates=$(dnf check-update -q|grep -c ^[a-z0-9])
;;
*)
updates=0
;;
esac
# -----------------------------------------------------
# Output in JSON format for Waybar Module custom-updates
# -----------------------------------------------------
css_class="green"
if [ "$updates" -gt $threshhold_yellow ]; then
css_class="yellow"
fi
if [ "$updates" -gt $threshhold_red ]; then
css_class="red"
fi
if [ "$updates" -gt $threshhold_green ]; then
printf '{"text": "%s", "alt": "%s", "tooltip": "Click to update your system", "class": "%s"}' "$updates" "$updates" "$css_class"
else
printf '{"text": "0", "alt": "0", "tooltip": "No updates available", "class": "green"}'
fi

View File

@ -0,0 +1,5 @@
res_w=$(hyprctl -j monitors | jq '.[] | select(.focused==true) | .width')
res_h=$(hyprctl -j monitors | jq '.[] | select(.focused==true) | .height')
h_scale=$(hyprctl -j monitors | jq '.[] | select (.focused == true) | .scale' | sed 's/\.//')
w_margin=$(( res_h * 27 / h_scale ))
wlogout -b 5 -T $w_margin -B $w_margin