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 fi
echo "Configuring directories..." 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..." echo "Creating the symlinks with stow..."
set -- "alacritty" "mako" "nvim" "scripts" "sway" "swaylock" "swaynag" "waybar" "zsh"
for pkg in "$@"; do for pkg in "$@"; do
echo "* Stowing $pkg" echo "* Stowing $pkg"
stow -t "$HOME" --ignore="README.md" "$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-reconnect.sh
chmod +x waybar/.config/waybar/ivpn-status.sh chmod +x waybar/.config/waybar/ivpn-status.sh
chmod +x waybar/.config/waybar/mediaplayer.py chmod +x waybar/.config/waybar/mediaplayer.py
sleep 0.5
sleep 0.5
echo "Done!" echo "Done!"

View file

@ -8,12 +8,12 @@ fi
echo "Configuring directories..." echo "Configuring directories..."
cd -- "$(dirname -- $0)" cd -- "$(dirname -- $0)"
set -- "nvim" "scripts" "zsh"
mkdir -p "$HOME/.config/zsh" # Symlink only the individual files instead of the entire directory 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..." echo "Creating the symlinks with stow..."
set -- "nvim" "scripts" "zsh"
for pkg in "$@"; do for pkg in "$@"; do
echo "* Stowing $pkg" echo "* Stowing $pkg"
stow -t "$HOME" --ignore="README.md" "$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/clear-clipboard.sh
chmod +x scripts/.local/bin/update.sh chmod +x scripts/.local/bin/update.sh
chmod +x scripts/.local/bin/vfio.sh chmod +x scripts/.local/bin/vfio.sh
sleep 0.5
sleep 0.5
echo "Done!" echo "Done!"

View file

@ -8,6 +8,6 @@ function kill_services {
pkill "^pipewire$" pkill "^pipewire$"
} }
[[ $(tty) == /dev/tty1 ]] && [[ $(lsb_release -si) == Artix ]] && [[ $(tty) == "/dev/tty1" ]] && [[ $(lsb_release -si) == "Artix" ]] &&
kill_services &> /dev/null kill_services >/dev/null
unfunction kill_services 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 $(gnome-keyring-daemon --start)
export XDG_CURRENT_DESKTOP=Unity export XDG_CURRENT_DESKTOP="Unity"
export GTK_USE_PORTAL=1 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 fi

View file

@ -19,9 +19,8 @@ alias u="update.sh"
alias wl-copy="wl-copy -n" alias wl-copy="wl-copy -n"
alias zgrep="zgrep --color=always" 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 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 poweroff="doas poweroff"
alias reboot="doas reboot" alias reboot="doas reboot"
fi 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
}