From 354fccbde2f2f4ef0eafe5230f5e006d2fa39ab7 Mon Sep 17 00:00:00 2001 From: histalek Date: Sat, 30 Oct 2021 11:20:10 +0200 Subject: [PATCH] zsh: Add .bin to path if it exists --- .bin/alchanger | 43 +++++++++++++++++++++++++++++++++++++++++++ .zshrc | 21 +++++++++------------ 2 files changed, 52 insertions(+), 12 deletions(-) create mode 100755 .bin/alchanger diff --git a/.bin/alchanger b/.bin/alchanger new file mode 100755 index 0000000..7cc187b --- /dev/null +++ b/.bin/alchanger @@ -0,0 +1,43 @@ +#!/bin/bash + +## slightly modified version of https://github.com/mtwb47/scripts/blob/master/alchanger.sh + +config="$HOME/.config/alacritty/colors.yml" + +declare -a options=( +"doom-one" +"dracula" +"gruvbox-dark" +"monokai-pro" +"nord" +"oceanic-next" +"solarized-light" +"solarized-dark" +"tomorrow-night" +"quit" +) + +choice=$(printf '%s\n' "${options[@]}" | rofi -dmenu -i -l 20 -p 'Themes') + +if [[ "$choice" == quit ]]; then + echo "No Theme Chosen" && exit 1 +elif [[ "$choice" == 'doom-one' ]]; then + sed -i '/^colors:/c\colors: *doom-one' $config +elif [[ "$choice" == 'dracula' ]]; then + sed -i '/^colors:/c\colors: *dracula' $config +elif [[ "$choice" == 'gruvbox-dark' ]]; then + sed -i '/^colors:/c\colors: *gruvbox-dark' $config +elif [[ "$choice" == 'monokai-pro' ]]; then + sed -i '/^colors:/c\colors: *monokai-pro' $config +elif [[ "$choice" == 'nord' ]]; then + sed -i '/^colors:/c\colors: *nord' $config +elif [[ "$choice" == 'oceanic-next' ]]; then + sed -i '/^colors:/c\colors: *oceanic-next' $config +elif [[ "$choice" == 'solarized-light' ]]; then + sed -i '/^colors:/c\colors: *solarized-light' $config +elif [[ "$choice" == 'solarized-dark' ]]; then + sed -i '/^colors:/c\colors: *solarized-dark' $config +elif [[ "$choice" == 'tomorrow-night' ]]; then + sed -i '/^colors:/c\colors: *tomorrow-night' $config +fi + diff --git a/.zshrc b/.zshrc index b32f28a..8f77e9b 100644 --- a/.zshrc +++ b/.zshrc @@ -20,13 +20,9 @@ POWERLEVEL9K_CONFIG_FILE="$HOME/.config/p10k/config.zsh" # Uncomment the following line if pasting URLs and other text is messed up. # DISABLE_MAGIC_FUNCTIONS=true -# Uncomment the following line to display red dots whilst waiting for completion. COMPLETION_WAITING_DOTS="true" -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" +DISABLE_UNTRACKED_FILES_DIRTY="true" HIST_STAMPS="dd.mm.yyyy" @@ -46,27 +42,28 @@ plugins=( source $ZSH/oh-my-zsh.sh -# User configuration +### User configuration + +### PATH +if [ -d "$HOME/.bin" ] ; + then PATH="$HOME/.bin:$PATH" +fi # You may need to manually set your language environment # export LANG=en_US.UTF-8 - export EDITOR=/usr/bin/nvim export VISUAL=/usr/bin/nvim export HISTORY_IGNORE="(ls|cd|pwd|exit|history|cd -|cd ..)" export MANPAGER="sh -c 'col -bx | bat -l man -p'" - -setopt completealiases - ### Start Wayland specific stuff - export MOZ_ENABLE_WAYLAND=1 ##! Use the following launch options for Steam Games which crash with this. ##> 'SDL_VIDEODRIVER=x11 %command%' export SDL_VIDEODRIVER='wayland' - ### End Wayland specific stuff +setopt completealiases + prompt_context(){} # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.