Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
Jack L. Frost 2017-05-03 16:10:13 +03:00
commit c78cb78ff0
72 changed files with 3570 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
homedir/.vim/.netrwhist
homedir/.vim/syntax
homedir/.bashrc.d/99-local
homedir/.config/zsh.d/local
homedir/.ncmpcpp/error.log

23
homedir/.Xresources Normal file
View File

@ -0,0 +1,23 @@
! Xft settings ---------------------------------------------------------------
Xft.dpi: 95
!Xft.antialias: true
!Xft.rgba: rgb
!Xft.hinting: true
!Xft.hintstyle: hintslight
! rofi
rofi.key-run: Mod4+r
rofi.lines: 3
rofi.bw: 2
rofi.separator-style: solid
rofi.hide-scrollbar: true
rofi.glob: true
rofi.width: 33
rofi.bc: #467EC2
rofi.fg: #f9f9f9
rofi.bg: #29303A
rofi.hlbg: #467EC2
rofi.font: Terminus 12
rofi.opacity: 85

44
homedir/.bashrc Normal file
View File

@ -0,0 +1,44 @@
# vim: ft=sh
# Do nothing if not interactive
[[ "$PS1" ]] || return
# Modules
mpath=( $HOME/.config/bash.d )
function msg { printf '%s\n' "$*"; }
function err { printf '%s\n' "$*" >&2; }
function use {
while (( $# )); do
case $1 in
(-n) flag_nofail=1;;
(--) shift; break;;
(*) break;;
esac
shift
done
declare mname=$1
for p in "${mpath[@]}"; do
if [[ -f "$mpath/$mname" ]]; then
if source "$mpath/$mname"; then
msg "Loaded: $mname"
else
err "Something went wrong while loading $mname"
(( flag_nofail )) || return 1
fi
else
err "Module $mname not found"
(( flag_nofail )) || return 1
fi
done
return 0
}
use common
use colours
use config
use -n local
use prompt

View File

@ -0,0 +1,30 @@
# Colours
# Console colours
# Black 0;30 Dark Gray 1;30
# Blue 0;34 Light Blue 1;34
# Green 0;32 Light Green 1;32
# Cyan 0;36 Light Cyan 1;36
# Red 0;31 Light Red 1;31
# Purple 0;35 Light Purple 1;35
# Brown 0;33 Yellow 1;33
# Light Gray 0;37 White 1;37
c_black="\[\033[0;30m\]"
c_blue="\[\033[0;34m\]"
c_green="\[\033[0;32m\]"
c_cyan="\[\033[0;36m\]"
c_red="\[\033[0;31m\]"
c_purple="\[\033[0;35m\]"
c_brown="\[\033[0;33m\]"
c_lightgray="\[\033[0;37m\]"
c_darkgray="\[\033[1;30m\]"
c_lightblue="\[\033[1;34m\]"
c_lightgreen="\[\033[1;32m\]"
c_lightcyan="\[\033[1;36m\]"
c_lightred="\[\033[1;31m\]"
c_lightpurple="\[\033[1;35m\]"
c_yellow="\[\033[1;33m\]"
c_white="\[\033[1;37m\]"
c_reset="\[\e[00m\]"

View File

@ -0,0 +1,41 @@
#!/bin/bash
echo() { printf '%s\n' "$*"; }
msg() { printf '%s\n' "$*"; }
err() { printf '%s\n' "$*" >&2; }
set_title() { printf '\033]0;%s\007' "$1"; }
trap_error() { err "The command has returned a non-zero exit code ($?)."; }
x() { exec xinit -- -nolisten tcp vt9; }
is_coreutils() {
declare out
out=$( df --version 2>/dev/null )
(( $? )) && {
err 'df --version exited with an error. This is not GNU coreutils'
return 3
}
[[ "$out" =~ 'GNU coreutils' ]] || {
err 'Version output does not contain "GNU coreutils". This is not GNU coreutils.'
return 1
}
}
fuck() { sudo $(history -p \!\!); }
err() { printf '%s\n' "$*"; }
is_function() {
[[ $(type -t "$1") == 'function' ]]
}
if is_coreutils; then
ls() { $(type -P ls) -l -hb --group-directories-first --color=auto "$@"; }
mv() { $(type -P mv) -v "$@"; }
cp() { $(type -P cp) -v "$@"; }
rm() { $(type -P rm) -v "$@"; }
fi

View File

@ -0,0 +1,28 @@
# BASH options
bash_opts=(
'checkwinsize' 'histappend' 'autocd'
'checkhash'
)
shopt -s "${bash_opts[@]}"
shopt -u sourcepath
PROMPT_COMMAND='set_prompt'
HISTCONTROL="$HISTCONTROL${HISTCONTROL+,}ignoredups"
HISTCONTROL='ignoreboth'
# Environment
export LC_ALL='en_US.UTF-8'
export EDITOR='editor'
export WINEARCH='win32'
# GPG
GPG_TTY=$(tty)
export GPG_TTY
#export TERM='xterm-256color'
export COLORTERM='xterm-256color'
# Specific to this setup
alias dotfiles_pull='git -C ~/git/dotfiles pull'
alias dotfiles_push='git -C ~/git/dotfiles commit -a; git -C ~/git/dotfiles push'

View File

@ -0,0 +1,3 @@
# SSH
SSH_AUTH_SOCK="/tmp/${USER}-ssh-auth.sock"
export SSH_AUTH_SOCK

View File

@ -0,0 +1,75 @@
#!/bin/bash
set_prompt() {
last_exitcode="$?"
declare checkmark fancy_x timestamp git_prompt_msg git_status_short git_status_colour git_unstaged git_untracked
PS1="${c_reset}"
# Set a fancy symbol to indicate the last exitcode
if (( last_exitcode )); then
last_exitcode_indicator="${c_red}!${c_reset}"
else
last_exitcode_indicator="${c_green}.${c_reset}"
fi
# Set the username colour
if (( UID )); then
user_colour="${c_green}"
user_indicator='$'
else
user_colour="${c_red}"
user_indicator='#'
fi
user_indicator='>'
# Set the git prompt message
git rev-parse --git-dir &>/dev/null && {
git_current_branch="$(git rev-parse --abbrev-ref HEAD)"
while read; do
case "$REPLY" in
(' M'*|A*|D*) git_unstaged=1;;
(\?\?*) git_untracked=1;;
esac
done < <( git status --short )
(( git_unstaged )) && {
git_status_short+='c'
git_status_colour="${c_red}"
}
(( git_untracked )) && {
git_status_short+='f'
git_status_colour="${c_red}"
}
git_status_short=${git_status_short:-ok}
git_status_colour=${git_status_colour:-"${c_green}"}
git_prompt_msg="(${c_cyan}$git_current_branch${c_reset}[${git_status_colour}${git_status_short}${c_reset}]) "
}
set_title "${USER}@${HOSTNAME}"
if [[ "$PWD" == "$HOME" ]]; then
prompt_pwd='~'
elif [[ "$PWD" =~ ^"$HOME" ]]; then
prompt_pwd="~/${PWD##*${HOME}/}"
else
prompt_pwd="$PWD"
fi
prompt=(
"${c_reset}"
"[${last_exitcode_indicator}]"
"${user_colour}${USER}${c_reset}@${c_lightblue}${HOSTNAME}"
"$prompt_pwd"
"${git_prompt_msg}${user_colour}${user_indicator}"
"$c_reset"
)
PS1="${prompt[@]}"
}

View File

@ -0,0 +1,9 @@
#!/usr/bin/bash
while read -r _ _ did wid _; do
for d in "$@"; do
if [[ $d == "$did" ]]; then
bspc node "$wid" -t floating
fi
done
done < <( bspc subscribe node_manage )

View File

@ -0,0 +1,45 @@
#!/usr/bin/bash
usage() {
printf 'No help available'
}
main() {
while (( $# )); do
case "$1" in
(-h) usage;;
(-d) desktop=$2; shift;;
(--) shift; break;;
(*) break;;
esac
shift
done
setting=$1
shift
desktop=${desktop:-"focused"}
case "$setting" in
(padding)
if [[ "$1" =~ ^(north|west|south|east)$ ]]; then
direction=$1
fi
if [[ "$direction" ]]; then
bspc config -d "$desktop" "${direction}_padding" "$1"
else
for d in top bottom right left; do
bspc config -d "$desktop" "${d}_padding" "$1"
done
fi
;;
(gaps)
bspc config -d "$desktop" window_gap "$1"
;;
esac
}
main "$@"

View File

@ -0,0 +1,43 @@
#!/usr/bin/bash
ensure_dir() {
declare d
for d in "$@"; do
if ! [[ -d "$d" ]]; then
if ! mkdir -p "$d"; then
return $?
fi
fi
done
return 0
}
# Set XDG_RUNTIME_DIR
if ! [[ "$XDG_RUNTIME_DIR" ]]; then
XDG_RUNTIME_DIR="/run/user/$UID"
fi
# Define some workdirs
bspwm_rundir="$XDG_RUNTIME_DIR/bspwm"
bspwm_statedir="$bspwm_rundir/state"
# Ensure the workdirs exist
ensure_dir "$bspwm_rundir" "$bspwm_statedir" || exit $?
case "$1" in
(save)
# Save state
bspc query -T > "$bspwm_statedir/tree"
bspc query -H > "$bspwm_statedir/hist"
bspc query -S > "$bspwm_statedir/stack"
;;
(restore)
# Restore state, if any
[[ -f "$bspwm_statedir/tree" ]] && bspc restore -T "$bspwm_statedir/tree"
[[ -f "$bspwm_statedir/hist" ]] && bspc restore -H "$bspwm_statedir/hist"
[[ -f "$bspwm_statedir/stack" ]] && bspc restore -S "$bspwm_statedir/stack"
;;
esac

67
homedir/.config/bspwm/bspwmrc Executable file
View File

@ -0,0 +1,67 @@
#!/usr/bin/env bash
nullexec() {
"$@" &>/dev/null
}
PATH+=":$HOME/.config/alternatives"
PATH+=":$HOME/.config/bspwm/bin"
# Cursor for the root window
xsetroot -cursor_name left_ptr
# Global config
bspc config focused_sticky_border_color "#030061"
bspc config focused_border_color "#467EC2"
bspc config normal_border_color "#1f1f1f"
bspc config urgent_border_color "#f9f9f9"
bspc config window_gap "9"
bspc config border_width '2'
bspc config split_ratio '0.52'
bspc config borderless_monocle 'false'
bspc config gapless_monocle 'false'
bspc config focus_by_distance 'true'
bspc config ignore_ewmh_focus 'true'
bspc config initial_polarity 'second_child'
bspc config auto_cancel 'true'
bspc config click_to_focus 'true'
# Workspaces and monitors
bspc monitor -d 1 2 3 4 5 6 7 8 9 h
# Float some bastards
bspfloat 1 &
# Individual padding
for d in 1 3; do
bspset -d "$d" padding 48
done
# Clear the rules before adding any
while read -r rule _; do bspc rule -r "$rule"; done < <(bspc rule -l)
# Now add the rules
bspc rule -a Steam state=floating desktop=^8
bspc rule -a Firefox:Navigator state=tiled desktop=^2
bspc rule -a \*:Hearthstone.exe desktop=^5
bspc rule -a \* state=floating
# start some services
services=( sxhkd dunst )
for s in "${services[@]}"; do
if ! service "$s" status; then
service "$s" start
fi
done
# Always restart the panel
service moltenbar restart
nullexec browser &
nullexec terminal &
nullexec telegram &
nullexec dropbox &
terminal -e 'ssh-add-all' &
terminal -e 'sudo wrkvpn' &

View File

@ -0,0 +1,72 @@
#
# bspwm hotkeys
#
super + {_,shift + } w
bspc node {-c,-k}
super + q
bspc node -t '~fullscreen'
super + {j,k}
bspc node -f {next,prev}.local
control + {h,j,k,l}
bspc node {@east -r -32,@south -r +32,@south -r -32,@east -r +32}
super + {_,shift + } space
bspc node -t '~'{tiled,floating}
super + Return
bspc node -s biggest
super + {1-9,h}
bspc desktop -f {1-9,h}
super + shift + {1-9,h}
bspc node -d {1-9,h}
super + m
bspc monitor -f next
super + shift + m
bspc node -m next
super + t
bspc desktop -l next
super + shift + t
bspc node -t '~pseudo_tiled'
super + x
terminal
super + {r,u,p}
dmenu-extras -l 9 {run,bmark,pass}
super + z
ssm lockd lock
Print
snap -f
super + {Left,Up,Right,Down}
bspc node --presel-dir '~'{west,north,east,south}
super + {_,shift + } c
win-hd-center {1280x720,854x480}
super + {a,s,n,p}
mpc {play,stop,next,prev}
super + bracketright
bspc node '@/' -R 90
super + f
bspc rule -a \* -o state=floating
super + XF86AudioLowerVolume
amixer -c 0 set PCM 2dB-
super + XF86AudioRaiseVolume
amixer -c 0 set PCM 2dB+

View File

@ -0,0 +1,8 @@
# vim: ft=sh
colour_fg='#f9f9f9'
colour_fg_active=$colour_fg
colour_bg='#1f1f1f'
colour_bg_active='#467EC2'
colour_urgent='#f9f9f9'

View File

@ -0,0 +1 @@
common_x_fontspec='-*-terminesspowerline-medium-*-normal-*-14-*-*-*-*-*-iso10646-*'

View File

@ -0,0 +1,246 @@
[global]
font = xos4 Terminus 12
# Allow a small subset of html markup:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
# If markup is not allowed, those tags will be stripped out of the
# message.
allow_markup = yes
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# Markup is allowed
format = "<b>%s</b>\n%b"
# Sort messages by urgency.
sort = yes
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = yes
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# The frequency with wich text that is longer than the notification
# window allows bounces back and forth.
# This option conflicts with "word_wrap".
# Set to 0 to disable.
bounce_freq = 0
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Split notifications into multiple lines if they don't fit into
# geometry.
word_wrap = yes
# Ignore newlines '\n' in notifications.
ignore_newline = no
# The geometry of the window:
# [{width}]x{height}[+/-{x}+/-{y}]
# The geometry of the message window.
# The height is measured in number of notifications everything else
# in pixels. If the width is omitted but the height is given
# ("-geometry x2"), the message window expands over the whole screen
# (dmenu-like). If width is 0, the window expands to the longest
# message displayed. A positive x is measured from the left, a
# negative from the right side of the screen. Y is measured from
# the top and down respectevly.
# The width can be negative. In this case the actual width is the
# screen width minus the width defined in within the geometry option.
geometry = "500x32-710+32"
# Shrink window if it's smaller than the width. Will be ignored if
# width is 0.
shrink = no
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing windowmanager is
# present (e.g. xcompmgr, compiz, etc.).
transparency = 25
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
idle_threshold = 120
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a windowmanager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern windowmanagers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = mouse
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 20
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
# The height of a single line. If the height is smaller than the
# font height, it will get raised to the font height.
# This adds empty space above and under the text.
line_height = 0
# Draw a line of "separatpr_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 2
# Padding between text and separator.
padding = 8
# Horizontal padding.
horizontal_padding = 8
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = frame
# Print a notification on startup.
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = true
# dmenu path.
dmenu = /usr/bin/dmenu -p dunst:
#dmenu = /usr/bin/rofi -dmenu
# Browser for opening urls in context menu.
browser = /usr/bin/firefox -new-tab
# Align icons left/right/off
icon_position = off
# Paths to default icons.
icon_folders = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
[frame]
width = 2
color = "#467EC2"
[shortcuts]
# Shortcuts are specified as [modifier+][modifier+]...key
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
# Xev might be helpful to find names for keys.
# Close notification.
close = ctrl+space
# Close all notifications.
close_all = ctrl+shift+space
# Redisplay last message(s).
# On the US keyboard layout "grave" is normally above TAB and left
# of "1".
history = mod4+d
# Context menu.
context = mod4+shift+d
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#1f1f1f"
foreground = "#f9f9f9"
timeout = 10
[urgency_normal]
background = "#1f1f1f"
foreground = "#f9f9f9"
timeout = 10
[urgency_critical]
background = "#78090C"
foreground = "#f9f9f9"
timeout = 0
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
# Messages can be matched by "appname", "summary", "body", "icon", "category",
# "msg_urgency" and you can override the "timeout", "urgency", "foreground",
# "background", "new_icon" and "format".
# Shell-like globbing will get expanded.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format
# to "".
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# format = ""
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
# vim: ft=cfg

View File

@ -0,0 +1,12 @@
#!/usr/bin/zsh
frozenbar_cfgdir="$XDG_CONFIG_HOME/frozenbar"
declare e cmd position=1
declare -a cmds
while IFS=':' read -r name _ cmd args; do
cmds+=( "$cmd" ${(s: :)args} )
done < "$frozenbar_cfgdir/rc.d/simple_launcher.rc"
$cmds[$1]

View File

@ -0,0 +1 @@
/home/fbt/git/frozenbar/mod

View File

@ -0,0 +1,139 @@
# vim: ft=zsh
# Which modules to load
mods=(
bspwm_desktop_pager
bspwm_taskbar
network_status
date
load
)
# Define the *look* of your panel here
function panel_draw {
panel_data=(
"$out[bspwm_desktop_pager]"
"$out[bspwm_taskbar]"
"%{r}"
"%{F$panel_bg_focused}%{F-}%{B$panel_bg_focused}"
""
"LA: $out[load]"
""
"Network: $out[network_status]"
" "
"$out[date]"
""
"%{B-}"
)
printf '%s\n' "$panel_data"
}
function panel_pre_start {
# Set bspwm top padding
bspc config top_padding "$(( panel_h + bspwm_window_gap ))"
}
function panel_post_start {
# Set the layer on which lemonbar resides
xdo above -t $( xdo id -n root ) $( xdo id -a $panel_window_name )
}
function panel_cleanup_misc {
# Reset bspwm top padding
bspc config top_padding 0
}
# General config
# ==============
# fifo location
#panel_fifo="$XDG_RUNTIME_DIR/frozenbar.fifo"
# Window name
panel_window_name='frozenbar'
## Colours
# I source a common config so that all my scripts share the same colours
source ~/.config/common/colours
panel_fg_normal=$colour_fg
panel_fg_focused=$colour_fg_active
panel_bg_normal=$colour_bg
panel_bg_focused=$colour_bg_active
## Fonts
panel_fontspec='-*-terminesspowerline-medium-*-normal-*-14-*-*-*-*-*-iso10646-*'
## Get root window data to automatically set up the panel's dimensions and position
get_rootwin_data
## We use bspwm, and we need to know its settings
source ~/.config/common/bspwm
## Set the panel dimensions and position
panel_h='14'
panel_w=$(( root_win_w - ( bspwm_window_gap * 2 ) ))
panel_geometry="${panel_w}x${panel_h}+${bspwm_window_gap}+${bspwm_window_gap}"
## How many clickable areas are available to use:
panel_clickable_areas='128'
# Module configs
# ==============
# bspwm_desktop_pager
# -------------------
declare -A bspwm_desktop_pager
bspwm_desktop_pager[colour_focused]=$panel_bg_focused
bspwm_desktop_pager[show_empty_tags]=0
declare -a bspwm_desktop_pager_blacklist
bspwm_desktop_pager_blacklist=( 'h' )
# bspwm_taskbar
# -------------
declare -A bspwm_taskbar
declare -a bspwm_taskbar_blacklist
bspwm_taskbar[focused_only]=0
bspwm_taskbar[counter]=1
bspwm_taskbar[fg_normal]='#bebebe'
bspwm_taskbar[fg_focused]=$panel_fg_normal
bspwm_taskbar[start]="%{F$panel_bg_normal}%{B$panel_bg_focused}%{F-} "
bspwm_taskbar[end]="%{F$panel_bg_focused} %{B-}%{F-}"
bspwm_taskbar[max_size]=132
bspwm_taskbar_blacklist=( 'h' )
# bspwm_date
# ----------
declare -A date
date[format]='%A, %Y.%m.%d %H:%M:%S'
# simple_launcher
# ---------------
declare -A simple_launcher
simple_launcher[start]="%{F$panel_bg_normal}%{B$panel_bg_focused}%{F-}"
simple_launcher[end]="%{F$panel_bg_focused} %{B-}%{F-}"
# network_status
# --------------
mod_network_status_check_rate=10
mod_network_status_ok='%{F#00FF00}ok%{F-}'
mod_network_status_warn='%{F#FFFF00}WARN%{F-}'
mod_network_status_fail='%{F#FF0000}FAIL%{F-}'
network_status_hosts=(
de-ber-as20647.anchors.atlas.ripe.net
nl-ams-as1101.anchors.atlas.ripe.net
uk-boh-as196745.anchors.atlas.ripe.net
)
out[network_status]='%{F#FFFF00}checking...%{F-}'
# mod_load
# --------
mod_load_crit=4
mod_load_warn=3
mod_load_warn_colour='#FFFF00'
mod_load_crit_colour='#FF0000'
mod_load_ok_colour='#00FF00'

View File

@ -0,0 +1,2 @@
browser::browser
terminal::terminal

View File

@ -0,0 +1 @@
/home/fbt/git/moltenbar/mod

View File

@ -0,0 +1,58 @@
# vim: ft=yaml sw=2 et
#geometry: '1262x14+9+9'
height: 14
gap: 9
fontspec: '-*-terminesspowerline-medium-*-normal-*-14-*-*-*-*-*-iso10646-*'
window_name: 'moltenbar'
active_areas: '128'
modules:
- bspwm_pager
- date
- bspwm_taskbar
- load_average
- network
- newmail
format: "<%= @panel_data['bspwm_pager'] %><%= @panel_data['bspwm_taskbar'] %>%{r}%{F<%= @config['colours']['bg_focused'] %>} %{F-}%{B<%= @config['colours']['bg_focused'] %>} New mail: <%= @panel_data['newmail'] %> LA: <%= @panel_data['load_average'] %> Network: <%= @panel_data['network'] %> <%= @panel_data['date'] %> %{B-}"
colours:
fg: '#f9f9f9'
fg_focused: '#f9f9f9'
bg: '#001f1f1f'
bg_focused: '#467EC2'
# Module settings
mod:
bspwm_pager:
colour_focused: '#f9f9f9'
show_empty_desktops: false
# monitors:
# - "WMHDMI1"
blacklist:
-h
bspwm_taskbar:
begin: "%{F<%= @config['colours']['bg'] %>}%{B<%= @config['colours']['bg_focused'] %>}%{F-} "
end: "%{F<%= @config['colours']['bg_focused'] %>} %{B-} "
date:
format: '%A, %Y.%m.%d %H:%M:%S'
load_average:
warn_value: 3
crit_value: 4
ok_colour: "#00FF00"
warn_colour: "#FFFF00"
crit_colour: "#FF0000"
network:
hosts:
- de-ber-as20647.anchors.atlas.ripe.net
- nl-ams-as1101.anchors.atlas.ripe.net
- uk-boh-as196745.anchors.atlas.ripe.net
ok_colour: "#00FF00"
warn_colour: "#FFFF00"
crit_colour: "#FF0000"
newmail:
ok_message: "*"
ok_colour: "#00FF00"
crit_message: "***"
crit_colour: "#FF0000"
maildirs:
- /home/fbt/sync/maildir/.ops
- /home/fbt/sync/maildir/.inbox

View File

@ -0,0 +1 @@
../bspwm/sxhkdrc

View File

@ -0,0 +1,29 @@
super + x
terminal
super + j
zwm-focus
super + w
killw $(pfw)
super + Return
zwm-tile
super + r
dmenu_run -fn '-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*' -nb '#222222' -nf '#bbbbbb' -sb '#005577'
super + m
zwm-monocle
super + t
zwm-tile
super + l
lock
super + {1-9}
zwm-tags switch {1-9}
super + shift + {1-9}
zwm-tags mv {1-9}

View File

@ -0,0 +1,41 @@
[options]
font = xos4 terminus 10
#allow_bold = false
cursor_blink = off
cursor_shape = ibeam
browser = browser
mouse_autohide = true
audible_bell = true
[hints]
font = terminus 10
roundness = 0.0
[colors]
foreground = #839496
foreground_bold = #eee8d5
foreground_dim = #888888
background = #141414
#background = rgba(18, 21, 26, 0.9)
cursor = #93a1a1
# if unset, will reverse foreground and background
#highlight = #839496
# colors from color0 to color254 can be set
color0 = #073642
color1 = #dc322f
color2 = #859900
color3 = #b58900
color4 = #268bd2
color5 = #d33682
color6 = #2aa198
color7 = #eee8d5
color8 = #002b36
color9 = #cb4b16
color10 = #586e75
color11 = #657b83
color12 = #839496
color13 = #6c71c4
color14 = #93a1a1
color15 = #fdf6e3

View File

@ -0,0 +1,22 @@
# Gotham color scheme
[colors]
foreground = #98d1ce
foreground_bold = #98d1ce
cursor = #98d1ce
background = #0a0f14
color0 = #0a0f14
color8 = #10151b
color1 = #c33027
color9 = #d26939
color2 = #26a98b
color10 = #081f2d
color3 = #edb54b
color11 = #245361
color4 = #195465
color12 = #093748
color5 = #4e5165
color13 = #888ba5
color6 = #33859d
color14 = #599caa
color7 = #98d1ce
color15 = #d3ebe9

View File

@ -0,0 +1,27 @@
[colors]
foreground = #839496
foreground_bold = #eee8d5
foreground_dim = #888888
background = #00141A
cursor = #93a1a1
# if unset, will reverse foreground and background
#highlight = #839496
# colors from color0 to color254 can be set
color0 = #073642
color1 = #dc322f
color2 = #859900
color3 = #b58900
color4 = #268bd2
color5 = #d33682
color6 = #2aa198
color7 = #eee8d5
color8 = #002b36
color9 = #cb4b16
color10 = #586e75
color11 = #657b83
color12 = #839496
color13 = #6c71c4
color14 = #93a1a1
color15 = #fdf6e3

View File

@ -0,0 +1,4 @@
#!/usr/bin/env watchman
service_command='/bin/compton'
service_args=( --vsync opengl -f -D 3 -e 1.0 )

View File

@ -0,0 +1,4 @@
#!/usr/bin/env watchman
#service_respawn='true'
service_command='/usr/bin/dunst'

View File

@ -0,0 +1,4 @@
#!/bin/env watchman
service_command='/usr/bin/jackd'
service_args=( -d alsa )

View File

@ -0,0 +1,5 @@
#!/usr/bin/env watchman
service_respawn='true'
service_command="$HOME/bin/lockd"
service_args=( -- i3lock-extra -s -o ~/pics/lock.png -g -p )

View File

@ -0,0 +1,21 @@
#!/usr/bin/env watchman
#service_respawn='true'
service_command='/home/fbt/bin/moltenbar'
service_depends_ready=( compton )
post_start() {
# Die if the thing didn't start
timer 5 nullexec xdo id -a moltenbar || return 1
# Set the layer on which lemonbar resides
xdo above -t $( xdo id -n root ) $( xdo id -a moltenbar )
# Set the top badding for bspwm
bspc config top_padding $(( 14 + 9 )) &>/tmp/debug.log
}
pre_stop() {
bspc config top_padding 0
}

View File

@ -0,0 +1,4 @@
#!/usr/bin/env watchman
#service_respawn='true'
service_command="$HOME/bin/mpc-notify"

View File

@ -0,0 +1,8 @@
#!/usr/bin/env ssm
service_tmpfiles=( "/run/user/$UID/mpd:dir" )
service_respawn=1
service_command='/usr/bin/mpd'
service_args=( --no-daemon -v )
post_start() { ready; }

View File

@ -0,0 +1,21 @@
#!/usr/bin/env watchman
privoxy_configfile="$HOME/.config/privoxy/config"
service_respawn='true'
service_command='/usr/bin/privoxy'
service_args=( --no-daemon "$privoxy_configfile" )
privoxy::configtest() {
"$service_command" --config-test "${service_args[@]}"
}
restart() {
privoxy::configtest || {
watchman.err "Config test failed, not restarting!"
return 1
}
stop
start
}

View File

@ -0,0 +1,14 @@
#!/bin/env watchman
service_depends=( jackd )
service_command='/usr/bin/pulseaudio'
service_args=(
--realtime=false
--exit-idle-time=-1
-L module-jack-sink
-L module-jack-source
-L module-native-protocol-tcp
)
stop () { "$service_command" -k; }

View File

@ -0,0 +1,5 @@
#!/usr/bin/env watchman
service_respawn='true'
service_command='/usr/bin/crond'
service_args=( -n -f ~/.config/crontab )

View File

@ -0,0 +1,5 @@
#!/usr/bin/watchman
service_respaen=true
service_command='/usr/bin/ssh'
service_args=( -i ~/.ssh/proxy/id_ecdsa -ND 8080 proxy@malganis.priv )

View File

@ -0,0 +1,4 @@
#!/usr/bin/env watchman
service_command='/usr/bin/ssh-agent'
service_args=( -d -a "/tmp/${USER}-ssh-auth.sock" )

View File

@ -0,0 +1,5 @@
#!/usr/bin/env watchman
#service_respawn='true'
service_command='/usr/bin/sxhkd'
service_reload_signal='USR1'

View File

@ -0,0 +1,4 @@
#!/bin/env watchman
#service_respawn='true'
service_command='/usr/bin/syncthing'

View File

@ -0,0 +1,4 @@
#!/bin/env watchman
service_command='/usr/bin/transmission-daemon'
service_args=( -f )

View File

@ -0,0 +1,5 @@
#!/usr/bin/env watchman
#service_respawn='true'
service_command='/usr/bin/ufwd'
service_args=( -n -c -- -p )

View File

@ -0,0 +1,54 @@
# Basic zsh configuration
# vim: ft=zsh
# Custom completion
fpath=( /etc/zsh/completion $fpath )
# Completion
setopt noautomenu nomenucomplete
# Interactive comments
setopt interactive_comments
# Disable autocd
unsetopt autocd
# Command completion
autoload -U compinit
compinit
# Complete dotfiles
_comp_options+=( globdots )
# History
setopt HIST_IGNORE_DUPS
HISTFILE=~/.zsh_history
SAVEHIST=9001
HISTSIZE=9001
HISTCONTROL=erasedups
HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S"
# Fix retarded things
NULLCMD=true
READNULLCMD=true
# Locale
export LC_ALL='en_US.UTF-8'
# dotfiles config
dotfiles_dir="$HOME/git/dotfiles"
# PATH
set_misc_path "$HOME/ruby/bin" "$HOME/games/bin" "$HOME/.config/alternatives" "$HOME/.local/bin" "$HOME/bin" "$HOME/.gem/ruby/2.3.0/bin/"
# GPG
GPG_TTY=$(tty)
export GPG_TTY
# EDITOR
EDITOR=vim
export EDITOR
# jspass completion
compdef _pass jspass

View File

@ -0,0 +1,24 @@
# Functions common to other modules
# vim: ft=zsh
# Run the supplied command and null all the output
function nullexec {
"$@" &>/dev/null
}
# Compile all includes
function newconf {
for i in ~/.zshrc ~/.config/zsh.d/*; do
if ! [[ $i =~ .+\.zwc ]]; then
msg "Compiling $i..."
zcompile $i
fi
done
}
# set PATH from misc_path
function set_misc_path {
for p in $@; do
PATH="$p:$PATH"
done
}

View File

@ -0,0 +1,14 @@
# Functions for manipulating my dotfiles repo
# vim: ft=zsh
function dotfiles() {
declare act=$1
case $act in
pull|diff) git -C $dotfiles_dir $1;;
push)
git -C $dotfiles_dir commit -a
git -C $dotfiles_dir push
;;
esac
}

View File

@ -0,0 +1,8 @@
# Helper functions
xcopy() { xclip -selection clipboard }
xpaste() { xclip -selection clipboard -o }
xclip() {
/usr/bin/xclip -selection clipboard "$@"
}

View File

@ -0,0 +1,28 @@
# Keys
# vim: ft=zsh
bindkey -e
declare -A key
key[Home]=$terminfo[khome]
key[End]=$terminfo[kend]
key[Delete]=$terminfo[kdch1]
declare -A bindings
bindings=(
Home 'beginning-of-line'
End 'end-of-line'
Delete 'delete-char'
^R 'history-incremental-search-backward'
)
for b in ${(k)bindings}; do
if [[ $key[$b] ]]; then
bindkey $key[$b] $bindings[$b]
fi
done
function zle-line-init () { echoti smkx; }
function zle-line-finish () { echoti rmkx; }
zle -N zle-line-init
zle -N zle-line-finish

View File

@ -0,0 +1,8 @@
# Local zsh config, not to be synced.
# vim: ft=zsh
# SSH
SSH_AUTH_SOCK="/tmp/${USER}-ssh-auth.sock"
export SSH_AUTH_SOCK
function x { exec xinit -- -nolisten tcp vt9; }

View File

@ -0,0 +1,128 @@
# Prompt
# vim: ft=zsh
autoload -U colors && colors
nullexec() { "$@" &>/dev/null; }
precmd.title() {
printf '%b' "\e]2;$1\a"
}
precmd.svn() {
if [[ -f .novcsprompt ]]; then
return 0
fi
if nullexec svn info; then
while IFS= read -r line; do
case $line in
(M*|A*|D*) svn_unstaged=1;;
(\!*) svn_missing=1;;
(\?*) svn_untracked=1;;
esac
done < <( svn st )
(( svn_unstaged )) && {
svn_st+='c'
svn_st_col='red'
}
(( svn_missing )) && {
svn_st+='m'
svn_st_col='red'
}
(( svn_untracked )) && {
svn_st+='f'
svn_st_col='red'
}
svn_st_col=${svn_st_col:-"green"}
svn_st=${svn_st:-"ok"}
printf '%s' "(%F{cyan}svn%f:%F{$svn_st_col}$svn_st%f) "
fi
}
precmd.git() {
declare git_unstaged git_untracked git_status_short git_status_colour git_prompt_msg
if [[ -f .novcsprompt ]]; then
return 0
fi
if git rev-parse --git-dir &>/dev/null; then
git_current_branch=$(git rev-parse --abbrev-ref HEAD)
while IFS= read -r line; do
case $line in
' M'*|A*|D*) git_unstaged=1;;
\?\?*) git_untracked=1;;
esac
done < <( git status --short )
(( git_unstaged )) && {
git_status_short+='c'
git_status_colour='red'
}
(( git_untracked )) && {
git_status_short+='f'
git_status_colour='red'
}
git_status_short=${git_status_short:-"ok"}
git_status_colour=${git_status_colour:-"green"}
git_prompt_msg="(%F{cyan}$git_current_branch%f[%F{$git_status_colour}${git_status_short}%f]) "
printf '%s' $git_prompt_msg
fi
}
rprompt() {
{ precmd.svn; precmd.git } > "$XDG_RUNTIME_DIR/zsh_rprompt_$$.tmp"
kill -s USR1 $$
}
TRAPUSR1() {
prompt_async_data=$(<"$XDG_RUNTIME_DIR/zsh_rprompt_$$.tmp")
draw_prompt
zle && zle reset-prompt
}
draw_prompt() {
prompt_custom=(
"%F{$cmd_colour}$cmd_msg%f"
"%F{$user_colour}$USER%f@$HOST"
"${PWD//$HOME/~}"
"$prompt_async_data%F{$user_colour}>%f"
)
PROMPT=" $prompt_custom "
}
precmd() {
declare last_exit_code=$?
declare -g cmd_colour cmd_msg
if (( last_exit_code )); then
cmd_colour='red'
cmd_msg='!'
else
cmd_colour='green'
cmd_msg='.'
fi
if (( UID )); then
user_colour='green'
else
user_colour='red'
fi
precmd.title "$USER@$HOST ${PWD//$HOME/~}"
draw_prompt
rprompt &!
}

View File

@ -0,0 +1,7 @@
# Functions meant to be used interactively.
# vim: ft=zsh
# Source the .zshrc again
function reload {
exec zsh -i
}

View File

@ -0,0 +1,6 @@
# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
export XDG_DATA_HOME=$HOME/.local/share
export XDG_CACHE_HOME=$HOME/.cache
export XDG_RUNTIME_DIR=/run/user/$UID
export XDG_CONFIG_HOME=$HOME/.config

View File