From 39d5b9b1b0a156b020b284f28c7a6199d6740f68 Mon Sep 17 00:00:00 2001 From: Yessiest Date: Sat, 3 Sep 2022 17:16:34 +0400 Subject: [PATCH] updated config to include colors --- .zshrc | 7 +++- .zshrc.d/02-aliases.zsh | 61 ++++++++++++++++++++++++++++------- .zshrc.d/03-completion.zsh | 15 ++++++--- .zshrc.d/04-bindings.zsh | 12 +++++-- .zshrc.d/05-highlight.zsh | 10 ++++++ .zshrc.d/06-color-aliases.zsh | 2 ++ 6 files changed, 88 insertions(+), 19 deletions(-) create mode 100644 .zshrc.d/05-highlight.zsh create mode 100644 .zshrc.d/06-color-aliases.zsh diff --git a/.zshrc b/.zshrc index ce44211..a8549d2 100644 --- a/.zshrc +++ b/.zshrc @@ -10,6 +10,10 @@ case $TERM in (xterm*) TERM=xterm-256color esac +if [ -f $HOME/.profile ]; then + source $HOME/.profile +fi + # Source local zsh configs if [ -f $HOME/.zshrc_local ]; then source $HOME/.zshrc_local @@ -25,7 +29,7 @@ fi # Source color tags for hostnames if [ -f $HOME/.zsh_host_colors ]; then source $HOME/.zsh_host_colors - HOST_COLOR="${HOST_COLORS[$(hostname | tr -d '\n')]}" + HOST_COLOR="${HOST_COLORS[$(cat /etc/hostname | tr -d '\n')]}" fi # Default to none if not defined @@ -60,3 +64,4 @@ for plugin in $PLUGINS; do source $plugin fi done + diff --git a/.zshrc.d/02-aliases.zsh b/.zshrc.d/02-aliases.zsh index 0684260..7126d90 100644 --- a/.zshrc.d/02-aliases.zsh +++ b/.zshrc.d/02-aliases.zsh @@ -5,24 +5,63 @@ if [ -n "$LOCALCITY" ]; then alias weatherfetch="curl -sf https://wttr.in/$LOCALCITY | head -n 7 && echo ''" fi if [ -n "$DESKTOP_SESSION" ]; then - alias linuxver="nohup zenity --info --text=\"Linux version: \\n$(uname -srm)\" > /dev/null" + # winver is a thing, so here's linver + alias linver="nohup zenity --info --text=\"Linux version: \\n$(uname -srm)\" > /dev/null" + # tools to manipulate xclip easier alias paste="xclip -o -selection clipboard" alias copy="xclip -o | xclip -i -selection clipboard" fi +# unless you're using vim to this day, this is what most people do alias vim="nvim" function nojail() { + # specific tool for firejail to disable jailing at all PATH=`echo $PATH | sed "s/:\/usr\/local\/bin//g" | sed "s/:\/usr\/local\/sbin//g"` $@ } -if which flashplayer > /dev/null; then - function z0rde() { - local id - id="$1" - if [ "$1" == "" ]; then - id="$((1 + $RANDOM % 8000))" - fi - echo $id - flashplayer "https://z0r.de/L/z0r-de_$id.swf" - } +# Set a default music path +if [ -z "$MUSIC_PATH" ]; then + export MUSIC_PATH="$HOME/Music/" fi +# Try to be sensible about youtube-dl downloader +if ! which yt-dlp > /dev/null; then + if ! which youtube-dl > /dev/null; then + alias yt-dlp="echo Unable to execute: youtube-dl or yt-dlp not found; false " + else + # No, really. Not even an ad, it just runs faster because people keep fixing the throttling issue, which youtube-dl got stuck on. + alias yt-dlp="echo youtube-dl is heavily outdated, consider installing yt-dlp; youtube-dl " + fi +fi + +function ytdl() { + # Download and convert to audio a youtube video + if [ -z "$1" ]; then + echo "USAGE: ytdl