Update templates from os to distro_id

This commit is contained in:
Marko Korhonen 2022-09-20 18:04:16 +03:00
parent f616bcb60e
commit b61e35da16
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890
3 changed files with 14 additions and 14 deletions

View file

@ -61,12 +61,12 @@ export MANPAGER="$EDITOR +\"lua require 'pager'\" +Man!"
export SYSTEMD_EDITOR=$EDITOR
export SYSTEMD_PAGER=less
{%@@ if os == "arch" or os == "ubuntu" @@%}
{%@@ if distro_id == "arch" or distro_id == "ubuntu" @@%}
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi
gpgconf --launch gpg-agent
{%@@ elif os == "termux" @@%}
{%@@ elif distro_id == "termux" @@%}
eval $(okc-ssh-agent)
{%@@ endif @@%}

View file

@ -39,10 +39,10 @@ zinit ice lucid atinit'zpcompinit'
zinit light zdharma-continuum/fast-syntax-highlighting
# use fzf with zsh
{%@@ if os == "arch" @@%}
{%@@ if distro_id == "arch" @@%}
source /usr/share/fzf/key-bindings.zsh
source /usr/share/fzf/completion.zsh
{%@@ elif os == "ubuntu" @@%}
{%@@ elif distro_id == "ubuntu" @@%}
# Source from home directory since ubuntu has
# old version of FZF in it's repositories
source ~/Software/fzf/shell/key-bindings.zsh

View file

@ -13,19 +13,19 @@ forgit_revert_commit=fgrc
alias ls='exa'
# Enable command not found handler
{%@@ if os == "arch" @@%}
{%@@ if distro_id == "arch" @@%}
source /usr/share/doc/pkgfile/command-not-found.zsh
{%@@ elif os == "ubuntu" @@%}
{%@@ elif distro_id == "ubuntu" @@%}
source /etc/zsh_command_not_found
{%@@ elif os == "termux" @@%}
{%@@ elif distro_id == "termux" @@%}
function command_not_found_handler {
$PREFIX/libexec/termux/command-not-found $1
}
{%@@ endif @@%}
{%@@ if os == "arch" @@%}
{%@@ if distro_id == "arch" @@%}
# search and install/remove packages with fzf
pi() {
pi() {
SELECTED_PKGS="$(paru -Slq | fzf --header='Install packages' -m --preview 'paru -Si {1}')"
if [ -n "$SELECTED_PKGS" ]; then
# Append the expanded command to history
@ -33,7 +33,7 @@ pi() {
paru -S $(echo $SELECTED_PKGS)
fi
}
pr() {
pr() {
SELECTED_PKGS="$(paru -Qsq | fzf --header='Remove packages' -m --preview 'paru -Si {1}')"
if [ -n "$SELECTED_PKGS" ]; then
# Append the expanded command to history
@ -43,7 +43,7 @@ pr() {
}
{%@@ endif @@%}
{%@@ if os == "termux" @@%}
{%@@ if distro_id == "termux" @@%}
alias gp='okc-gpg'
{%@@ endif @@%}
@ -126,11 +126,11 @@ update() {
}
packages() {
{%@@ if os == "arch" @@%}
{%@@ if distro_id == "arch" @@%}
paru
{%@@ elif os == "ubuntu" @@%}
{%@@ elif distro_id == "ubuntu" @@%}
sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt autoclean -y
{%@@ elif os == "termux" @@%}
{%@@ elif distro_id == "termux" @@%}
pkg update
{%@@ endif @@%}
}