Restructured, cleaned up colors.

This commit is contained in:
Joachim Nielandt 2020-07-14 15:18:50 +02:00
parent 5585d4de76
commit 1ff60bdaa6
196 changed files with 179 additions and 4882 deletions

View File

@ -1,44 +0,0 @@
GRUVCOLR HEX RELATV ALIAS TERMCOLOR RGB ITERM RGB OSX HEX
-------------- ------- ------------ ------------ ----------- ----------- -------
dark0_hard #1d2021 [ ] [ ] 234 [h0][ ] 29- 32- 33 22- 24- 25 #161819
dark0 #282828 [bg0] [fg0] 235 [ 0][ ] 40- 40- 40 30- 30- 30 #1e1e1e
dark0_soft #32302f [ ] [ ] 236 [s0][ ] 50- 48- 47 38- 36- 35 #262423
dark1 #3c3836 [bg1] [fg1] 237 [ ][15] 60- 56- 54 46- 42- 41 #2e2a29
dark2 #504945 [bg2] [fg2] 239 [ ][ ] 80- 73- 69 63- 57- 53 #3f3935
dark3 #665c54 [bg3] [fg3] 241 [ ][ ] 102- 92- 84 83- 74- 66 #534a42
dark4 #7c6f64 [bg4] [fg4] 243 [ ][ 7] 124-111-100 104- 92- 81 #685c51
gray_245 #928374 [gray] [ ] 245 [ 8][ ] 146-131-116 127-112- 97 #7f7061
gray_244 #928374 [ ] [gray] 244 [ ][ 8] 146-131-116 127-112- 97 #7f7061
light0_hard #f9f5d7 [ ] [ ] 230 [ ][h0] 249-245-215 248-244-205 #f8f4cd
light0 #fbf1c7 [fg0] [bg0] 229 [ ][ 0] 251-241-199 250-238-187 #faeebb
light0_soft #f2e5bc [ ] [ ] 228 [ ][s0] 242-229-188 239-223-174 #efdfae
light1 #ebdbb2 [fg1] [bg1] 223 [15][ ] 235-219-178 230-212-163 #e6d4a3
light2 #d5c4a1 [fg2] [bg2] 250 [ ][ ] 213-196-161 203-184-144 #cbb890
light3 #bdae93 [fg3] [bg3] 248 [ ][ ] 189-174-147 175-159-129 #af9f81
light4 #a89984 [fg4] [bg4] 246 [ 7][ ] 168-153-132 151-135-113 #978771
bright_red #fb4934 [red] [ ] 167 [ 9][ ] 251- 73- 52 247- 48- 40 #f73028
bright_green #b8bb26 [green] [ ] 142 [10][ ] 184-187- 38 170-176- 30 #aab01e
bright_yellow #fabd2f [yellow][ ] 214 [11][ ] 250-189- 47 247-177- 37 #f7b125
bright_blue #83a598 [blue] [ ] 109 [12][ ] 131-165-152 113-149-134 #719586
bright_purple #d3869b [purple][ ] 175 [13][ ] 211-134-155 199-112-137 #c77089
bright_aqua #8ec07c [aqua] [ ] 108 [14][ ] 142-192-124 125-182-105 #7db669
bright_orange #fe8019 [orange][ ] 208 [ ][ ] 254-128- 25 251-106- 22 #fb6a16
neutral_red #cc241d [ ] [ ] 124 [ 1][ 1] 204- 36- 29 190- 15- 23 #be0f17
neutral_green #98971a [ ] [ ] 106 [ 2][ 2] 152-151- 26 134-135- 21 #868715
neutral_yellow #d79921 [ ] [ ] 172 [ 3][ 3] 215-153- 33 204-136- 26 #cc881a
neutral_blue #458588 [ ] [ ] 66 [ 4][ 4] 69-133-136 55-115-117 #377375
neutral_purple #b16286 [ ] [ ] 132 [ 5][ 5] 177- 98-134 160- 75-115 #a04b73
neutral_aqua #689d6a [ ] [ ] 72 [ 6][ 6] 104-157-106 87-142- 87 #578e57
neutral_orange #d65d0e [ ] [ ] 166 [ ][ ] 214- 93- 14 202- 72- 14 #ca480e
faded_red #9d0006 [ ] [red] 88 [ ][ 9] 157- 0- 6 137- 0- 9 #890009
faded_green #79740e [ ] [green] 100 [ ][10] 121-116- 14 102- 98- 13 #66620d
faded_yellow #b57614 [ ][yellow] 136 [ ][11] 181-118- 20 165- 99- 17 #a56311
faded_blue #076678 [ ] [blue] 24 [ ][12] 7-102-120 14- 83-101 #0e5365
faded_purple #8f3f71 [ ][purple] 96 [ ][13] 143- 63-113 123- 43- 94 #7b2b5e
faded_aqua #427b58 [ ] [aqua] 66 [ ][14] 66-123- 88 53-106- 70 #356a46
faded_orange #af3a03 [ ][orange] 130 [ ][ ] 175- 58- 3 157- 40- 7 #9d2807

View File

@ -1,42 +0,0 @@
gruvbox_dark0_hard=234
gruvbox_dark0=235
gruvbox_dark0_soft=236
gruvbox_dark1=237
gruvbox_dark2=239
gruvbox_dark3=241
gruvbox_dark4=243
gruvbox_gray_245=245
gruvbox_gray_244=244
gruvbox_light0_hard=230
gruvbox_light0=229
gruvbox_light0_soft=228
gruvbox_light1=223
gruvbox_light2=250
gruvbox_light3=248
gruvbox_light4=246
gruvbox_bright_red=167
gruvbox_bright_green=142
gruvbox_bright_yellow=214
gruvbox_bright_blue=109
gruvbox_bright_purple=175
gruvbox_bright_aqua=108
gruvbox_bright_orange=208
gruvbox_neutral_red=124
gruvbox_neutral_green=106
gruvbox_neutral_yellow=172
gruvbox_neutral_blue=66
gruvbox_neutral_purple=132
gruvbox_neutral_aqua=72
gruvbox_neutral_orange=166
gruvbox_faded_red=88
gruvbox_faded_green=100
gruvbox_faded_yellow=136
gruvbox_faded_blue=24
gruvbox_faded_purple=96
gruvbox_faded_aqua=66
gruvbox_faded_orange=130

View File

@ -1,38 +0,0 @@
# make sure LS behaves as we want it to
if [[ $OSTYPE = (linux)* ]]; then
export LS_OPTIONS='--color=auto'
fi
# terminal definition
export TERM="rxvt-unicode-256color"
# default programs
export SHELL="/bin/zsh"
export EDITOR="vim"
# LOCALE settings
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# ZSH History
export HISTFILE="$HOME/.zsh_history"
export HISTSIZE=100000
export SAVEHIST=$HISTSIZE
#export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;01:su=31;40;07:sg=36;40;07:tw=32;40;07:ow=33;40;07:'
# MANPAGE settings
export LESS_TERMCAP_mb=$'\e[1;31m' # begin bold
export LESS_TERMCAP_md=$'\e[1;36m' # begin blink
export LESS_TERMCAP_so=$'\e[1;33;44m' # begin reverse video
export LESS_TERMCAP_us=$'\e[1;37m' # begin underline
export LESS_TERMCAP_me=$'\e[0m' # reset bold/blink
export LESS_TERMCAP_se=$'\e[0m' # reset reverse video
export LESS_TERMCAP_ue=$'\e[0m' # reset underline
export GROFF_NO_SGR=1 # for konsole and gnome-terminal
export MANPAGER='less -s -M -R +Gg'
export MANPATH="/usr/local/man:$MANPATH"
# Add ~/bin to the PATH
[ -d "$HOME/bin" ] && export PATH="$HOME/bin:$PATH"

View File

@ -1,232 +0,0 @@
# =============================================================================
# Plugins
# =============================================================================
export ZPLUG_LOADED=blabla
# Check if zplug is installed
[ ! -d ~/.zplug ] && git clone https://github.com/zplug/zplug ~/.zplug
# enable zplug
source ~/.zplug/init.zsh
zplug 'zplug/zplug', hook-build:'zplug --self-manage'
# Because your terminal should be able to perform tasks asynchronously without external tools!
zplug "mafredri/zsh-async", from:github, use:async.zsh
# introduce 256 colors in terminal
zplug "chrissicool/zsh-256color"
# not sure what anyframe does... allows other plugins to function? works with fzf
zplug "mollifier/anyframe"
if zplug check "mollifier/anyframe"; then
# expressly specify to use peco
#zstyle ":anyframe:selector:" use peco
# expressly specify to use percol
#zstyle ":anyframe:selector:" use percol
# expressly specify to use fzf-tmux
#zstyle ":anyframe:selector:" use fzf-tmux
# expressly specify to use fzf
zstyle ":anyframe:selector:" use fzf
# specify path and options for peco, percol, or fzf
#zstyle ":anyframe:selector:peco:" command 'peco --no-ignore-case'
#zstyle ":anyframe:selector:percol:" command 'percol --case-sensitive'
#zstyle ":anyframe:selector:fzf-tmux:" command 'fzf-tmux --extended'
#zstyle ":anyframe:selector:fzf:" command 'fzf --extended'
#zstyle ":anyframe:selector:fzf:" command 'fzf'
#bindkey '^@' anyframe-widget-cd-ghq-repository
#bindkey '^r' anyframe-widget-put-history
fi
# print a github style calendar in terminal
zplug "k4rthik/git-cal", as:command
# Simplistic interactive filtering tool
zplug "peco/peco", as:command, from:gh-r, use:"*${(L)$(uname -s)}*amd64*"
# fzf is a general-purpose command-line fuzzy finder.
zplug "junegunn/fzf-bin", as:command, from:gh-r, rename-to:fzf, use:"*${(L)$(uname -s)}*amd64*"
if zplug check "junegunn/fzf-bin"; then
export FZF_DEFAULT_OPTS="--height 40% --reverse --border --inline-info --color=dark,bg+:235,hl+:10,pointer:5"
fi
zplug "junegunn/fzf", use:"shell/*.zsh"
# C^x C^x to launch fzf?
zplug "b4b4r07/easy-oneliner", if:"which fzf", on:"junegunn/fzf-bin"
# Enhanced cd
zplug "b4b4r07/enhancd", use:init.sh
if zplug check "b4b4r07/enhancd"; then
ENHANCD_FILTER="fzf:peco:percol"
# type 'c' and get a list of likely dirs you want to go to
ENHANCD_COMMAND="c"
fi
# Bookmarks and jump
zplug "jocelynmallon/zshmarks"
# Enhanced dir list with git features
zplug "supercrabtree/k"
# Jump back to parent directory
zplug "tarrasch/zsh-bd"
# Simple zsh calculator
zplug "arzzen/calc.plugin.zsh"
# Directory colors
zplug "seebi/dircolors-solarized", ignore:"*", as:plugin
zplug "pinelibg/dircolors-solarized-zsh"
zplug "plugins/common-aliase", from:oh-my-zsh
zplug "plugins/command-not-found", from:oh-my-zsh
zplug "plugins/copydir", from:oh-my-zsh
zplug "plugins/copyfile", from:oh-my-zsh
zplug "plugins/cp", from:oh-my-zsh
zplug "plugins/dircycle", from:oh-my-zsh
zplug "plugins/encode64", from:oh-my-zsh
zplug "plugins/extract", from:oh-my-zsh
zplug "plugins/history", from:oh-my-zsh
zplug "plugins/tmux", from:oh-my-zsh
zplug "plugins/tmuxinator", from:oh-my-zsh
zplug "plugins/urltools", from:oh-my-zsh
zplug "plugins/web-search", from:oh-my-zsh
zplug "plugins/z", from:oh-my-zsh
zplug "plugins/fancy-ctrl-z", from:oh-my-zsh
# Supports oh-my-zsh plugins and the like
if [[ $OSTYPE = (linux)* ]]; then
zplug "plugins/archlinux", from:oh-my-zsh, if:"(( $+commands[pacman] ))"
zplug "plugins/dnf", from:oh-my-zsh, if:"(( $+commands[dnf] ))"
zplug "plugins/mock", from:oh-my-zsh, if:"(( $+commands[mock] ))"
fi
zplug "plugins/git", from:oh-my-zsh, if:"(( $+commands[git] ))"
zplug "plugins/golang", from:oh-my-zsh, if:"(( $+commands[go] ))"
zplug "plugins/svn", from:oh-my-zsh, if:"(( $+commands[svn] ))"
zplug "plugins/node", from:oh-my-zsh, if:"(( $+commands[node] ))"
zplug "plugins/npm", from:oh-my-zsh, if:"(( $+commands[npm] ))"
zplug "plugins/bundler", from:oh-my-zsh, if:"(( $+commands[bundler] ))"
zplug "plugins/gem", from:oh-my-zsh, if:"(( $+commands[gem] ))"
zplug "plugins/rvm", from:oh-my-zsh, if:"(( $+commands[rvm] ))"
zplug "plugins/pip", from:oh-my-zsh, if:"(( $+commands[pip] ))"
zplug "plugins/sudo", from:oh-my-zsh, if:"(( $+commands[sudo] ))"
zplug "plugins/gpg-agent", from:oh-my-zsh, if:"(( $+commands[gpg-agent] ))"
zplug "plugins/systemd", from:oh-my-zsh, if:"(( $+commands[systemctl] ))"
zplug "plugins/docker", from:oh-my-zsh, if:"(( $+commands[docker] ))"
zplug "plugins/docker-compose", from:oh-my-zsh, if:"(( $+commands[docker-compose] ))"
zplug "plugins/terraform", from:oh-my-zsh, if:"(( $+commands[terraform] ))"
zplug "plugins/vagrant", from:oh-my-zsh, if:"(( $+commands[vagrant] ))"
zplug "djui/alias-tips"
zplug "hlissner/zsh-autopair", defer:2
# Additional completion definitions for Zsh.
zplug "zsh-users/zsh-completions"
# Suggests commands as you type based on history and completions.
zplug "zsh-users/zsh-autosuggestions"
if zplug check "zsh-users/zsh-autosuggestions"; then
#ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=075' #color could be adjusted to theme
#ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=162'
fi
# zsh-syntax-highlighting must be loaded after executing compinit command and sourcing other plugins
zplug "zsh-users/zsh-syntax-highlighting", defer:2
if zplug check "zsh-users/zsh-syntax-highlighting"; then
typeset -gA ZSH_HIGHLIGHT_STYLES ZSH_HIGHLIGHT_PATTERNS
ZSH_HIGHLIGHT_STYLES[default]='none'
ZSH_HIGHLIGHT_STYLES[cursor]='fg=yellow'
ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red'
ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=yellow'
ZSH_HIGHLIGHT_STYLES[alias]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[builtin]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[function]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[command]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[precommand]='fg=green'
ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=yellow'
ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green'
ZSH_HIGHLIGHT_STYLES[path]='fg=white,underline'
ZSH_HIGHLIGHT_STYLES[path_pathseparator]='fg=grey,underline'
ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=white'
ZSH_HIGHLIGHT_STYLES[path_approx]='fg=white'
ZSH_HIGHLIGHT_STYLES[globbing]='none'
ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=green'
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=blue'
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=blue'
ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='none'
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=magenta'
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=magenta'
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[redirection]='fg=magenta'
ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=cyan,bold'
ZSH_HIGHLIGHT_STYLES[bracket-level-2]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[bracket-level-3]='fg=magenta,bold'
ZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=yellow,bold'
ZSH_HIGHLIGHT_STYLES[assign]='none'
ZSH_HIGHLIGHT_PATTERNS=('rm -rf *' 'fg=white,bold,bg=red')
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor line)
fi
# search in zsh history
zplug "zsh-users/zsh-history-substring-search", defer:3
if zplug check "zsh-users/zsh-history-substring-search"; then
zmodload zsh/terminfo
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
bindkey "^[[1;5A" history-substring-search-up
bindkey "^[[1;5B" history-substring-search-down
fi
# Finalise the zplug section, install and load
# Install plugins if there are plugins that have not been installed
if ! zplug check; then
printf "Install plugins? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
# zplug load is called in the last stage (see other ./custom files)
# Completions
# the internal list (hash) of commands will be updated for each search by issuing the rehash command
zstyle ':completion:*' rehash true
# http://zsh.sourceforge.net/Doc/Release/Completion-System.html
zstyle ':completion:' completer _complete _match _approximate
zstyle ':completion:' group-name ''
#zstyle ':completion:' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:' matcher-list 'm:{a-z}={A-Z}'
zstyle ':completion:' use-cache true
zstyle ':completion:' verbose yes
zstyle ':completion::default' menu select=2
zstyle ':completion::descriptions' format '%F{yellow}-- %d --%f'
zstyle ':completion:*:options' description 'yes'
# case-insensitive (uppercase from lowercase) completion
#zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
# process completion
#zstyle ':completion:*:processes' command 'ps -au$USER'
#zstyle ':completion:*:*:kill:*:processes' list-colors "=(#b) #([0-9]#)*=36=31"
zstyle ':completion:*' completer _expand _complete _ignored _approximate
#zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' menu select=2
zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
zstyle ':completion:*:descriptions' format '%U%F{yellow}%d%f%u'
#zstyle ':completion:*:*:git:*' script ~/.git-completion.sh
zstyle ':completion:*' verbose yes
zstyle ':completion:*:descriptions' format '%B%d%b'
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:warnings' format 'No matches for: %d'
zstyle ':completion:*' group-name ''
# case-insensitive (all), partial-word and then substring completion
zstyle ":completion:*" matcher-list \
"m:{a-zA-Z}={A-Za-z}" \
"r:|[._-]=* r:|=*" \
"l:|=* r:|=*"
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*:default' list-colors "${(s.:.)LS_COLORS}"

View File

@ -1,2 +0,0 @@
# this enables vi bindings in zsh
bindkey -v

View File

@ -1,15 +0,0 @@
alias rm="rm -v"
alias vi="vim"
alias cp="cp -v"
alias mv="mv -v"
alias ls="ls $LS_OPTIONS -hFtr"
alias ll="ls $LS_OPTIONS -lAhFtr"
alias ccat="pygmentize -O style=monokai -f 256 -g"
alias dig="dig +nocmd any +multiline +noall +answer"
alias prettyjson='python -m json.tool'
# aliases to quickly switch between two keyboard layouts
alias aoeu="setxkbmap us"
alias asdf="setxkbmap dvorak"
disable -r time # disable shell reserved word
alias time='time -p ' # -p for POSIX output

View File

@ -1,105 +0,0 @@
# OPTIONS
setopt autocd # Allow changing directories without `cd`
setopt append_history # Dont overwrite history
setopt auto_list
setopt auto_menu
setopt auto_pushd
setopt extended_history # Also record time and duration of commands.
setopt hist_expire_dups_first # Clear duplicates when trimming internal hist.
setopt hist_find_no_dups # Dont display duplicates during searches.
setopt hist_ignore_dups # Ignore consecutive duplicates.
setopt hist_ignore_all_dups # Remember only one unique copy of the command.
setopt hist_reduce_blanks # Remove superfluous blanks.
setopt hist_save_no_dups # Omit older commands in favor of newer ones.
setopt hist_ignore_space # Ignore commands that start with space.
#setopt hist_ignore_all_dups
#setopt hist_ignore_dups
#setopt hist_reduce_blanks
#setopt hist_save_no_dups
#setopt ignore_eof
setopt inc_append_history
setopt interactive_comments
setopt no_beep
setopt no_hist_beep
setopt no_list_beep
setopt magic_equal_subst
setopt notify
setopt print_eight_bit
setopt print_exit_value
setopt prompt_subst
setopt pushd_ignore_dups
#setopt rm_star_wait
setopt share_history # Share history between multiple shells
setopt transient_rprompt
# Watching other users
#WATCHFMT="%n %a %l from %m at %t."
watch=(notme) # Report login/logout events for everybody except ourself.
LOGCHECK=60 # Time (seconds) between checks for login/logout activity.
REPORTTIME=5 # Display usage statistics for commands running > 5 sec.
# Key timeout and character sequences
KEYTIMEOUT=1
WORDCHARS='*?_-[]~=./&;!#$%^(){}<>'
zshaddhistory() { whence ${${(z)1}[1]} >| /dev/null || return 1 }
# BINDINGS
# -v enables vim bindings
bindkey -v
bindkey -v '^?' backward-delete-char
bindkey '^[[Z' reverse-menu-complete
# Common CTRL bindings.
bindkey "^a" beginning-of-line
bindkey "^e" end-of-line
bindkey "^f" forward-word
bindkey "^b" backward-word
bindkey "^k" kill-line
bindkey "^d" delete-char
bindkey "^y" accept-and-hold
bindkey "^w" backward-kill-word
bindkey "^u" backward-kill-line
bindkey "^R" history-incremental-pattern-search-backward
bindkey "^F" history-incremental-pattern-search-forward
# Do not require a space when attempting to tab-complete.
bindkey "^i" expand-or-complete-prefix
# Fixes for alt-backspace and arrows keys
bindkey '^[^?' backward-kill-word
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
#bindkey "^[[C" forward-word
#bindkey "^[[D" backward-word
## Emulate tcsh's backward-delete-word
#tcsh-backward-kill-word () {
# local WORDCHARS="${WORDCHARS:s#/#}"
# zle backward-kill-word
#}
#zle -N tcsh-backward-kill-word
# https://github.com/sickill/dotfiles/blob/master/.zsh.d/key-bindings.zsh
tcsh-backward-word () {
local WORDCHARS="${WORDCHARS:s#./#}"
zle emacs-backward-word
}
zle -N tcsh-backward-word
bindkey '\e[1;3D' tcsh-backward-word
bindkey '\e^[[D' tcsh-backward-word # tmux
tcsh-forward-word () {
local WORDCHARS="${WORDCHARS:s#./#}"
zle emacs-forward-word
}
zle -N tcsh-forward-word
bindkey '\e[1;3C' tcsh-forward-word
bindkey '\e^[[C' tcsh-backward-word # tmux
tcsh-backward-delete-word () {
local WORDCHARS="${WORDCHARS:s#./#}"
zle backward-delete-word
}
zle -N tcsh-backward-delete-word
bindkey "^[^?" tcsh-backward-delete-word # urxvt

View File

@ -1,6 +0,0 @@
# Load the zplug plugins
zplug load
# Set up SDKMAN
export SDKMAN_DIR="/home/jnieland/.sdkman"
[[ -s "/home/jnieland/.sdkman/bin/sdkman-init.sh" ]] && source "/home/jnieland/.sdkman/bin/sdkman-init.sh"

View File

@ -1 +0,0 @@
/usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme

View File

@ -1,604 +0,0 @@
;=====================================================
;
; To learn more about how to configure Polybar
; go to https://github.com/jaagr/polybar
;
; The README contains alot of information
;
;=====================================================
[colors]
background = ${xrdb:color0:#222}
foreground = ${xrdb:color7:#222}
background-alt = ${xrdb:color10:#222}
foreground-alt = ${xrdb:color4:#222}
icon-color = ${xrdb:color4:#FF2}
primary = ${xrdb:color1:#222}
alert = ${xrdb:color10:#222}
secondary = ${xrdb:color10:#222}
; let's get some colors from xrdb (pywal)
col0 = ${xrdb:color0:#222}
col1 = ${xrdb:color1:#222}
col2 = ${xrdb:color2:#222}
col3 = ${xrdb:color3:#222}
col4 = ${xrdb:color4:#222}
col5 = ${xrdb:color5:#222}
col6 = ${xrdb:color6:#222}
col7 = ${xrdb:color7:#222}
col8 = ${xrdb:color8:#222}
col9 = ${xrdb:color9:#222}
col10 = ${xrdb:color10:#222}
col11 = ${xrdb:color11:#222}
col12 = ${xrdb:color12:#222}
col13 = ${xrdb:color13:#222}
gruvbg = ${xrdb:background:#222}
gruvbghard = ${xrdb:backgroundhard:#222}
gruvbgsoft = ${xrdb:backgroundsoft:#222}
gruvfg = ${xrdb:foreground:#222}
; control some of the later elements from here, nice and tidy
underline-cpu = ${xrdb:color2:#222}
underline-memory = ${xrdb:color3:#222}
underline-date = ${xrdb:color4:#222}
underline-battery = ${xrdb:color5:#222}
underline-temperature = ${xrdb:color6:#222}
underline-keyboard = ${xrdb:color7:#222}
underline-i3-focused = ${xrdb:color10:#222}
underline-i3-unfocused = ${xrdb:color8:#222}
[bar/general]
width = 100%
; spaces before/after each module
module-margin-left = 1
module-margin-right = 1
height = 27
fixed-center = true
line-size = 3
line-color = #f00
; rounded corners of the bar
radius = 0.0
;this makes sure that i3 doesn't reposition everything when polybar becomes active... is shit
override-redirect = false
wm-restack = i3
; all the bar colors
background = ${colors.background}
foreground = ${colors.foreground}
border-color = ${colors.background}
; spaces on begin/end of bar
padding-left = 2
padding-right = 2
; set the bar fonts
;font-0 = fixed:pixelsize=10;1
;font-0 = "Wuncon Siji:pixelsize=15;1"
;font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
;font-2 = "Inconsolata\ For\ Powerline:pixelsize=10;1"
font-0 = FuraCode Nerd Font:pixelsize=11;1
; override pointers
cursor-click = pointer
cursor-scroll = pointer
[bar/example]
inherit = bar/general
monitor = ${env:MONITOR:eDP-1}
;offset-x = 2%
;offset-y = 1%
;i'm faking the left and right margins with a fat border. i'm helpless
;border-size = 20
;border-left-size = 16
;border-right-size = 16
;unused modules - mpd xbacklight backlight-acpi alsa
modules-left = i3
modules-center = temperature battery xkeyboard memory cpu filesystem updates-arch reboot-check xbacklight top-process
modules-right = net1 wifi0 vpn powermenu
; TRAY MANAGEMENT
;tray-position = right
tray-position = ${env:TRAY_POSITION:none}
;tray-transparent = true
tray-detached = false
tray-maxsize = 16
;tray-background = ${colors.background-alt}
;this makes sure that the tray doesn't run off to the right of the monitor - only enable this when the bar's width is a bit off
tray-offset-x = 0
tray-offset-y = 27
tray-padding = 2
tray-scale = 1.0
scroll-up = i3wm-wsnext
scroll-down = i3wm-wsprev
cursor-click = pointer
;cursor-scroll = ns-resize
cursor-scroll = pointer
[bar/secondary]
inherit = bar/general
monitor = ${env:MONITOR:eDP-1}
;offset-x = 2%
;offset-y = 1%
;unused modules - mpd xbacklight backlight-acpi alsa
modules-right = pulseaudio
modules-center = player-mpris-tail
modules-left = date info-hackspeed
[module/player-mpris-tail]
type = custom/script
exec = ~/.config/polybar/polybar-scripts/polybar-scripts/player-mpris-tail/player-mpris-tail.py -f '{icon} {artist} - {title}' --icon-playing  --icon-paused  --icon-stopped  --icon-none ﱙ
tail = true
label = %output%
[module/info-hackspeed]
type = custom/script
format-prefix = " "
format-prefix-foreground = ${colors.icon-color}
exec = ~/.config/polybar/polybar-scripts/polybar-scripts/info-hackspeed/info-hackspeed.sh
tail = true
[module/top-process]
type = custom/script
format-prefix = " "
format-prefix-foreground = ${colors.icon-color}
format-underline = ${colors.alert}
interval = 5
exec = ~/.dotfiles/scripts/top.process.sh
tail = true
[module/xwindow]
type = internal/xwindow
label = %title:0:30:...%
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
format-prefix = " "
format-prefix-foreground = ${colors.icon-color}
format-prefix-underline = ${colors.underline-keyboard}
; layout, number, name
label-layout = %layout%
label-layout-underline = ${colors.underline-keyboard}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.secondary}
label-indicator-underline = ${colors.underline-keyboard}
cursor-click = pointer
[module/vpn]
type = custom/script
exec = nmcli | grep "VPN connection" | sed -e "s/VPN connection//g"
exec-if = pgrep -x openvpn
interval = 5
format-underline = #268bd2
format-prefix = " "
format-prefix-foreground = ${colors.col1}
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
mount-1 = /mnt/ext4
label-mounted = %{F#0a81f5}%mountpoint%%{F-} %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.foreground-alt}
[module/bspwm]
type = internal/bspwm
label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2
label-occupied = %index%
label-occupied-padding = 2
label-urgent = %index%!
label-urgent-background = ${colors.alert}
label-urgent-padding = 2
label-empty = %index%
label-empty-foreground = ${colors.foreground-alt}
label-empty-padding = 2
; Separator in between workspaces
; label-separator = |
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
pin-workspaces = true
; This will split the workspace name on ':'
; Default: false
strip-wsnumbers = true
; using siji icons... see view.sh for codes
; not using siji anymore, check out nerdfonts.com!
;  
ws-icon-0 = 1:1;
ws-icon-1 = 2:2;
ws-icon-2 = 3:3;
ws-icon-3 = 4:4;
ws-icon-4 = 5:5;
ws-icon-5 = 6:6;
ws-icon-6 = 7:7;
ws-icon-7 = 8:8;
ws-icon-8 = 9:9;﬐
ws-icon-9 = 10:10;
ws-icon-10 = 11:;
ws-icon-11 = 12:;
ws-icon-default = 
; Whenever the 'move' changes... like 'resize', ...
label-mode-padding = 2
label-mode-foreground = ${colors.gruvfg}
;label-mode-background = ${colors.primary}
label-mode-background = ${colors.col4}
label-mode-underline = ${colors.col12}
; focused = Active workspace on focused monitor
label-focused = %icon% %name%
;label-focused = %index%
;label-focused-background = ${module/bspwm.label-focused-background}
;label-focused-underline = ${module/bspwm.label-focused-underline}
;label-focused-padding = ${module/bspwm.label-focused-padding}
label-focused-background = ${colors.col2}
label-focused-foreground = ${colors.gruvbghard}
label-focused-underline = ${colors.underline-i3-focused}
label-focused-padding = 2
; unfocused = Inactive workspace on any monitor
;label-unfocused = %index%
label-unfocused = %icon% %name%
label-unfocused-underline = ${colors.underline-i3-unfocused}
;label-unfocused-padding = ${module/bspwm.label-occupied-padding}
label-unfocused-padding = 2
; visible = Active workspace on unfocused monitor
; label-visible = %index%
label-visible = %icon% %name%
;label-visible-background = ${self.label-focused-background}
;label-visible-underline = ${self.label-focused-underline}
;label-visible-padding = ${self.label-focused-padding}
label-visible-background = ${colors.col12}
label-visible-foreground = ${colors.gruvbghard}
label-visible-underline = #FFFFFF
label-visible-padding = 2
; urgent = Workspace with urgency hint set
label-urgent = %icon% %name%
; label-urgent-background = ${module/bspwm.label-urgent-background}
label-urgent-background = ${colors.col1}
label-urgent-foreground = ${colors.col9}
label-urgent-underline = ${colors.col9}
label-urgent-padding = 2
; Separator in between workspaces
; label-separator = |
[module/mpd]
type = internal/mpd
format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next>
icon-prev = 玲
icon-stop = 
icon-play = 
icon-pause = 
icon-next = 怜
label-song-maxlen = 25
label-song-ellipsis = true
[module/xbacklight]
type = internal/xbacklight
format = <label> <bar>
label = 
; format-underline = ${colors.foreground-alt}
format-underline = ${colors.col6}
format-prefix-foreground = ${colors.underline-cpu}
bar-width = 10
bar-indicator = |
bar-indicator-foreground = #ff
bar-indicator-font = 2
bar-fill = ─
bar-fill-font = 2
bar-fill-foreground = ${colors.col6}
bar-empty = ─
bar-empty-font = 2
bar-empty-foreground = ${colors.col7}
[module/backlight-acpi]
inherit = module/xbacklight
type = internal/backlight
;card = intel_backlight
card = acpi_video0
[module/cpu]
type = internal/cpu
interval = 2
;format-prefix = " "
;format = <label> <ramp-coreload>
format = <ramp-coreload>
ramp-coreload-spacing = 0.5
ramp-coreload-0 = ▁
ramp-coreload-1 = ▂
ramp-coreload-2 = ▃
ramp-coreload-3 = ▄
ramp-coreload-4 = ▅
ramp-coreload-5 = ▆
ramp-coreload-6 = ▇
ramp-coreload-7 = █
format-prefix = " "
format-prefix-foreground = ${colors.underline-cpu}
;format-underline = #f90000
format-underline = ${colors.underline-cpu}
label = %percentage-cores%
[module/memory]
type = internal/memory
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.icon-color}
;format-underline = #4bffdc
format-underline = ${colors.underline-memory}
label = %percentage_used%%
[module/updates-arch]
type = custom/script
exec = ~/.config/polybar/polybar-scripts/polybar-scripts/updates-arch/updates-arch.sh
format-prefix = " "
format-prefix-foreground = ${colors.icon-color}
format-underline = ${colors.col13}
interval = 600
label = "%output%"
[module/reboot-check]
type = custom/script
exec = ~/bin/reboot.check
format-underline = ${colors.col1}
format-foreground = ${colors.col1}
interval = 30
label = ""
[module/wifi0]
type = internal/network
interface = wifi0
interval = 3.0
format-connected = <ramp-signal> <label-connected>
format-connected-underline = ${colors.icon-color}
;label-connected = %{A1:networkmanager_dmenu:}%essid%%{A}
;  
label-connected = "%{A1:networkmanager_dmenu:}%essid%%{A} %downspeed:3% %upspeed:3%"
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-foreground = ${colors.foreground-alt}
[module/net1]
type = internal/network
interface = net1
interval = 3.0
format-connected-underline = #55aa55
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.icon-color}
;label-connected = %local_ip%
label-connected = "%downspeed:3% %upspeed:3%"
label-connected-foreground = ${colors.foreground}
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
[module/date]
type = internal/date
interval = 5
date = " %Y-%m-%d"
date-alt =
time = %H:%M:%S
time-alt = %H:%M
format-prefix = ""
format-prefix-foreground = ${colors.foreground-alt}
;format-underline = #0a6cf5
;format-underline = ${colors.underline-date}
label = "%date% %time%"
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <label-volume> <bar-volume>
label-volume =  %percentage%%
label-volume-foreground = ${root.foreground}
; the muted symbol comes from siji font (check the 'view.sh' script for altcodes)
label-muted =  muted
;label-muted-foreground = #66
label-muted-foreground = ${colors.alert}
bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
[module/alsa]
type = internal/alsa
format-volume = <label-volume> <bar-volume>
label-volume = VOL
label-volume-foreground = ${root.foreground}
format-muted-prefix = " "
format-muted-foreground = ${colors.foreground-alt}
label-muted = sound muted
bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
[module/battery]
type = internal/battery
battery = BAT0
adapter = AC
full-at = 98
time-format = %H:%M
label-charging =  %time% %percentage%%
format-charging = <animation-charging> <label-charging>
;format-charging-underline = #ffb52a
format-charging-underline = ${colors.underline-battery}
label-discharging =  %time% %percentage%%
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}
format-full-prefix = " "
format-full-prefix-foreground = ${colors.foreground-alt}
format-full-underline = ${self.format-charging-underline}
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-foreground = ${colors.foreground-alt}
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
animation-charging-foreground = ${colors.foreground-alt}
animation-charging-framerate = 750
[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60
format = <ramp> <label>
;format-underline = #f50a4d
format-underline = ${colors.underline-temperature}
format-warn = <ramp> <label-warn>
format-warn-underline = ${self.format-underline}
label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.secondary}
;found this with following command
; for i in /sys/class/hwmon/hwmon*/temp*_input; do echo "$(<$(dirname $i)/name): $(cat ${i%_*}_label 2>/dev/null || echo $(basename ${i%_*})) $(readlink -f $i)"; done
;hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_input
;hwmon-path = ${env:HWMON_PATH:/sys/devices/platform/coretemp.0/hwmon/hwmon1/temp1_input}
; different approach: add to .xinitrc a line that sets up an env variable
; > CPU_TEMP_PATH=$(ls /sys/devices/platform/coretemp*/hwmon/hwmon*/temp*_input | grep -m 1 '')
hwmon-path = ${env:CPU_TEMP_PATH:/sys/devices/platform/coretemp.0/hwmon/hwmon5/temp5_input}
;hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp2_input
ramp-0 = 
ramp-1 = 
ramp-2 = 
ramp-foreground = ${colors.foreground-alt}
[module/powermenu]
type = custom/menu
expand-right = true
format-spacing = 1
label-open = ⏻
label-open-foreground = ${colors.secondary}
label-close = " back"
label-close-foreground = ${colors.secondary}
label-separator = |
label-separator-foreground = ${colors.foreground-alt}
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = systemctl reboot
menu-2-0 = power off
menu-2-0-exec = systemctl poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
[global/wm]
;margin-top = 5
;margin-bottom = 5
; vim:ft=dosini

View File

@ -1,29 +0,0 @@
#!/bin/zsh
# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
# started tray...
started_tray=false
# set some global variables to be passed to polybar
export HWMON_PATH=$(ls /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp*_input | head -n 1)
# launch polybar on all connected monitors
for m in $(polybar --list-monitors | cut -d":" -f1); do
echo "Launching polybar on monitor $m"
MONITOR=$m TRAY_POSITION=none polybar --reload secondary &
if [ "$started_tray" = false ]; then
MONITOR=$m TRAY_POSITION=right polybar --reload example &
started_tray=true
echo "launching $m with tray"
else
MONITOR=$m TRAY_POSITION=none polybar --reload example &
echo "launching $m without tray"
fi
done
echo "Done launching."

View File

@ -1,12 +0,0 @@
#!/bin/bash
# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
# Launch Polybar, using default config location ~/.config/polybar/config
polybar example &
echo "Polybar launched..."

View File

@ -1,14 +0,0 @@
# Contributing to polybar-scripts
Thank you for your interest in improving polybar-scripts.
Some things that have become standard:
* The [skeleton](skeleton/). This is an example of how each script is organized to create a common file structure.
* Use `#` or `#1`, `#2` .. as icon replacement in your scripts. Everyone use another icon font. So let the user decide which icon he wants to use.
* Remove your colors unless they have a special function. This way scripts remain customizable.
## check your code
* Use `shellcheck` to check your shell scripts for possible errors. Otherwise, Travis CI will do it for you. A good start to try [ShellCheck](https://www.shellcheck.net/) is their website.

View File

@ -1,24 +0,0 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org>

View File

@ -1,79 +0,0 @@
# polybar-scripts
[![Build Status](https://travis-ci.org/x70b1/polybar-scripts.svg?branch=master)](https://travis-ci.org/x70b1/polybar-scripts)
[![GitHub contributors](https://img.shields.io/github/contributors/x70b1/polybar-scripts.svg)](https://github.com/x70b1/polybar-scripts/graphs/contributors)
[![license](https://img.shields.io/github/license/x70b1/polybar-scripts.svg)](https://github.com/x70b1/polybar-scripts/blob/master/LICENSE)
This is a community project. We write and collect scripts for Polybar!
To find out how to write and use your own scripts, read [Polybars wiki](https://github.com/jaagr/polybar/wiki).
This repository is not an exact blueprint. I guess every script has to be customized to make your Polybar unique. We cannot guarantee that all scripts will work because many scripts are written for very specific purposes. But we're trying.
Your script isn't here yet? You have ideas to extend the scripts or descriptions? Send us your pull request or join us on freenode's `#polybar`.
## Hall of Fame
Is this your first time here? You should definitely take a look at these scripts:
* [battery-combined-udev](polybar-scripts/battery-combined-udev)
* [openweathermap-fullfeatured](polybar-scripts/openweathermap-fullfeatured)
* [player-mpris-tail](polybar-scripts/player-mpris-tail)
* [pulseaudio-tail](polybar-scripts/pulseaudio-tail)
* [system-usb-udev](polybar-scripts/system-usb-udev)
* [updates-arch-combined](polybar-scripts/updates-arch-combined)
* [info-hackspeed](polybar-scripts/info-hackspeed)
## all colors are beautiful
[![updates-arch-combined](polybar-scripts/updates-arch-combined/screenshots/1.png)](polybar-scripts/updates-arch-combined/)
[![system-cpu-temppercore](polybar-scripts/system-cpu-temppercore/screenshots/1.png)](polybar-scripts/system-cpu-temppercore/)
[![notification-chess](polybar-scripts/notification-chess/screenshots/1.png)](polybar-scripts/notification-chess/)
[![inbox-reddit](polybar-scripts/inbox-reddit/screenshots/1.png)](polybar-scripts/inbox-reddit/)
[![openvpn-isrunning](polybar-scripts/openvpn-isrunning/screenshots/1.png)](polybar-scripts/openvpn-isrunning/)
[![inbox-imap-python](polybar-scripts/inbox-imap-python/screenshots/1.png)](polybar-scripts/inbox-imap-python/)
[![openweathermap-fullfeatured](polybar-scripts/openweathermap-fullfeatured/screenshots/1.png)](polybar-scripts/openweathermap-fullfeatured/)
[![ticker-btceur](polybar-scripts/ticker-btceur/screenshots/1.png)](polybar-scripts/ticker-btceur/)
[![player-mpris-simple](polybar-scripts/player-mpris-simple/screenshots/1.png)](polybar-scripts/player-mpris-simple/)
[![battery-combined-tlp](polybar-scripts/battery-combined-tlp/screenshots/1.png)](polybar-scripts/battery-combined-tlp/)
[![info-projecthamster](polybar-scripts/info-projecthamster/screenshots/1.png)](polybar-scripts/info-projecthamster/)
[![system-usb-udev](polybar-scripts/system-usb-udev/screenshots/1.png)](polybar-scripts/system-usb-udev/)
[![system-usb-udev](polybar-scripts/system-usb-udev/screenshots/2.png)](polybar-scripts/system-usb-udev/)
[![openweathermap-simple](polybar-scripts/openweathermap-simple/screenshots/1.png)](polybar-scripts/openweathermap-simple/)
[![info-pingrtt](polybar-scripts/info-pingrtt/screenshots/3.png)](polybar-scripts/info-pingrtt/)
[![info-ssh-sessions](polybar-scripts/info-ssh-sessions/screenshots/1.png)](polybar-scripts/info-ssh-sessions/)
[![openweathermap-detailed](polybar-scripts/openweathermap-detailed/screenshots/1.png)](polybar-scripts/openweathermap-detailed/)
[![info-hackspeed](polybar-scripts/info-hackspeed/screenshots/1.png)](polybar-scripts/info-hackspeed/)
[![info-xampp](polybar-scripts/info-xampp/screenshots/1.png)](polybar-scripts/info-xampp/)
[![player-mpris-tail](polybar-scripts/player-mpris-tail/screenshots/1.png)](polybar-scripts/player-mpris-tail/)
[![info-redshift-temp](polybar-scripts/info-redshift-temp/screenshots/1.png)](polybar-scripts/info-redshift-temp/)
[![info-trash](polybar-scripts/info-trash/screenshots/1.png)](polybar-scripts/info-trash/)
[![pulseaudio-rofi](polybar-scripts/pulseaudio-rofi/screenshots/1.png)](polybar-scripts/pulseaudio-rofi/)
[![pulseaudio-rofi](polybar-scripts/info-softwarecounter/screenshots/1.png)](polybar-scripts/info-softwarecounter/)
[![info-twitch-countdown](polybar-scripts/info-twitch-countdown/screenshots/1.png)](polybar-scripts/info-twitch-countdown/)
[![info-twitch-countdown](polybar-scripts/info-twitch-countdown/screenshots/2.png)](polybar-scripts/info-twitch-countdown/)
[![info-todotxt](polybar-scripts/info-todotxt/screenshots/1.png)](polybar-scripts/info-todotxt/)
[![info-wifionice](polybar-scripts/info-wifionice/screenshots/1.png)](polybar-scripts/info-wifionice/)
## See also these other user repositories:
* [vyachkonovalov/polybar-gmail](https://github.com/vyachkonovalov/polybar-gmail): A Polybar module to show unread messages from Gmail
* [0nse/now_playing](https://github.com/0nse/now_playing): Output the currently scrobbling song
* [dakuten/taskwarrior-polybar](https://github.com/dakuten/taskwarrior-polybar): merely just a script showing the most urgent task and allowing it to be marked done
* [quelotic/polybarModules](https://github.com/quelotic/polybarModules): scripts for mail and caffeine
* [vyp/scripts](https://github.com/vyp/scripts): A script to show focused, occupied, free and urgent herbstluftwm tags in polybar
* [willHol/polybar-crypto](https://github.com/willHol/polybar-crypto): A polybar script that displays the price of crypto-currencies
* [DanaruDev/UnseenMail](https://framagit.org/DanaruDev/UnseenMail): Polybar Python script for viewing unread email from multi accounts
* [drdeimos/polybar_another_battery](https://github.com/drdeimos/polybar_another_battery): Simple battery charge level watcher with notifications (libnotify)
* [zemmsoares/polynews](https://github.com/zemmsoares/polynews): read news on your polybar
## Setup
* Save the script of your choice somewhere at `~/.config/polybar/`.
* Don't forget to make the script executable: `chmod +x ~/.config/polybar/script.sh`.
* Copy the module settings into your configuration file.
* Replace the appropriate icon strings in the script (e.g. replace `#1` with `🎉`).

View File

@ -1,26 +0,0 @@
#!/bin/sh
error_count=0
scripts="polybar-scripts/*/*.sh"
for file in $scripts; do
# Exceptions
if [ "$file" = "polybar-scripts/info-hackspeed/info-hackspeed.sh" ]; then
shellcheck --exclude=SC2016,SC2059 "$file"
if [ $? -ne 0 ]; then
error_count=$((error_count+1))
fi
else
shellcheck "$file"
if [ $? -ne 0 ]; then
error_count=$((error_count+1))
fi
fi
done
if [ $error_count -eq 0 ]; then
exit 0
else
exit 1
fi

View File

@ -1,13 +0,0 @@
language: c
install:
- scversion="stable"
- wget "https://storage.googleapis.com/shellcheck/shellcheck-$scversion.linux.x86_64.tar.xz"
- tar --xz -xvf "shellcheck-$scversion.linux.x86_64.tar.xz"
- shellcheck() { "shellcheck-$scversion/shellcheck" "$@"; }
before_script:
- shellcheck --version
script:
- source ${TRAVIS_BUILD_DIR}/build.sh

View File

@ -1,15 +0,0 @@
# Script: battery-combined-shell
A shell script that shows the battery status.
It supports two rechargeable batteries and changing icons. It works even if only one battery is used.
## Module
```ini
[module/battery-combined-shell]
type = custom/script
exec = ~/polybar-scripts/battery-combined-shell.sh
interval = 10
```

View File

@ -1,61 +0,0 @@
#!/bin/sh
path_ac="/sys/class/power_supply/AC"
path_battery_0="/sys/class/power_supply/BAT0"
path_battery_1="/sys/class/power_supply/BAT1"
ac=0
battery_level_0=0
battery_level_1=0
battery_max_0=0
battery_max_1=0
if [ -f "$path_ac/online" ]; then
ac=$(cat "$path_ac/online")
fi
if [ -f "$path_battery_0/energy_now" ]; then
battery_level_0=$(cat "$path_battery_0/energy_now")
fi
if [ -f "$path_battery_0/energy_full" ]; then
battery_max_0=$(cat "$path_battery_0/energy_full")
fi
if [ -f "$path_battery_1/energy_now" ]; then
battery_level_1=$(cat "$path_battery_1/energy_now")
fi
if [ -f "$path_battery_1/energy_full" ]; then
battery_max_1=$(cat "$path_battery_1/energy_full")
fi
battery_level=$(("$battery_level_0 + $battery_level_1"))
battery_max=$(("$battery_max_0 + $battery_max_1"))
battery_percent=$(("$battery_level * 100"))
battery_percent=$(("$battery_percent / $battery_max"))
if [ "$ac" -eq 1 ]; then
icon="#1"
if [ "$battery_percent" -gt 97 ]; then
echo "$icon"
else
echo "$icon $battery_percent %"
fi
else
if [ "$battery_percent" -gt 85 ]; then
icon="#21"
elif [ "$battery_percent" -gt 60 ]; then
icon="#22"
elif [ "$battery_percent" -gt 35 ]; then
icon="#23"
elif [ "$battery_percent" -gt 10 ]; then
icon="#24"
else
icon="#25"
fi
echo "$icon $battery_percent %"
fi

View File

@ -1,31 +0,0 @@
# Script: battery-combined-tlp
A shell script that shows the battery status.
It uses TLP and requires root privileges. Note that the icon doesn't change.
![battery-combined-tlp](screenshots/1.png)
## Dependencies
* `tlp`
## Configuration
You may need to add `tlp-stat` command to the `/etc/sudoers` NOPASSWD of your user:
```ini
user ALL=(ALL) NOPASSWD: /usr/bin/tlp-stat
```
## Module
```ini
[module/battery-combined-tlp]
type = custom/script
exec = ~/polybar-scripts/battery-combined-tlp.sh
interval = 10
```

View File

@ -1,5 +0,0 @@
#!/bin/sh
battery=$(sudo tlp-stat -b | tail -2 | head -n 1 | tr -d -c "[:digit:],.")
echo "# $battery %"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 841 B

View File

@ -1,4 +0,0 @@
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", \
RUN+="/home/user/.config/polybar/battery-combined-udev.sh --update"
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", \
RUN+="/home/user/.config/polybar/battery-combined-udev.sh --update"

View File

@ -1,24 +0,0 @@
# Script: battery-combined-udev
A shell script that shows the battery status. This is an extended version of [battery-combined-shell](../battery-combined-shell).
It supports two rechargeable batteries and changing icons. It works even if only one battery is used.
This script is able to display power supply changes in real time. For this udev is being used.
## Configuration
Copy `95-battery.rules` to `/etc/udev/rules.d/95-battery.rules`. Make sure that the paths in the file have been modified properly.
Also change the file path in line `#65`.
## Module
```ini
[module/battery-combined-udev]
type = custom/script
exec = ~/polybar-scripts/battery-combined-udev.sh
tail = true
```

View File

@ -1,88 +0,0 @@
#!/bin/sh
battery_print() {
path_ac="/sys/class/power_supply/AC"
path_battery_0="/sys/class/power_supply/BAT0"
path_battery_1="/sys/class/power_supply/BAT1"
ac=0
battery_level_0=0
battery_level_1=0
battery_max_0=0
battery_max_1=0
if [ -f "$path_ac/online" ]; then
ac=$(cat "$path_ac/online")
fi
if [ -f "$path_battery_0/energy_now" ]; then
battery_level_0=$(cat "$path_battery_0/energy_now")
fi
if [ -f "$path_battery_0/energy_full" ]; then
battery_max_0=$(cat "$path_battery_0/energy_full")
fi
if [ -f "$path_battery_1/energy_now" ]; then
battery_level_1=$(cat "$path_battery_1/energy_now")
fi
if [ -f "$path_battery_1/energy_full" ]; then
battery_max_1=$(cat "$path_battery_1/energy_full")
fi
battery_level=$(("$battery_level_0 + $battery_level_1"))
battery_max=$(("$battery_max_0 + $battery_max_1"))
battery_percent=$(("$battery_level * 100"))
battery_percent=$(("$battery_percent / $battery_max"))
if [ "$ac" -eq 1 ]; then
icon="#1"
if [ "$battery_percent" -gt 97 ]; then
echo "$icon"
else
echo "$icon $battery_percent %"
fi
else
if [ "$battery_percent" -gt 85 ]; then
icon="#21"
elif [ "$battery_percent" -gt 60 ]; then
icon="#22"
elif [ "$battery_percent" -gt 35 ]; then
icon="#23"
elif [ "$battery_percent" -gt 10 ]; then
icon="#24"
else
icon="#25"
fi
echo "$icon $battery_percent %"
fi
}
path_pid="/home/user/.config/polybar/battery-combined-udev.pid"
case "$1" in
--update)
pid=$(cat $path_pid)
if [ "$pid" != "" ]; then
kill -10 "$pid"
fi
;;
*)
echo $$ > $path_pid
trap exit INT
trap "echo" USR1
while true; do
battery_print
sleep 30 &
wait
done
;;
esac

View File

@ -1,25 +0,0 @@
# Script: battery-cyberpower
A shell script that shows the battery status for CyberPower UPS devices.
This script is able to display power supply changes in real time.
## Dependencies
* `pwrstat` from CyberPower's website
## Configuration
It requires access to run `pwrstat` as root, so you may need to adjust your system to allow this (for example `sudo`).
## Module
```ini
[module/battery-cyberpower]
type = custom/script
exec = ~/polybar-scripts/battery-cyberpower.sh
tail = true
```

View File

@ -1,56 +0,0 @@
#!/bin/sh
ICON_AC="#1"
ICON_BATTERY_FULL="#21"
ICON_BATTERY_GOOD="#22"
ICON_BATTERY_LOW="#23"
ICON_BATTERY_CAUTION="#24"
ICON_BATTERY_EMPTY="#25"
SHOW_ESTIMATION=1
battery_print() {
battery_info="$(sudo pwrstat -status)"
battery_capacity="$(echo "$battery_info" | awk '/Capacity/{print $3}')"
battery_ac="$(echo "$battery_info" | awk '/Power Supply by/{print $4,$5}')"
battery_load="$(echo "$battery_info" | grep "Load" | cut -d \( -f 2 | tr -d ' %)')"
battery_remaining="$(echo "$battery_info" | awk '/Remaining Runtime/{print $3}')"
output=""
if [ "$battery_ac" = "Utility Power" ]; then
if [ "$battery_capacity" -gt 97 ]; then
output="$ICON_AC"
else
output="$ICON_AC $battery_capacity %"
fi
else
if [ "$battery_capacity" -gt 85 ]; then
output="$ICON_BATTERY_FULL $battery_capacity %"
elif [ "$battery_capacity" -gt 60 ]; then
output="$ICON_BATTERY_GOOD $battery_capacity %"
elif [ "$battery_capacity" -gt 35 ]; then
output="$ICON_BATTERY_LOW $battery_capacity %"
elif [ "$battery_capacity" -gt 10 ]; then
output="$ICON_BATTERY_CAUTION $battery_capacity %"
else
output="$ICON_BATTERY_EMPTY $battery_capacity %"
fi
fi
if [ "$SHOW_ESTIMATION" -eq 1 ]; then
output="$output ($battery_load % / $battery_remaining min)"
fi
echo "$output"
}
trap exit INT
trap "echo" USR1
while true; do
battery_print "$@"
sleep 30 &
wait
done

View File

@ -1,20 +0,0 @@
# Script: inbox-imap-python
A script that shows if there are unread mails in your IMAPs inbox.
![inbox-imap-python](screenshots/1.png)
## Configuration
For Gmail, you must allow [less secure apps](https://myaccount.google.com/security#connectedapps).
## Module
```ini
[module/inbox-imap-python]
type = custom/script
exec = ~/polybar-scripts/inbox-imap-python.py
interval = 60
```

View File

@ -1,9 +0,0 @@
#!/usr/bin/python
import imaplib
obj = imaplib.IMAP4_SSL('imap.mail.net', 993)
obj.login('userlogin', 'pass123')
obj.select()
print(len(obj.search(None, 'unseen')[1][0].split()))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 542 B

View File

@ -1,27 +0,0 @@
# Script: inbox-imap-shellnetrc
A script that shows if there are unread mails in your IMAP inbox.
This script actually use IMAPs. `curl` can also handle unencrypted IMAP. You only need to change the protocol in the command.
The login data is stored in a `.netrc`. This is more secure because the password is not visible in the process list.
## Dependencies
* `curl`
## Configuration
For Gmail, you must allow [less secure apps](https://myaccount.google.com/security#connectedapps).
## Module
```ini
[module/inbox-imap-shellnetrc]
type = custom/script
exec = ~/polybar-scripts/inbox-imap-shellnetrc.sh
interval = 60
```

View File

@ -1,3 +0,0 @@
machine mail.server.tld
login username
password supersecretpw

View File

@ -1,12 +0,0 @@
#!/bin/sh
SERVER=""
NETRC=".netrc"
inbox=$(curl -sf --netrc-file "$NETRC" -X "STATUS INBOX (UNSEEN)" imaps://"$SERVER"/INBOX | tr -d -c "[:digit:]")
if [ "$inbox" ] && [ "$inbox" -gt 0 ]; then
echo "# $inbox"
else
echo ""
fi

View File

@ -1,22 +0,0 @@
# Script: inbox-pop3-shellnetrc
A script that shows if there are unread mails in your POP3 inbox.
This script actually use POP3s. `curl` can also handle unencrypted POP3. You only need to change the protocol in the command.
The login data is stored in a `.netrc`. This is more secure because the password is not visible in the process list.
## Dependencies
* `curl`
## Module
```ini
[module/inbox-pop3-shellnetrc]
type = custom/script
exec = ~/polybar-scripts/inbox-pop3-shellnetrc.sh
interval = 60
```

View File

@ -1,3 +0,0 @@
machine mail.server.tld
login username
password supersecretpw

View File

@ -1,12 +0,0 @@
#!/bin/sh
SERVER=""
NETRC=".netrc"
inbox=$(curl -sf --netrc-file "$NETRC" pop3s://"$SERVER" | wc -l)
if [ "$inbox" -gt 0 ]; then
echo "# $inbox"
else
echo ""
fi

View File

@ -1,23 +0,0 @@
# Script: inbox-reddit
A script that shows if there are unread mails in your Reddit inbox.
Type Reddit JSON URL from [reddit.com/prefs/feeds/](https://www.reddit.com/prefs/feeds/). Click `your inbox` > `unread messages` > `JSON` and copy the link.
![inbox-reddit](screenshots/1.png)
## Dependencies
* `curl`
* `jq`
## Module
```ini
[module/inbox-reddit]
type = custom/script
exec = ~/polybar-scripts/inbox-reddit.sh
interval = 60
```

View File

@ -1,15 +0,0 @@
#!/bin/sh
url="your url here"
unread=$(curl -sf "$url" | jq '.["data"]["children"] | length')
case "$unread" in
''|*[!0-9]*)
unread=0
esac;
if [ "$unread" -gt 0 ]; then
echo "#1 $unread"
else
echo "#2"
fi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,33 +0,0 @@
# Script: info-hackspeed
A small script that shows your typing speed. Happy Hacking!
![info-hackspeed](screenshots/1.png)
## Dependencies
* `xorg-xinput`
* `awk`
* coreutils (`rm`, `stdbuf`, `mktemp`, `stat`, you probably have this)
## Configuration
* `KEYBOARD_ID`: name of your keyboard. See Setup above. Default: `AT Translated Set 2 keyboard`
* `METRIC`: either `cpm` (characters per minute) of `wpm` ([words per minute, 1 word = 5 characters](https://en.wikipedia.org/wiki/Words_per_minute)). Default: `cpm`
* `FORMAT`: format string according to which the metric will be output. Default: `# %d $METRIC`
* `INTERVAL`: amount of seconds to gather data. Default: 20
* `LAYOUT`: keyboard layout, to be able to only count letters and numbers. Currently supported are `qwerty` and `azerty`. If you have a different layout, please contribute a condition for it! See the script's source code. Use the special value `dontcare` to count all keys, not just letters and numbers. Default: `qwerty`
If after 20 seconds the value stays at 0 even though you're typing, you may have to configure the name of your keyboard. Change the setting `KEYBOARD_ID` (see Configuration below) in the script. You can find your keyboard description with `xinput list --short`.
## Module
```ini
[module/info-hackspeed]
type = custom/script
exec = ~/polybar-scripts/info-hackspeed.sh
tail = true
```

View File

@ -1,61 +0,0 @@
#!/bin/sh
KEYBOARD_ID="AT Translated Set 2 keyboard"
# cpm: characters per minute
# wpm: words per minute (1 word = 5 characters)
METRIC=cpm
FORMAT="%d $METRIC"
INTERVAL=20
# If you have a keyboard layout that is not listed here yet, create a condition
# yourself. $3 is the key index. Use `xinput test "AT Translated Set 2 keyboard"`
# to see key codes in real time. Be sure to open a pull request for your
# layout's condition!
LAYOUT=qwerty
case "$LAYOUT" in
qwerty) CONDITION='($3 >= 10 && $3 <= 19) || ($3 >= 24 && $3 <= 33) || ($3 >= 37 && $3 <= 53) || ($3 >= 52 && $3 <= 58)'; ;;
azerty) CONDITION='($3 >= 10 && $3 <= 19) || ($3 >= 24 && $3 <= 33) || ($3 >= 37 && $3 <= 54) || ($3 >= 52 && $3 <= 57)'; ;;
dontcare) CONDITION='1'; ;; # Just register all key presses, not only letters and numbers
*) echo "Unsupported layout \"$LAYOUT\""; exit 1; ;;
esac
# We have to account for the fact we're not listening a whole minute
multiply_by=60
divide_by=$INTERVAL
case "$METRIC" in
wpm) divide_by=$((divide_by * 5)); ;;
cpm) ;;
*) echo "Unsupported metric \"$METRIC\""; exit 1; ;;
esac
hackspeed_cache="$(mktemp -p '' hackspeed_cache.XXXXX)"
trap 'rm "$hackspeed_cache"' EXIT
# Write a dot to our cache for each key press
printf '' > "$hackspeed_cache"
xinput test "$KEYBOARD_ID" | \
stdbuf -o0 awk '$1 == "key" && $2 == "press" && ('"$CONDITION"') {printf "."}' >> "$hackspeed_cache" &
while true; do
# Ask the kernel how big the file is with the command `stat`. The number we
# get is the file size in bytes, which equals the amount of dots the file
# contains, and hence how much keys were pressed since the file was last
# cleared.
lines=$(stat --format %s "$hackspeed_cache")
# Truncate the cache file so that in the next iteration, we count only new
# keypresses
printf '' > "$hackspeed_cache"
# The shell only does integer operations, so make sure to first multiply and
# then divide
value=$((lines * multiply_by / divide_by))
printf "$FORMAT\\n" "$value"
sleep $INTERVAL
done

Binary file not shown.

Before

Width:  |  Height:  |  Size: 539 B

View File

@ -1,13 +0,0 @@
# Script: info-kernel
A script that shows the running kernel version.
## Module
```ini
[module/info-kernel]
type = custom/script
exec = uname -r
interval = 1024
```

View File

@ -1,17 +0,0 @@
# Script: info-pingrtt
A script that displays a ping result. It also shows a colored icon.
![info-pingrtt](screenshots/1.png)
![info-pingrtt](screenshots/2.png)
![info-pingrtt](screenshots/3.png)
## Module
```ini
[module/info-pingrtt]
type = custom/script
exec = ~/polybar-scripts/info-pingrtt.sh
interval = 10
```

View File

@ -1,19 +0,0 @@
#!/bin/sh
HOST=127.43.12.64
if ! ping=$(ping -n -c 1 -W 1 $HOST); then
echo "# ping failed"
else
rtt=$(echo "$ping" | sed -rn 's/.*time=([0-9]{1,})\.?[0-9]{0,} ms.*/\1/p')
if [ "$rtt" -lt 50 ]; then
icon="%{F#3cb703}#%{F-}"
elif [ "$rtt" -lt 150 ]; then
icon="%{F#f9dd04}#%{F-}"
else
icon="%{F#d60606}#%{F-}"
fi
echo "$icon $rtt ms"
fi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 878 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 989 B

View File

@ -1,15 +0,0 @@
# Script: info-projecthamster
This script displays Hamster Time Tracker information.
![info-projecthamster](screenshots/1.png)
## Module
```ini
[module/info-projecthamster]
type = custom/script
exec = ~/polybar-scripts/info-projecthamster.sh
interval = 5
```

View File

@ -1,9 +0,0 @@
#!/bin/sh
activity=$(hamster current 2> /dev/null | cut -d " " -f 3- | sed 's/@.* / - /')
if [ -n "$activity" ]; then
echo "$activity"
else
echo "No Activity"
fi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -1,15 +0,0 @@
# Script: info-redshift-temp
This script displays the current color temperature.
![info-redshift](screenshots/1.png)
## Module
```ini
[module/info-redshift-temp]
type = custom/script
exec = ~/polybar-scripts/info-redshift-temp.sh
interval = 5
```

View File

@ -1,15 +0,0 @@
#!/bin/sh
if [ "$(pgrep -x redshift)" ]; then
temp=$(redshift -p 2> /dev/null | grep temp | cut -d ":" -f 2 | tr -dc "[:digit:]")
if [ -z "$temp" ]; then
echo "%{F#65737E} #"
elif [ "$temp" -ge 5000 ]; then
echo "%{F#8FA1B3} #"
elif [ "$temp" -ge 4000 ]; then
echo "%{F#EBCB8B} #"
else
echo "%{F#D08770} #"
fi
fi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 B

View File

@ -1,25 +0,0 @@
# Script: info-softwarecounter
A script that counts the number of specified running software including GUIs and processes.
Options to only monitor GUI applications or only processes exist. Users can add their own applications or processes they wish to watch simply by updating the existing dictionaries at the start of the script.
Arbitrary program counts can be combined, for example, the vim/nvim or chrome/chromium counts can be added together and the total displayed.
![info-softwarecounter](screenshots/1.png)
## Dependencies
* `wmctrl`
* `pgrep`
## Module
```
[module/info-softwarecounter]
type = custom/script
exec = ~/polybar-scripts/info-softwarecounter.py
interval = 10
```

View File

@ -1,145 +0,0 @@
#!/usr/bin/env python3
import subprocess
import sys
from collections import Counter, OrderedDict
# update GUIs
GUI = True
# update processes
PROCESS = True
# program/process names and corresponding gylphs
guis = OrderedDict({
'terminals': '#',
'chromes': '#',
'firefox': '#',
'skypeforlinux': '#',
'filemanager': '#',
'remote-desktop': '#',
'pdfviewer': '#',
'image': '#',
})
processes = OrderedDict({
'vims': '#',
'ssh': '#',
'updater': '#',
})
# combine counts of program/process names in the tuple
# the resulting glpyh used will be that of the corresponding key
combine_guis = {
'terminals': ('termite', 'terminator', 'urxvt'),
'chromes': ('chromium', 'chrome'),
'filemanger': ('nemo', 'thunar', 'dolphin', 'nautilus', 'pcmanfm'),
'remote-desktop': ('TeamViewer', ),
'pdfviewer': ('evince', 'okular', 'zathura'),
'image': ('gthumb', 'shotwell', 'deepin-image-vi'),
}
combine_proccesses = {
'vims': ('nvim', 'vim'),
'updater': ('pacman', 'yay', 'trizen', 'yaourt'),
}
gui_output = ''
process_output = ''
if GUI:
def get_running_guis():
try:
listed = sys.argv[1]
except IndexError:
listed = []
get = lambda cmd: subprocess.check_output(cmd).decode("utf-8").strip()
def check_wtype(w_id):
# check the type of window, only list "NORMAL" windows
return "_NET_WM_WINDOW_TYPE_NORMAL" in get(["xprop", "-id", w_id])
def get_process(w_id):
# get the name of the process, owning the window
proc = get(["ps", "-p", w_id, "-o", "comm="])
return proc
wlist = [l.split() for l in subprocess.check_output(["wmctrl", "-lp"])\
.decode("utf-8").splitlines()]
validprocs = [
get_process(w[2]) for w in wlist if check_wtype(w[0]) == True
]
return validprocs
# get list of running GUI programs
gui_counts = Counter(get_running_guis())
# combine programs in program combine list
for k, lst in combine_guis.items():
count = 0
for i in lst:
try:
count += gui_counts.pop(i)
except KeyError:
pass
if count:
gui_counts[k] += count
# generate program output
for k, v in guis.items():
try:
c = gui_counts[k]
if c:
gui_output += '%s %i ' % (v, c)
except:
pass
if PROCESS:
def get_running_proc(process_name_list):
counts = [None] * len(process_name_list)
for i, p in enumerate(process_name_list):
try:
count = int(
subprocess.check_output(['pgrep', '-c', '-x',
p]).decode('utf-8'))
except subprocess.CalledProcessError:
count = 0
counts[i] = (p, count)
return dict(counts)
# count running proccesses
process_counts = get_running_proc(processes.keys())
combine_counts = get_running_proc(
list(sum(combine_proccesses.values(), ())))
process_counts.update(combine_counts)
# combine processes in process combine list
for k, lst in combine_proccesses.items():
count = 0
for i in lst:
try:
count += process_counts.pop(i)
except KeyError:
pass
if count:
process_counts[k] += count
# generate process output
for k, v in processes.items():
try:
c = process_counts[k]
if c:
process_output += '%s %i ' % (v, c)
except:
pass
print(gui_output + process_output)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

View File

@ -1,20 +0,0 @@
# Script: info-ssh-sessions
A script that displays the count of current ssh sessions as well as the public IP address of the fist session.
![info-ssh-sessions](screenshots/1.png)
## Dependencies
* `lsof`
## Module
```ini
[module/info-ssh-sessions]
type = custom/script
exec = ~/polybar-scripts/info-ssh-sessions.sh
interval = 5
```

View File

@ -1,10 +0,0 @@
#!/bin/sh
sessions="$(lsof -Pi | grep ":22")"
if [ ! -z "$sessions" ]; then
count=$(echo "$sessions" | wc -l)
echo "# ($count): $(echo "$sessions" | cut -d ">" -f 2 | cut -d " " -f 1 | cut -d ":" -f 1 | tail -n 1)"
else
echo "# (0)"
fi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -1,15 +0,0 @@
# Script: info-todotxt
A script that shows todo.txt items due. The first column shows items due today, and the second column shows items due this week (including today).
![todotxt](screenshots/1.png)
## Module
```ini
[module/info-todotxt]
type = custom/script
exec = ~/polybar-scripts/info-todotxt.sh
interval = 60
```

View File

@ -1,16 +0,0 @@
#!/bin/sh
duetoday=$(grep "due:$(date -I)" ~/todo.txt | grep -c -v "x")
dueweek=0
weekday=0
while [ "$weekday" -le 7 ]; do
dueweek=$((dueweek + $(grep "due:$(date -I --date="$weekday day")" ~/todo.txt | grep -c -v "x")))
weekday=$(( weekday + 1 ))
done
if [ "$dueweek" -gt 0 ]; then
echo "#1 $duetoday $dueweek"
else
echo "#2"
fi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 994 B

View File

@ -1,16 +0,0 @@
# Script: info-trash
This script count the files in you trash directory.
![info-trash](screenshots/1.png)
## Module
```ini
[module/info-trash]
type = custom/script
exec = ~/polybar-scripts/info-trash.sh
interval = 60
click-left = ~/polybar-scripts/info-trash.sh --clean
```

View File

@ -1,13 +0,0 @@
#!/bin/sh
case "$1" in
--clean)
rm -rf ~/.local/share/Trash/files
rm -rf ~/.local/share/Trash/info
mkdir ~/.local/share/Trash/files
mkdir ~/.local/share/Trash/info
;;
*)
find ~/.local/share/Trash/files/ -maxdepth 1 | wc -l
;;
esac

Binary file not shown.

Before

Width:  |  Height:  |  Size: 540 B

View File

@ -1,37 +0,0 @@
# Script: info-twitch-countdown
This script pulls the time a live streamer is streaming from their Streamlabs countdown on their twitch page.
Please note that because Streamlabs does not have a public API, a Chromium process is launched to gather the information. This will use about 250 MiB of memory for a few seconds every hour. You can also include multiple instances of this on your bar to view the stream times of multiple twitch streamers.
![info-twitch-countdown](screenshots/1.png)
![info-twitch-live](screenshots/2.png)
## Dependencies
* `chromium`
* `jq`
* [cyrus-and/chrome-har-capturer](https://github.com/cyrus-and/chrome-har-capturer)
## Configuration
Get a Twitch Client ID:
* Go to [twitch.tv/console/apps/create](https://glass.twitch.tv/console/apps/create) and sign in
* Login, then go to `Apps` > `Register`
* Use any name and category, and set OAuth Redirect URL to `http://localhost`
* Click Manage on the application, and copy the Client ID from the end of the URL or from the box
If you want to be hide the seconds on the counter, you may comment the "showSeconds" line in the script. Please note that you may experience 10-20 seconds pauses every hour when the countdown updates.
## Module
```ini
[module/info-twitch-countdown]
type = custom/script
exec = ~/polybar-scripts/info-twitch-countdown.sh <streamer username>
tail = true
```

View File

@ -1,68 +0,0 @@
#!/bin/bash
streamer="$1" # You may change this to the streamer's username to override the command line argument.
filePath=""
clientId=
showSeconds=":%S" # Uncomment to hide seconds in countdown
function checkLive() {
while [[ $(curl -s https://api.twitch.tv/helix/streams?user_login="$streamer" -H "Client-ID: $clientId" | jq '.data[] | select(.type=="live")') ]]; do
echo "#1 LIVE"
sleep 10
done
}
function updateAuth() {
chromium --remote-debugging-port=9222 --headless >/dev/null 2>&1 & disown
sleep .1
chrome-har-capturer -f -c -g 7500 -o "$filePath/$streamer.har" https://twitch.tv/"$streamer" >/dev/null 2>&1
kill -1 "$(pgrep -f 'chromium --remote-debugging-port=9222 --headless')"
}
function checkReauth() {
if [[ ! -f "$filePath/$streamer.har" || "$(($(date +%s)-$(date +%s -r "$filePath/$streamer.har")))" -gt 3300 ]]; then
updateAuth
fi
}
function updateData() {
auth=$(jq -r '.["log"]["entries"][]["request"] | select(.url=="https://xt.streamlabs.com/api/v5/twitch-extensions/countdown/settings") | select(.method=="GET") | .["headers"][] | select(.name=="authorization") | .value' "$filePath/$streamer.har")
countdownData=$(curl -s https://xt.streamlabs.com/api/v5/twitch-extensions/countdown/settings -H "Authorization: $auth")
days=$(echo "$countdownData" | jq -r '.["enabled"] | keys[] as $k | "\($k), \(.[$k])" | select(endswith("true"))' | cut -d ',' -f1)
[[ -n "$1" ]] && days=$(echo "$days" | sed "/$1/d")
closestDay="8days"
for i in $days; do
dayUnixTime=$(date +%s --date="$i")
if [[ "$dayUnixTime" -lt "$(date +%s --date=$closestDay)" ]]; then
closestDay="$i"
fi
done
hour=$(echo "$countdownData" | jq -r ".[\"$closestDay\"][][\"HH\"]")
minute=$(echo "$countdownData" | jq -r ".[\"$closestDay\"][][\"mm\"]")
timeZone=$(echo "$countdownData" | jq '.["timezone"]')
streamTime=$(date +%s --date="TZ=$timeZone $closestDay $hour:$minute")
[[ "$(date +%s)" -gt "$streamTime" ]] && updateData "$closestDay"
}
function main() {
while [[ "$streamTime" -ge "$(date +%s)" ]]; do
daysUntil="$(((streamTime - $(date +%s))/86400)):"
[[ "$daysUntil" == "0:" ]] && daysUntil=
countdown="$(date -u --date @$((streamTime - "$(date +%s)")) +$daysUntil%H:%M"$showSeconds")"
echo "#2 $countdown"
[ $(($(date +%s) % 10)) -eq 0 ] && checkLive
checkReauth
sleep 1
done
checkLive
updateAuth
updateData
main
}
checkLive
updateAuth
updateData
main

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -1,20 +0,0 @@
# Script: info-wifionice
This script shows some information about the current ICE train of Deutsche Bahn. It requests the data from the local information portal and was obviously hacked in a train.
![info-wifionice](screenshots/1.png)
## Dependencies
* You have to be logged in to the local SSID `WIFIonICE`.
## Module
```ini
[module/info-wifionice]
type = custom/script
exec = ~/polybar-scripts/info-wifionice.sh
interval = 10
```

View File

@ -1,30 +0,0 @@
#!/bin/sh
wifionice=$(curl -sf https://iceportal.de/api1/rs/status)
if [ "$(echo "$wifionice" | jq .connection)" = "true" ]; then
wifionice_speed=$(echo "$wifionice" | jq .speed)
if [ "$wifionice_speed" -ne 0 ]; then
wifionice_speed="$wifionice_speed km/h"
else
wifionice_speed=""
fi
station=$(curl -sf https://iceportal.de/api1/rs/tripInfo/trip | jq '[.[].stops[]? | select(.info.passed == false)][0]')
station_name=$(echo "$station" | jq -r '.station.name')
station_track=$(echo "$station" | jq -r '.track.actual')
station_arrival=$(echo "$station" | jq -r '.timetable.scheduledArrivalTime')
station_arrival=$(date --date="@$((station_arrival / 1000))" +%H:%M)
station_delay=$(echo "$station" | jq -r '.timetable.arrivalDelay')
if [ ! -z "$station_delay" ]; then
station_delay=" %{F#d60606}($station_delay)%{F-}"
else
station_delay=""
fi
echo "# $station_arrival$station_delay - $station_name, Gl. $station_track - $wifionice_speed"
fi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -1,21 +0,0 @@
# Script: info-wmname
This script prints the value of the window manager name property of the root window.
The BSPWM window manger, and maybe some more, has some problems with java scaling. To solve this you can [set the value of the window manager name property](https://wiki.archlinux.org/index.php/java#Impersonate_another_window_manager) to something different.
## Dependencies
* `wmname`
## Module
```ini
[module/info-wmname]
type = custom/script
exec = ~/polybar-scripts/info-wmname.sh
interval = 5
click-left = ~/polybar-scripts/info-wmname.sh --toggle
```

View File

@ -1,15 +0,0 @@
#!/bin/sh
case "$1" in
--toggle)
if [ "$(wmname)" != "BSPWM" ]; then
wmname BSPWM
else
wmname LG3D
fi
;;
*)
wmname=$(wmname)
echo "# $wmname"
;;
esac

View File

@ -1,24 +0,0 @@
# Script: info-xampp
The Script prints the status of [XAMPP](https://www.apachefriends.org/de/index.html) services (Apache, MySQL, ProFTPD) if they are running.
![info-xampp](screenshots/1.png)
## Configuration
You may need to add `xampp` command to the `/etc/sudoers` NOPASSWD of your user:
```ini
user ALL=(ALL) NOPASSWD: /opt/lampp/xampp
```
## Module
```ini
[module/info-xampp]
type = custom/script
exec = ~/polybar-scripts/info-xampp.sh
interval = 10
```

View File

@ -1,21 +0,0 @@
#!/bin/sh
if sudo /opt/lampp/xampp status | grep -q "Apache is running."; then
status_apache="#11"
else
status_apache="#12"
fi
if sudo /opt/lampp/xampp status |grep -q "MySQL is running."; then
status_mysql="#21"
else
status_mysql="#22"
fi
if sudo /opt/lampp/xampp status | grep -q "ProFTPD is running."; then
status_ftp="#31"
else
status_ftp="#32"
fi
echo "$status_apache $status_mysql $status_ftp"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -1,13 +0,0 @@
# Script: isactive-bluetooth
A script that shows if bluetooth is on or off.
## Module
```ini
[module/isactive-bluetooth]
type = custom/script
exec = ~/polybar-scripts/isactive-bluetooth.sh
interval = 10
```

View File

@ -1,7 +0,0 @@
#!/bin/sh
if [ "$(systemctl is-active bluetooth.service)" = "active" ]; then
echo "#1"
else
echo "#2"
fi

View File

@ -1,16 +0,0 @@
# Script: isrunning-claudius
A tiny module to report the state of claudius, the alternative filepicker for Discord.
Left click launches or closes claudius.
## Module
```ini
[module/isrunning-claudius]
type = custom/script
exec = ~/polybar-scripts/isrunning-claudius.sh
interval = 5
click-left = ~/polybar-scripts/isrunning-claudius --toggle
```

View File

@ -1,18 +0,0 @@
#!/bin/sh
case "$1" in
--toggle)
if [ "$(pgrep claudius)" ]; then
pkill claudius
else
claudius &
fi
;;
*)
if [ "$(pgrep claudius)" ]; then
echo "#1"
else
echo "#2"
fi
;;
esac

View File

@ -1,14 +0,0 @@
# Script: isrunning-compton
A simple script that allows you to toggle compton and shows if it is running.
## Module
```ini
[module/isrunning-compton]
type = custom/script
exec = ~/polybar-scripts/isrunning-compton.sh
interval = 5
click-left = ~/polybar-scripts/isrunning-compton.sh --toggle
```

View File

@ -1,18 +0,0 @@
#!/bin/sh
case "$1" in
--toggle)
if [ "$(pgrep -x compton)" ]; then
pkill compton
else
compton -b --config ~/.config/compton/config
fi
;;
*)
if [ "$(pgrep -x compton)" ]; then
echo "#1"
else
echo "#2"
fi
;;
esac

View File

@ -1,14 +0,0 @@
# Script: dropbox-isrunning
A script that shows if the dropbox client is running. You can also start and stop the client.
## Module
```ini
[module/dropbox-isrunning]
type = custom/script
exec = ~/polybar-scripts/dropbox-isrunning.sh
interval = 5
click-left = ~/polybar-scripts/dropbox-isrunning.sh --toggle
```

View File

@ -1,18 +0,0 @@
#!/bin/sh
case "$1" in
--toggle)
if [ "$(pgrep dropbox)" ]; then
pkill -f dropbox
else
dropbox &
fi
;;
*)
if [ "$(pgrep dropbox)" ]; then
echo "#1"
else
echo "#2"
fi
;;
esac

View File

@ -1,14 +0,0 @@
# Script: isrunning-offlineimap
A script that shows if offlineimap is running. The scripts require you to have setup offlineimap yourself.
## Module
```ini
[module/offlineimap-isrunning]
type = custom/script
exec = ~/polybar-scripts/offlineimap-isrunning.sh
interval = 5
click-left = ~/polybar-scripts/offlineimap-isrunning.sh --toggle
```

View File

@ -1,18 +0,0 @@
#!/bin/sh
case "$1" in
--toggle)
if [ "$(pgrep offlineimap)" ]; then
pkill -f offlineimap
else
nohup offlineimap > /tmp/offlineimap.log &
fi
;;
*)
if [ "$(pgrep offlineimap)" ]; then
echo "#1 Online"
else
echo "#2 Offline"
fi
;;
esac

View File

@ -1,18 +0,0 @@
# Script: news-archlinux
A Python script that shows Arch Linux RSS news.
## Dependencies
* [python-feedparser](https://github.com/kurtmckee/feedparser//)
## Module
```ini
[module/news-archlinux]
type = custom/script
exec = ~/polybar-scripts/news-archlinux.py
interval = 600
```

View File

@ -1,12 +0,0 @@
#!/usr/bin/python
import feedparser
from subprocess import call
import re
import textwrap
d = feedparser.parse("https://www.archlinux.org/feeds/news/")
for f in range(0, 1):
print(d.entries[f].title)
xy = d.entries[f].title

View File

@ -1,23 +0,0 @@
# Script: notification-chess
A small script that indicates whether you need to move.
![notification-chess](screenshots/1.png)
## Dependencies
* `curl`
* `jq`
* obviously a chess.com account
## Module
```ini
[module/notification-chess]
type = custom/script
exec = ~/polybar-scripts/notification-chess.sh
interval = 10
click-left = xdg-open https://www.chess.com/goto_ready_game & disown
```

View File

@ -1,10 +0,0 @@
#!/bin/sh
username=""
games=$(curl -sf "https://api.chess.com/pub/player/$username/games/to-move" | jq ".[] | length")
if [ "$games" -gt 0 ]; then
echo "#1 $games"
else
echo "#2"
fi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 661 B

View File

@ -1,24 +0,0 @@
# Script: notification-github
A small script that shows your GitHub notifications.
## Dependencies
* `curl`
* `jq`
## Configuration
Generate a token at `GitHub Settings` > `Developer settings` > `Personal access tokens`.
## Module
```ini
[module/notification-github]
type = custom/script
exec = ~/polybar-scripts/notification-github.sh
interval = 60
```

View File

@ -1,11 +0,0 @@
#!/bin/sh
TOKEN="1234567890"
notifications=$(curl -fs https://api.github.com/notifications?access_token=$TOKEN | jq ".[].unread" | grep -c true)
if [ "$notifications" -gt 0 ]; then
echo "# $notifications"
else
echo ""
fi

View File

@ -1,24 +0,0 @@
# Script: notification-mattermost
A small script that shows your unread Mattermost messages and mentions.
## Dependencies
* `curl`
* `jq`
## Configuration
Generate a token at `Account Settings` > `Security` > `Personal Access Tokens`. You have to enable tokens in your server config.
## Module
```ini
[module/notification-mattermost]
type = custom/script
exec = ~/polybar-scripts/notification-mattermost.sh
interval = 60
```

Some files were not shown because too many files have changed in this diff Show More