From 70a565df77c2c9c09da2b4c6c79a555214593a3e Mon Sep 17 00:00:00 2001 From: faulty Date: Fri, 16 Dec 2022 14:35:54 +0100 Subject: [PATCH] add: zsh files --- .gitignore | 1 + files/%HOME/.zsh_preferences | 2 ++ files/%HOME/.zsh_scripts | 47 ++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 .gitignore create mode 100644 files/%HOME/.zsh_preferences create mode 100644 files/%HOME/.zsh_scripts diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..62c8935 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ \ No newline at end of file diff --git a/files/%HOME/.zsh_preferences b/files/%HOME/.zsh_preferences new file mode 100644 index 0000000..2677a0e --- /dev/null +++ b/files/%HOME/.zsh_preferences @@ -0,0 +1,2 @@ +_ZSH_PREF_NO_PFETCH=0 +_ZSH_PREF_NO_NONSENSE=0 \ No newline at end of file diff --git a/files/%HOME/.zsh_scripts b/files/%HOME/.zsh_scripts new file mode 100644 index 0000000..4004d8f --- /dev/null +++ b/files/%HOME/.zsh_scripts @@ -0,0 +1,47 @@ +__is_arch() { + . /etc/os-release + if [ "$ID" = "arch" ]; then return 0; else return 1; fi +} + +pkg_once() { + if [ ! __is_arch ]; then + printf "This command is only for Arch Linux.\n" + return + fi + if [ ! -n "$1" ]; then + printf "Usage: pkg_once [command]\n" + printf "command is optional; if there is no command the package name is ran\n" + return + fi + printf "Installing $1...\n" + yay -S --noconfirm $1 > /dev/null + + if [ ! -n "$2" ]; then $1; else $2; fi + printf "Remoiving $1..." + yay -R --noconfirm $1 > /dev/null + echo "done.\n" +} + +rando () { + case $1 in + *|d|default) tr -dc A-Za-z0-9 ?@[\]^_`{|}~' > $file + fi + chmod +x $file + printf '%s' $file +} \ No newline at end of file