From dfe3abc0147642565cc80f5d44bdaf455d0ba206 Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Mon, 29 Jan 2018 16:10:37 +0100 Subject: [PATCH] inital --- aliases.zsh | 22 ++++++++++++++++++++++ browser.zsh | 4 ++++ systemd.zsh | 19 +++++++++++++++++++ zinit.zsh | 6 ++++++ 4 files changed, 51 insertions(+) create mode 100644 aliases.zsh create mode 100644 browser.zsh create mode 100644 systemd.zsh create mode 100644 zinit.zsh diff --git a/aliases.zsh b/aliases.zsh new file mode 100644 index 0000000..ae5ee95 --- /dev/null +++ b/aliases.zsh @@ -0,0 +1,22 @@ +alias cdiff="colordiff" +alias clean-gpg="for a in `gpg2 -k | sed -rn 's/pub +[a-z0-9]+\/(0x[0-9A-Fa-f]+).*/\1/p'`; do gpg2 --quiet --no-tty --edit-key $a clean save; done;" +alias diff="diff -W $(( $(tput cols) - 2))" + +alias bz2c='bzip2 --best' +alias gzc='gzip --best --no-name' +alias xzc='xz --best --extreme' +alias extip='curl -LR1fs --compressed https://ipinfo.io/ | jq -Sc' +alias jjar='java -jar' + +current_dist=`lsb_release -c -s` +all_dkms_packages="`apt-cache rdepends --installed dkms | sed -rn 's/^ +([^ ]+)$/\1/p' | sort -iu`" + +if [ $use_sudo -eq 1 ]; +then + alias adbu='sudo $apt_pref -t ${current_dist}-backports $apt_upgr' + alias drd='[ -n "$all_dkms_packages" ] && sudo dpkg-reconfigure $all_dkms_packages' +else + alias adbu='su -lc "$apt_pref -t ${current_dist}-backports $apt_upgr" root' + alias drd='[ -n "$all_dkms_packages" ] && su -lc "dpkg-reconfigure $all_dkms_packages" root' +fi + diff --git a/browser.zsh b/browser.zsh new file mode 100644 index 0000000..baef6d5 --- /dev/null +++ b/browser.zsh @@ -0,0 +1,4 @@ +function duckduck() { x-www-browser "https://duckduckgo.com/?q=`escape "$@"`"; } +function escape() { perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$@"; } +function google() { x-www-browser "https://www.google.de/search?q=`escape "$@"`"; } + diff --git a/systemd.zsh b/systemd.zsh new file mode 100644 index 0000000..c98ed9c --- /dev/null +++ b/systemd.zsh @@ -0,0 +1,19 @@ +user_commands=( + list-units is-active status show help list-unit-files + is-enabled list-jobs show-environment cat list-timers + is-system-running default rescue halt poweroff reboot + emergency kexec exit suspend hibernate hybrid-sleep) + +sudo_commands=( + start stop reload restart try-restart isolate kill + reset-failed enable disable reenable preset mask unmask + link load cancel set-environment unset-environment + edit) + +for c in $user_commands; do; alias sc-$c="systemctl $c"; done +for c in $sudo_commands; do; alias sc-$c="sudo systemctl $c"; done + +alias sc-enable-now="sc-enable --now" +alias sc-disable-now="sc-disable --now" +alias sc-mask-now="sc-mask --now" + diff --git a/zinit.zsh b/zinit.zsh new file mode 100644 index 0000000..23a1330 --- /dev/null +++ b/zinit.zsh @@ -0,0 +1,6 @@ +[ -z "$EDITOR" ] && export EDITOR=sensible-editor + +export MAILCHECK=1 + +fortune debian house-harkonnen house-atreides | cowsay -f tux -W 76 -n +which todo > /dev/null && todo due