Adjust some things and create functions.zsh

This commit is contained in:
the_4n0nym0u53 2022-01-22 15:06:48 +01:00
parent 0326a5dc92
commit ac5118f117
No known key found for this signature in database
GPG Key ID: 35EE09F5481049BB
7 changed files with 29 additions and 17 deletions

View File

@ -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!"

View File

@ -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!"

View File

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

View File

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

View File

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

View File

@ -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
}

View File

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