Update identation

This commit is contained in:
JeremyStar™ 2024-06-03 20:10:39 +02:00
parent 9a16bae023
commit 1c887ee342
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
9 changed files with 290 additions and 297 deletions

View file

@ -1,8 +1,8 @@
#!/bin/bash
# Check for sudo
if [ ! -f "/sbin/sudo" ]; then
echo ":: Error: \"/sbin/sudo\" not found, please install sudo"
exit 1
echo ":: Error: \"/sbin/sudo\" not found, please install sudo"
exit 1
fi
# Clear variables
@ -11,121 +11,121 @@ INSTALL_GUI_PACKAGES=
# Parse arguments
for arg in "${@}"; do
case "${arg}" in
"--noconfirm")
# I don't know what shellcheck is seeing here...
# shellcheck disable=SC2037
PACMAN_FLAGS=${PACMAN_FLAGS} --noconfirm
;;
"--gui")
INSTALL_GUI_PACKAGES=true
;;
*)
echo ":: Warning: Unknown argument \"${arg}\""
esac
case "${arg}" in
"--noconfirm")
# I don't know what shellcheck is seeing here...
# shellcheck disable=SC2037
PACMAN_FLAGS=${PACMAN_FLAGS} --noconfirm
;;
"--gui")
INSTALL_GUI_PACKAGES=true
;;
*)
echo ":: Warning: Unknown argument \"${arg}\""
esac
done
# Source /etc/os-release
echo ":: Detecting distribution"
if [ -f "/etc/os-release" ]; then
# shellcheck disable=SC1091
source /etc/os-release
# shellcheck disable=SC1091
source /etc/os-release
fi
# Perform actions based on distro
case "$ID" in
"arch")
echo ":: Detected Arch Linux, installing packages automatically"
# Check for paru
if [ ! -f "/sbin/paru" ]; then
echo ":: Error: \"/sbin/paru\" not found, please install paru"
exit 1
fi
# Install required packages (command line)
# shellcheck disable=SC2086
paru --removemake --batchinstall --sudoloop --mflags "--ignorearch" -Syu --needed ${PACMAN_FLAGS} \
nano ncurses moar fireplace sl fortune-mod cowsay lolcat \
moar yt-dlp-git tar zstd bzip zip unrar unzip 7-zip \
rustup binutils base-devel cpu-power
# Install required packages packages (graphical)
# shellcheck disable=SC2086
[[ -n "${INSTALL_GUI_PACKAGES}" ]] && \
paru --removemake --batchinstall --sudoloop --mflags "--ignorearch" -Syu --needed ${PACMAN_FLAGS} \
hyprland-git hyprpaper-git waybar fnott qt6ct bemenu-wayland \
cliphist j4-dmenu-desktop polkit-kde-agent polkit-qt6 \
xdg-desktop-portal-hyprland-git xdg-desktop-portal-kde \
qt6-wayland qt5-wayland xwaylandvideobridge pipewire \
wireplumber
# Install/update Rust toolchains and Rust-based software
(
# Update installed toolchains
rustup update
# Install nightly and stable toolchains
rustup install stable
rustup install nightly
# Switch to stable toolchain
rustup default nightly
# Install software
cargo install eza cargo-audit
)
# Install SDKMAN! and Java
(
# Download & install SDKMAN!
curl -s "https://get.sdkman.io" | bash
# Initialize SDKMAN! for subshell
export SDKMAN_DIR="$HOME/.sdkman"
# shellcheck disable=SC1091
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
# Update SDKMAN! and installed candidates
sdk selfupdate
sdk update
# Install Java versions specified in array
# We use the Temurin distribution of Java.
java_versions=( '22.0.1' '21.0.3' '17.0.11' '8.0.412' )
for version in "${java_versions[@]}"; do
sdk install java "${version}-tem"
done
# Default to Java 21
sdk default java 21.0.3-tem
)
# Install Hyprland plugins
(
# Install Hyprland headers & update existing plugins
hyprpm update
# Add hyprland-plugins repository
yes | hyprpm add https://github.com/hyprwm/hyprland-plugins
# Enable plugins
hyprpm enable csgo-vulkan-fix
)
;;
"archarm")
echo ":: Arch Linux ARM is not yet supported"
echo " (but will soon be). Just wait a little!"
;;
*)
echo ":: Hmm... your distribution isn't supported"
echo " You can do the following:"
echo " - Create an issue"
echo " - Look into the source for this script"
echo " and install the required software yourself"
;;
"arch")
echo ":: Detected Arch Linux, installing packages automatically"
# Check for paru
if [ ! -f "/sbin/paru" ]; then
echo ":: Error: \"/sbin/paru\" not found, please install paru"
exit 1
fi
# Install required packages (command line)
# shellcheck disable=SC2086
paru --removemake --batchinstall --sudoloop --mflags "--ignorearch" -Syu --needed ${PACMAN_FLAGS} \
nano ncurses moar fireplace sl fortune-mod cowsay lolcat \
moar yt-dlp-git tar zstd bzip zip unrar unzip 7-zip \
rustup binutils base-devel cpu-power
# Install required packages packages (graphical)
# shellcheck disable=SC2086
[[ -n "${INSTALL_GUI_PACKAGES}" ]] && \
paru --removemake --batchinstall --sudoloop --mflags "--ignorearch" -Syu --needed ${PACMAN_FLAGS} \
hyprland-git hyprpaper-git waybar fnott qt6ct bemenu-wayland \
cliphist j4-dmenu-desktop polkit-kde-agent polkit-qt6 \
xdg-desktop-portal-hyprland-git xdg-desktop-portal-kde \
qt6-wayland qt5-wayland xwaylandvideobridge pipewire \
wireplumber
# Install/update Rust toolchains and Rust-based software
(
# Update installed toolchains
rustup update
# Install nightly and stable toolchains
rustup install stable
rustup install nightly
# Switch to stable toolchain
rustup default nightly
# Install software
cargo install eza cargo-audit
)
# Install SDKMAN! and Java
(
# Download & install SDKMAN!
curl -s "https://get.sdkman.io" | bash
# Initialize SDKMAN! for subshell
export SDKMAN_DIR="$HOME/.sdkman"
# shellcheck disable=SC1091
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
# Update SDKMAN! and installed candidates
sdk selfupdate
sdk update
# Install Java versions specified in array
# We use the Temurin distribution of Java.
java_versions=( '22.0.1' '21.0.3' '17.0.11' '8.0.412' )
for version in "${java_versions[@]}"; do
sdk install java "${version}-tem"
done
# Default to Java 21
sdk default java 21.0.3-tem
)
# Install Hyprland plugins
(
# Install Hyprland headers & update existing plugins
hyprpm update
# Add hyprland-plugins repository
yes | hyprpm add https://github.com/hyprwm/hyprland-plugins
# Enable plugins
hyprpm enable csgo-vulkan-fix
)
;;
"archarm")
echo ":: Arch Linux ARM is not yet supported"
echo " (but will soon be). Just wait a little!"
;;
*)
echo ":: Hmm... your distribution isn't supported"
echo " You can do the following:"
echo " - Create an issue"
echo " - Look into the source for this script"
echo " and install the required software yourself"
;;
esac

View file

@ -1,7 +1,7 @@
#!/bin/bash
cd "${HOME}/.dotfiles" || (
echo ":: Error: Can't cd into ${HOME}/.dotfiles"
exit 1
echo ":: Error: Can't cd into ${HOME}/.dotfiles"
exit 1
)
# Colors
@ -12,35 +12,35 @@ COLOR_RESET="\e[0m"
# Latest commit
if curl -qsI https://git.staropensource.de|head -1|grep " 200" &> /dev/null; then
COMMIT=$(env PAGER= git log -n 1 --pretty=format:\"%H\")
LATEST_COMMIT=$(curl -sX 'GET' 'https://git.staropensource.de/api/v1/repos/JeremyStarTM/punktdateien/branches/develop' -H 'accept: application/json'|jq --monochrome-output '.commit.id')
LATEST_COMMIT_MESSAGE=$(curl -sX 'GET' 'https://git.staropensource.de/api/v1/repos/JeremyStarTM/punktdateien/branches/develop' -H 'accept: application/json'|jq --monochrome-output '.commit.message'|sed 's/\\n//g')
COMMIT=$(env PAGER= git log -n 1 --pretty=format:\"%H\")
LATEST_COMMIT=$(curl -sX 'GET' 'https://git.staropensource.de/api/v1/repos/JeremyStarTM/punktdateien/branches/develop' -H 'accept: application/json'|jq --monochrome-output '.commit.id')
LATEST_COMMIT_MESSAGE=$(curl -sX 'GET' 'https://git.staropensource.de/api/v1/repos/JeremyStarTM/punktdateien/branches/develop' -H 'accept: application/json'|jq --monochrome-output '.commit.message'|sed 's/\\n//g')
else
[[ -z "${SCRIPTED}" ]] && echo -e "${COLOR_BOLD}https://git.staropensource.de is not reachable"
exit 1
[[ -z "${SCRIPTED}" ]] && echo -e "${COLOR_BOLD}https://git.staropensource.de is not reachable"
exit 1
fi
if [ "${COMMIT}" == "${LATEST_COMMIT}" ] || [ -z "${LATEST_COMMIT}" ]; then
UPDATE=
UPDATE=
else
UPDATE=true
UPDATE=true
fi
if [ -z "${SCRIPTED}" ]; then
if [ -n "${UPDATE}" ]; then
echo -e "${COLOR_BOLD}An update for jstm's punktdateien is available."
echo -e "${COLOR_REGULAR}Latest commit: ${LATEST_COMMIT}"
echo " -> Message: ${LATEST_COMMIT_MESSAGE}"
echo ""
echo -e "${COLOR_BOLD}Update by executing \"dotfiles-updater\""
echo -en "${COLOR_RESET}"
exit 0
elif [ -z "${BASHRC}" ]; then
echo -e "${COLOR_BOLD}No update available"
exit 1
fi
if [ -n "${UPDATE}" ]; then
echo -e "${COLOR_BOLD}An update for jstm's punktdateien is available."
echo -e "${COLOR_REGULAR}Latest commit: ${LATEST_COMMIT}"
echo " -> Message: ${LATEST_COMMIT_MESSAGE}"
echo ""
echo -e "${COLOR_BOLD}Update by executing \"dotfiles-updater\""
echo -en "${COLOR_RESET}"
exit 0
elif [ -z "${BASHRC}" ]; then
echo -e "${COLOR_BOLD}No update available"
exit 1
fi
else
if [ -n "${UPDATE}" ]; then
echo "${LATEST_COMMIT_MESSAGE}"
fi
if [ -n "${UPDATE}" ]; then
echo "${LATEST_COMMIT_MESSAGE}"
fi
fi

View file

@ -1,57 +1,57 @@
#!/bin/bash
cd "${HOME}/.dotfiles" || (
echo ":: Error: Can't cd into ${HOME}/.dotfiles"
exit 1
echo ":: Error: Can't cd into ${HOME}/.dotfiles"
exit 1
)
# Define updater version
LOCAL_UPDATER_VERSION=4
case "${STAGE}" in
1)
# 0 - 2 -> 3
if [ -z "${UPDATER_VERSION}" ] || [ "${UPDATER_VERSION}" -lt "3" ]; then
echo ":: S1 | Updating to UPDATER_VERSION 3"
./uninstall.sh --remove-legacy-paths
fi
# 3 -> 4
if [ "${UPDATER_VERSION}" -lt "4" ]; then
echo ":: S1 | Updating to UPDATER_VERSION 4"
./uninstall.sh --remove-unshared-bashrcd
fi
echo ":: S1 | Uninstalling"
./uninstall.sh
echo ":: S1 | Installing"
./install.sh
# Remove legacy updater version file
[[ -f "${HOME}/.config/.jstm_dotfiles_updater" ]] && rm -rf "${HOME}/.config/.jstm_dotfiles_updater"
echo ":: S1 | Update complete."
echo " Make sure to execute \"dotfiles-install-software\""
echo " to install/update required software."
echo " Append \"--gui\" to install required GUI stuff."
;;
*)
echo ":: Checking for updates"
if [ ! "${1}" == "--force" ] && [ "$(env SCRIPTED=true dotfiles-updatechecker)" == "" ]; then
echo ":: No update is available. Use \"--force\" to update anyway."
exit 1
fi
echo ":: S0 | Uninstalling"
./uninstall.sh
echo ":: S0 | Pulling updates"
git pull
exec env STAGE=1 UPDATER_VERSION=${LOCAL_UPDATER_VERSION} "${HOME}/.dotfiles/bin/updater"
;;
1)
# 0 - 2 -> 3
if [ -z "${UPDATER_VERSION}" ] || [ "${UPDATER_VERSION}" -lt "3" ]; then
echo ":: S1 | Updating to UPDATER_VERSION 3"
./uninstall.sh --remove-legacy-paths
fi
# 3 -> 4
if [ "${UPDATER_VERSION}" -lt "4" ]; then
echo ":: S1 | Updating to UPDATER_VERSION 4"
./uninstall.sh --remove-unshared-bashrcd
fi
echo ":: S1 | Uninstalling"
./uninstall.sh
echo ":: S1 | Installing"
./install.sh
# Remove legacy updater version file
[[ -f "${HOME}/.config/.jstm_dotfiles_updater" ]] && rm -rf "${HOME}/.config/.jstm_dotfiles_updater"
echo ":: S1 | Update complete."
echo " Make sure to execute \"dotfiles-install-software\""
echo " to install/update required software."
echo " Append \"--gui\" to install required GUI stuff."
;;
*)
echo ":: Checking for updates"
if [ ! "${1}" == "--force" ] && [ "$(env SCRIPTED=true dotfiles-updatechecker)" == "" ]; then
echo ":: No update is available. Use \"--force\" to update anyway."
exit 1
fi
echo ":: S0 | Uninstalling"
./uninstall.sh
echo ":: S0 | Pulling updates"
git pull
exec env STAGE=1 UPDATER_VERSION=${LOCAL_UPDATER_VERSION} "${HOME}/.dotfiles/bin/updater"
;;
esac

View file

@ -7,15 +7,16 @@ general {
# Lock screen
listener {
timeout = 600
on-timeout = loginctl lock-session
timeout = 600
on-timeout = loginctl lock-session
}
# Turn on/off monitor
listener {
timeout = 600
on-timeout = hyprctl dispatch dpms off
on-resume = hyprctl dispatch dpms on
timeout = 600
on-timeout = hyprctl dispatch dpms off
on-resume = hyprctl dispatch dpms on
}
# Welcome back message
listener {

View file

@ -1,4 +1,5 @@
#!/bin/bash
# The only reason this script exists is because
# Hyprland, jobrunner, idk does not support piping.
cliphist list | launch-menu | cliphist decode | wl-copy

View file

@ -1,6 +1,6 @@
#!/bin/bash
if [ "$(hyprctl activewindow -j | jq -r ".class")" = "Steam" ]; then
xdotool getactivewindow windowunmap
xdotool getactivewindow windowunmap
else
hyprctl dispatch killactive ""
hyprctl dispatch killactive ""
fi

View file

@ -1,3 +1,3 @@
screencopy {
max_fps = 120
max_fps = 120
}

View file

@ -2,37 +2,37 @@
# jeremystartm's dotfiles "installer"
if [ ! -f "$HOME/.config/.jstm_dotfiles" ]; then
echo ":: Removing files"
./uninstall.sh &> /dev/null
echo ":: Removing files"
./uninstall.sh &> /dev/null
fi
# utility function
function link() {
if [ -a "${HOME}/${2}" ]; then
[[ -n "$VERBOSE_WARNING" ]] && echo ":: Warning: ${2} already exists."
else
echo ":: Linking ${1} -> ${2}"
ln -s "$(pwd)/${1}" "${HOME}/${2}"
fi
if [ -a "${HOME}/${2}" ]; then
[[ -n "$VERBOSE_WARNING" ]] && echo ":: Warning: ${2} already exists."
else
echo ":: Linking ${1} -> ${2}"
ln -s "$(pwd)/${1}" "${HOME}/${2}"
fi
}
# update/clone repositories
[[ ! -d "repositories/punktdateien-bashrc" ]] && git clone "https://git.staropensource.de/JeremyStarTM/punktdateien-bashrc.git" repositories/punktdateien-bashrc
(
cd repositories/punktdateien-bashrc || (
echo ":: Error: Can't cd into repositories/punktdateien-bashrc"
exit 1
)
git pull
cd repositories/punktdateien-bashrc || (
echo ":: Error: Can't cd into repositories/punktdateien-bashrc"
exit 1
)
git pull
)
[[ ! -d "repositories/dracula-mc" ]] && git clone "https://github.com/dracula/midnight-commander.git" repositories/dracula-mc
(
cd repositories/dracula-mc || (
echo ":: Error: Can't cd into repositories/dracula-mc"
exit 1
)
git pull
cd repositories/dracula-mc || (
echo ":: Error: Can't cd into repositories/dracula-mc"
exit 1
)
git pull
)
# create directories
@ -100,14 +100,3 @@ link "bin/updater" ".local/bin/dotfiles-updater"
# write install file
echo "pls don't remove" > "$HOME/.config/.jstm_dotfiles"
# check for executables
if ! which qt5ct &> /dev/null; then
echo ":: Warning: qt5ct is not in your PATH."
fi
if ! which qt6ct &> /dev/null; then
echo ":: Warning: qt6ct is not in your PATH."
fi
if ! which nwg-look &> /dev/null; then
echo ":: Warning: nwg-look is not in your PATH."
fi

View file

@ -5,10 +5,10 @@ FORCED_UNLINKING=
# utility function
function unlink() {
if [ -a "${HOME}/${*}" ] || [ -n "${FORCED_UNLINKING}" ]; then
echo ":: Unlinking ${1}"
rm -rf "${HOME:?}/${*:?}"
fi
if [ -a "${HOME}/${*}" ] || [ -n "${FORCED_UNLINKING}" ]; then
echo ":: Unlinking ${1}"
rm -rf "${HOME:?}/${*:?}"
fi
}
# repositories
@ -18,80 +18,82 @@ function unlink() {
[[ -n "$REMOVE_INSTALLBIT" ]] && rm -rf "$HOME/.config/.jstm_dotfiles"
for arg in "${@}"; do
case "${arg}" in
"--remove-legacy-paths")
echo ":: Unlinking legacy paths"
declare -a legacypaths=(
".local/bin/jobrunner"
".local/bin/jobrunner-runjob"
".jstmbash"
".config/jstmbash.env"
".config/starship.toml"
".bashrc"
".config/hypr"
".config/waybar"
".config/fnott"
".config/eww"
".config/xdg-desktop-portal/hyprland-portals.conf"
".config/neofetch"
".config/btop"
".local/share/mc"
".config/mc"
".config/mpv"
".config/GIMP/2.10/splashes"
".config/gitui"
".local/share/mc/skins/dracula.ini"
".local/share/mc/skins/dracula256.ini"
".config/nwg-look"
".config/qt5ct"
".config/qt6ct"
".config/Kvantum"
".icons"
".local/share/icons"
".fonts"
".config/fontconfig"
".local/share/wallpapers"
".local/share/plasma"
".config/kdedefaults"
".local/share/color-schemes"
".local/share/aurorae"
".config/kglobalshortcutsrc"
".config/kiorc"
".config/krunnerrc"
".config/kservicemenurc"
".config/ksplashrc"
".config/ktimezonedrc"
".config/plasma-localrc"
".config/plasma-org.kde.plasma.desktop-appletsrc"
".config/konsolerc"
".local/share/konsole"
".config/dolphinrc"
".local/bin/dotfiles-updatechecker"
".local/bin/dotfiles-updater"
".local/bin/dotfiles-install-software"
".local/bin/launch-menu"
".config/copyq"
)
for path in "${legacypaths[@]}"; do
FORCED_UNLINKING=y unlink "${path}"
done
rm -rf "jstmbash" "dracula-mc"
echo ":: Unlinked legacy paths"
exit 0
;;
"--remove-unshared-bashrcd")
echo ":: Removing unshared bashrc.d"
FORCED_UNLINKING=y unlink ".bashrc.d"
exit 0
;;
*)
echo ":: Warning: Unknown argument \"${arg}\""
;;
esac
case "${arg}" in
"--remove-legacy-paths")
echo ":: Unlinking legacy paths"
declare -a legacypaths=(
".local/bin/jobrunner"
".local/bin/jobrunner-runjob"
".jstmbash"
".config/jstmbash.env"
".config/starship.toml"
".bashrc"
".config/hypr"
".config/waybar"
".config/fnott"
".config/eww"
".config/xdg-desktop-portal/hyprland-portals.conf"
".config/neofetch"
".config/btop"
".local/share/mc"
".config/mc"
".config/mpv"
".config/GIMP/2.10/splashes"
".config/gitui"
".local/share/mc/skins/dracula.ini"
".local/share/mc/skins/dracula256.ini"
".config/nwg-look"
".config/qt5ct"
".config/qt6ct"
".config/Kvantum"
".icons"
".local/share/icons"
".fonts"
".config/fontconfig"
".local/share/wallpapers"
".local/share/plasma"
".config/kdedefaults"
".local/share/color-schemes"
".local/share/aurorae"
".config/kglobalshortcutsrc"
".config/kiorc"
".config/krunnerrc"
".config/kservicemenurc"
".config/ksplashrc"
".config/ktimezonedrc"
".config/plasma-localrc"
".config/plasma-org.kde.plasma.desktop-appletsrc"
".config/konsolerc"
".local/share/konsole"
".config/dolphinrc"
".local/bin/dotfiles-updatechecker"
".local/bin/dotfiles-updater"
".local/bin/dotfiles-install-software"
".local/bin/launch-menu"
".config/copyq"
)
for path in "${legacypaths[@]}"; do
FORCED_UNLINKING=y unlink "${path}"
done
rm -rf "jstmbash" "dracula-mc"
echo ":: Unlinked legacy paths"
exit 0
;;
"--remove-unshared-bashrcd")
echo ":: Removing unshared bashrc.d"
FORCED_UNLINKING=y unlink ".bashrc.d"
exit 0
;;
*)
echo ":: Warning: Unknown argument \"${arg}\""
;;
esac
done
# repositories