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,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,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