From ac5118f1171ea0a8dae26199cdae6db90f2cf15c Mon Sep 17 00:00:00 2001 From: the_4n0nym0u53 Date: Sat, 22 Jan 2022 15:06:48 +0100 Subject: [PATCH] Adjust some things and create functions.zsh --- artix-install.sh | 11 ++++++----- fedora-install.sh | 6 +++--- zsh/.config/zsh/.zlogout | 4 ++-- zsh/.config/zsh/.zprofile | 8 ++++---- zsh/.config/zsh/aliases.zsh | 3 +-- zsh/.config/zsh/functions.zsh | 12 ++++++++++++ zsh/.config/zsh/gpg.zsh | 2 +- 7 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 zsh/.config/zsh/functions.zsh diff --git a/artix-install.sh b/artix-install.sh index eb7ef87..589f296 100755 --- a/artix-install.sh +++ b/artix-install.sh @@ -6,13 +6,14 @@ if [ "$(lsb_release -si)" != "Artix" ]; then fi echo "Configuring directories..." -cd -- "$(dirname -- $0)" -mkdir -p "$HOME/.config/zsh" # Symlink only the individual files instead of the entire directory -sleep 0.5 +cd -- "$(dirname -- $0)" +set -- "alacritty" "mako" "nvim" "scripts" "sway" "swaylock" "swaynag" "waybar" "zsh" +mkdir -p "$HOME/.config/zsh" # Symlink only the individual files instead of the entire directory + +sleep 0.5 echo "Creating the symlinks with stow..." -set -- "alacritty" "mako" "nvim" "scripts" "sway" "swaylock" "swaynag" "waybar" "zsh" for pkg in "$@"; do echo "* Stowing $pkg" stow -t "$HOME" --ignore="README.md" "$pkg" @@ -29,6 +30,6 @@ chmod +x sway/.config/sway/autostart.sh chmod +x waybar/.config/waybar/ivpn-reconnect.sh chmod +x waybar/.config/waybar/ivpn-status.sh chmod +x waybar/.config/waybar/mediaplayer.py -sleep 0.5 +sleep 0.5 echo "Done!" diff --git a/fedora-install.sh b/fedora-install.sh index 106cf0a..5b942e9 100755 --- a/fedora-install.sh +++ b/fedora-install.sh @@ -8,12 +8,12 @@ fi echo "Configuring directories..." cd -- "$(dirname -- $0)" +set -- "nvim" "scripts" "zsh" mkdir -p "$HOME/.config/zsh" # Symlink only the individual files instead of the entire directory -sleep 0.5 +sleep 0.5 echo "Creating the symlinks with stow..." -set -- "nvim" "scripts" "zsh" for pkg in "$@"; do echo "* Stowing $pkg" stow -t "$HOME" --ignore="README.md" "$pkg" @@ -26,6 +26,6 @@ echo "Making scripts executable..." chmod +x scripts/.local/bin/clear-clipboard.sh chmod +x scripts/.local/bin/update.sh chmod +x scripts/.local/bin/vfio.sh -sleep 0.5 +sleep 0.5 echo "Done!" diff --git a/zsh/.config/zsh/.zlogout b/zsh/.config/zsh/.zlogout index 20dbefe..7b3f923 100644 --- a/zsh/.config/zsh/.zlogout +++ b/zsh/.config/zsh/.zlogout @@ -8,6 +8,6 @@ function kill_services { pkill "^pipewire$" } -[[ $(tty) == /dev/tty1 ]] && [[ $(lsb_release -si) == Artix ]] && - kill_services &> /dev/null +[[ $(tty) == "/dev/tty1" ]] && [[ $(lsb_release -si) == "Artix" ]] && + kill_services >/dev/null unfunction kill_services diff --git a/zsh/.config/zsh/.zprofile b/zsh/.config/zsh/.zprofile index 40c7848..c3f5761 100644 --- a/zsh/.config/zsh/.zprofile +++ b/zsh/.config/zsh/.zprofile @@ -1,8 +1,8 @@ -if [[ $(tty) == /dev/tty1 ]] && [[ $(lsb_release -si) == Artix ]]; then +if [[ $(tty) == "/dev/tty1" ]] && [[ $(lsb_release -si) == "Artix" ]]; then export $(gnome-keyring-daemon --start) - export XDG_CURRENT_DESKTOP=Unity + export XDG_CURRENT_DESKTOP="Unity" export GTK_USE_PORTAL=1 - export QT_QPA_PLATFORM=wayland + export QT_QPA_PLATFORM="wayland" - dbus-launch --sh-syntax --exit-with-session sway &> /dev/null; exit + dbus-launch --sh-syntax --exit-with-session sway &>/dev/null; exit fi diff --git a/zsh/.config/zsh/aliases.zsh b/zsh/.config/zsh/aliases.zsh index 88fe66b..800089c 100644 --- a/zsh/.config/zsh/aliases.zsh +++ b/zsh/.config/zsh/aliases.zsh @@ -19,9 +19,8 @@ alias u="update.sh" alias wl-copy="wl-copy -n" alias zgrep="zgrep --color=always" -if [[ $(lsb_release -si) == Artix ]]; then +if [[ $(lsb_release -si) == "Artix" ]]; then alias code="codium --enable-features=UseOzonePlatform --ozone-platform=wayland" - alias doasedit="doas -L; doas sh -c '$EDITOR /etc/doas.conf; doas -C /etc/doas.conf && echo ok || echo error'; doas -L" alias poweroff="doas poweroff" alias reboot="doas reboot" fi diff --git a/zsh/.config/zsh/functions.zsh b/zsh/.config/zsh/functions.zsh new file mode 100644 index 0000000..21edb50 --- /dev/null +++ b/zsh/.config/zsh/functions.zsh @@ -0,0 +1,12 @@ +function pz_upgrade { + pz zcompile -c >/dev/null + pz pull + pz zcompile >/dev/null +} + +(( ${+commands[doas]} )) && function doasedit { + doas -L + doas $EDITOR /etc/doas.conf + doas doas -C /etc/doas.conf && echo "ok" || echo "error" + doas -L +} diff --git a/zsh/.config/zsh/gpg.zsh b/zsh/.config/zsh/gpg.zsh index b89766a..22b27a4 100644 --- a/zsh/.config/zsh/gpg.zsh +++ b/zsh/.config/zsh/gpg.zsh @@ -2,4 +2,4 @@ export GPG_TTY=$TTY export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) gpgconf --launch gpg-agent -gpg-connect-agent updatestartuptty /bye &> /dev/null +gpg-connect-agent updatestartuptty /bye &>/dev/null