From bfb18091b2a0099c059f26efce9937cf22073962 Mon Sep 17 00:00:00 2001 From: ColumbusUtrigas Date: Wed, 10 Aug 2022 23:50:50 +0400 Subject: [PATCH] refactored zshrc and picom fix --- .xinitrc | 5 ++ .zshrc | 123 +++++++++++++++++++++++++++++++++++++++++++++ columbus.zsh-theme | 6 --- picom.conf | 2 +- 4 files changed, 129 insertions(+), 7 deletions(-) create mode 100644 .zshrc delete mode 100644 columbus.zsh-theme diff --git a/.xinitrc b/.xinitrc index 8b661bf..e25c533 100644 --- a/.xinitrc +++ b/.xinitrc @@ -1,5 +1,10 @@ killall dwmblocks xrandr xrdb ~/.Xresources +xrandr --setprovideroutputsource modesetting NVIDIA-0 +xrandr --auto picom --experimental-backends & +/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & +/usr/bin/prime-offload exec dbus-launch dwm +sudo /usr/bun/prime-switch diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..7a587dc --- /dev/null +++ b/.zshrc @@ -0,0 +1,123 @@ +# default programs +export EDITOR="vim" +export TERMINAL="alacritty" +export BROWSER="firefox" + +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CACHE_HOME="$HOME/.cache" + +export PATH=$PATH:~/.local/bin:~/.local/bin/statusbar +export MOZ_USE_XINPUT2=1 + +GPG_TTY=$(tty) +export GPG_TTY + +HISTFILE="$XDG_CACHE_HOME/zsh/history" +HISTSIZE=50000 +SAVEHIST=10000 + +#### ALIASES #### +alias diff='diff --color' +alias ls='ls --color=tty' +alias lsa='ls -lah' +alias l='ls -lah' +alias ll='ls -lh' +alias la='ls -lAh' +alias md='mkdir -p' +alias rd=rmdir + +alias -g ...='../..' +alias -g ....='../../..' +alias -g .....='../../../..' +alias -g ......='../../../../..' + +alias -- -='cd -' +alias 1='cd 1' +alias 2='cd -2' +alias 3='cd -3' +alias 4='cd -4' +alias 5='cd -5' +alias 6='cd -6' +alias 7='cd -7' +alias 8='cd -8' +alias 9='cd -9' +############################# + +#### BINDINGS #### +#source 'key-bindings.zsh' +autoload -Uz up-line-or-beginning-search +autoload -Uz down-line-or-beginning-search +autoload -Uz edit-command-line +zle -N up-line-or-beginning-search +zle -N down-line-or-beginning-search +zle -N edit-command-line + +bindkey '^?' backward-delete-char # bs delete one char backward +bindkey '^[[3~' delete-char # delete delete one char forward +bindkey '^[[H' beginning-of-line # home go to the beginning of line +bindkey '^[[F' end-of-line # end go to the end of line +bindkey '^[[1;5C' forward-word # ctrl+right go forward one word +bindkey '^[[1;5D' backward-word # ctrl+left go backward one word +bindkey '^H' backward-kill-word # ctrl+bs delete previous word +bindkey '^[[3;5~' kill-word # ctrl+del delete next word +bindkey '^J' backward-kill-line # ctrl+j delete everything before cursor +bindkey '^[[D' backward-char # left move cursor one char backward +bindkey '^[[C' forward-char # right move cursor one char forward +bindkey '^[[A' up-line-or-beginning-search # up prev command in history (fuzzy) +bindkey '^[[B' down-line-or-beginning-search # down next command in history (fuzzy) +bindkey '^[[5~' up-line-or-history # pgup prev command in history +bindkey '^[[6~' down-line-or-history # pgdown next command in history +bindkey '^[[Z' reverse-menu-complete # shift+tab move through completion menu backwards +bindkey "^X^E" edit-command-line # ctrl+x+e open current command in $EDITOR + +############################# + +autoload -U compinit +zstyle ':completion:*' menu select +zmodload zsh/complist +compinit +_comp_options+=(globdots) + +autoload -Uz colors && colors +export LSCOLORS="Gxfxcxdxbxegedabagacad" +zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" + +setopt auto_pushd +setopt pushd_ignore_dups +setopt pushdminus + +setopt auto_cd +setopt multios +setopt prompt_subst + +setopt long_list_jobs +setopt interactivecomments + + +#### GIT PROMPT #### +function git_prompt_info() { + !git rev-parse --git-dir &> /dev/null && return 0 + local ref + + ref=$(git symbolic-ref --short HEAD 2> /dev/null) \ + || ref=$(git rev-parse --short HEAD 2> /dev/null) \ + || return 0 + + echo "${ZSH_GIT_PREFIX}${ref:gs/%/%%}$(parse_git_dirty)${ZSH_GIT_SUFFIX}" +} + +function parse_git_dirty() { + if [[ -n $(git status --porcelain 2> /dev/null | tail -n 1) ]]; then + echo "*" + else + echo "" + fi +} +############################# + +#### THEME #### +PROMPT='%{$fg_bold[green]%}%n@%m:%{$fg_bold[blue]%}%2~ $(git_prompt_info)%{$reset_color%}%(!.#.$) ' +ZSH_GIT_PREFIX="%{$fg[red]%}‹" +ZSH_GIT_SUFFIX="›%{$reset_color%}" +############################# diff --git a/columbus.zsh-theme b/columbus.zsh-theme deleted file mode 100644 index 3d32367..0000000 --- a/columbus.zsh-theme +++ /dev/null @@ -1,6 +0,0 @@ -# -*- sh -*- vim:set ft=sh ai et sw=4 sts=4: -# It might be bash like, but I can't have my co-workers knowing I use zsh -PROMPT='%{$fg_bold[green]%}%n@%m:%{$fg_bold[blue]%}%2~ $(git_prompt_info)%{$reset_color%}%(!.#.$) ' - -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="›%{$reset_color%}" diff --git a/picom.conf b/picom.conf index 3249a59..5eac06c 100644 --- a/picom.conf +++ b/picom.conf @@ -198,7 +198,7 @@ blur-background-frame = true # Exclude conditions for background blur. # blur-background-exclude = [] blur-background-exclude = [ - "window_type = 'dock'", + #"window_type = 'dock'", "window_type = 'desktop'", "class_g = 'firefox' && argb", "name *= 'Telegram'",