Add new aliases, reconfigure bar, fix prompt path

This commit is contained in:
Daniel Flanagan 2018-10-23 14:37:57 -05:00
parent 6bf68ba874
commit 803808dab3
6 changed files with 167 additions and 159 deletions

View file

@ -1,22 +1,39 @@
;===================================================== ; ############################ ;
; ; ######### COLORS ######### ;
; To learn more about how to configure Polybar ; ############################ ;
; go to https://github.com/jaagr/polybar
;
; The README contains alot of information
;
;=====================================================
[colors] [colors]
background = ${xrdb:color0:#111} foreground = ${xrdb:color7:#222222}
; background = #00000000 background = ${xrdb:color0:#111111}
background-alt = ${xrdb:color2:#333}
; background-alt = ${xrdb:color2:#333} icon = #555555
foreground = ${xrdb:color7:#222}
foreground-alt = #555 good = ${xrdb:color2}
primary = ${xrdb:color1:#222} neutral = ${xrdb:color3}
secondary = ${xrdb:color3:#222} bad = ${xrdb:color1}
alert = #bd2c40
active = ${xrdb:color4}
alert = ${xrdb:color1}
bar-bg = ${xrdb:color3}
sysres = ${xrdb:color5}
levels = ${xrdb:color3}
net = ${xrdb:color1}
cpu = ${colors.sysres}
memory = ${colors.sysres}
filesystem = ${colors.sysres}
thermal = ${xrdb:color2}
battery-charging = ${colors.good}
battery-full = ${colors.good}
battery-discharging = ${colors.neutral}
; battery- = ${colors.good}
time = ${colors.foreground}
; ########################### ;
; ########## BAR ########## ;
; ########################### ;
[bar/lytedev] [bar/lytedev]
monitor = ${env:BAR_MONITOR:HDMI-1} monitor = ${env:BAR_MONITOR:HDMI-1}
@ -33,7 +50,7 @@ background = ${colors.background}
foreground = ${colors.foreground} foreground = ${colors.foreground}
line-size = 3 line-size = 3
line-color = #f00 line-color = ${colors.foreground}
border-size = 0 border-size = 0
border-color = #00000000 border-color = #00000000
@ -56,38 +73,18 @@ tray-position = right
tray-padding = 0 tray-padding = 0
; tray-background = #00000000 ; tray-background = #00000000
; tray-transparent = true ; tray-transparent = true
; tray-background = #0063ff ; tray-background = ${colors.background}
wm-restack = bspwm wm-restack = bspwm
;wm-restack = i3
override-redirect = true override-redirect = true
; scroll-up = bspwm-desknext ; scroll-up = bspwm-desknext
; scroll-down = bspwm-deskprev ; scroll-down = bspwm-deskprev
;scroll-up = i3wm-wsnext ; ############################ ;
;scroll-down = i3wm-wsprev ; ########### FS ########### ;
; ############################ ;
[module/xwindow]
type = internal/xwindow
label = %title:0:30:...%
; [module/xkeyboard]
; type = internal/xkeyboard
; blacklist-0 = num lock
;
; format-prefix = ""
; format-prefix-foreground = ${colors.foreground-alt}
; format-prefix-underline = ${colors.secondary}
;
; label-layout = %layout%
; label-layout-underline = ${colors.secondary}
;
; label-indicator-padding = 2
; label-indicator-margin = 1
; label-indicator-background = ${colors.secondary}
; label-indicator-underline = ${colors.secondary}
[module/filesystem] [module/filesystem]
type = internal/fs type = internal/fs
@ -97,9 +94,13 @@ mount-0 = ${env:BAR_FS_VOLUME}
format = <label-mounted> format = <label-mounted>
label-mounted = %used% label-mounted = %used%
label-mounted-foreground = ${xrdb:color6} label-mounted-foreground = ${colors.filesystem}
format-mounted-prefix = " " format-mounted-prefix = " "
format-mounted-prefix-foreground = ${colors.foreground-alt} format-mounted-prefix-foreground = ${colors.icon}
; ########################### ;
; ######### BSPWM ######### ;
; ########################### ;
[module/bspwm] [module/bspwm]
ws-icon-0 = dev; ws-icon-0 = dev;
@ -114,36 +115,40 @@ ws-icon-8 = mon;
ws-icon-9 = util; ws-icon-9 = util;
ws-icon-default = ♟ ws-icon-default = ♟
; misc icon: 
label-focused-font = 2 label-focused-font = 2
label-occupied-font = 2 label-occupied-font = 2
label-urgent-font = 2 label-urgent-font = 2
label-empty-font = 2 label-empty-font = 2
; misc icon: 
type = internal/bspwm type = internal/bspwm
pin-workspaces = false pin-workspaces = false
label-focused = %icon% label-focused = %icon%
label-focused-background = ${xrdb:color4} label-focused-background = ${colors.active}
label-focused-foreground = ${colors.background} label-focused-foreground = ${colors.background}
; label-focused-underline= ${colors.primary}
label-focused-padding = 2 label-focused-padding = 2
label-occupied = %icon% label-occupied = %icon%
label-occupied-padding = 2 label-occupied-padding = 2
label-urgent = %icon% label-urgent = %icon%
label-urgent-background = ${xrdb:color3} label-urgent-background = ${colors.alert}
label-urgent-padding = 2 label-urgent-padding = 2
label-empty = %icon% label-empty = %icon%
label-empty-foreground = ${colors.foreground-alt} label-empty-foreground = ${colors.icon}
label-empty-padding = 2 label-empty-padding = 2
; ########################### ;
; ########## MPD ########## ;
; ########################### ;
[module/mpd] [module/mpd]
type = internal/mpd type = internal/mpd
format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next> format-online = <icon-prev> <toggle> <label-song> <icon-stop> <icon-next>
icon-prev =  icon-prev = 
icon-stop =  icon-stop = 
@ -154,51 +159,57 @@ icon-next = 
label-song-maxlen = 25 label-song-maxlen = 25
label-song-ellipsis = true label-song-ellipsis = true
; ########################### ;
; ####### BACKLIGHT ####### ;
; ########################### ;
[module/xbacklight] [module/xbacklight]
type = internal/xbacklight type = internal/xbacklight
format = <label> <bar> format = <label> <bar>
format-foreground = ${colors.foreground-alt} format-foreground = ${colors.icon}
label =  label = 
bar-width = 5 bar-width = 5
bar-indicator = | bar-indicator = |
bar-indicator-foreground = #fff bar-indicator-foreground = ${colors.foreground}
bar-indicator-font = 0 bar-indicator-font = 0
# bar-fill = ─ bar-fill = ─
bar-fill = - ; bar-fill = -
bar-fill-font = 0 bar-fill-font = 0
bar-fill-foreground = ${xrdb:color3} bar-fill-foreground = ${colors.bar-bg}
# bar-empty = ─ bar-empty = ─
bar-empty = - ; bar-empty = -
bar-empty-font = 0 bar-empty-font = 0
bar-empty-foreground = ${xrdb:color3} bar-empty-foreground = ${colors.bar-bg}
[module/backlight-acpi] ; ########################### ;
inherit = module/xbacklight ; ########## CPU ########## ;
type = internal/backlight ; ########################### ;
card = intel_backlight
[module/cpu] [module/cpu]
type = internal/cpu type = internal/cpu
interval = 2 interval = 2
format-prefix = " " format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt} format-prefix-foreground = ${colors.icon}
; format-underline = #f90000
label = %percentage-cores% label = %percentage-cores%
label-foreground = ${xrdb:color6} label-foreground = ${colors.cpu}
; ########################## ;
; ######## MEMORY ######## ;
; ########################## ;
[module/memory] [module/memory]
type = internal/memory type = internal/memory
interval = 2 interval = 2
; format-prefix = " "
format-prefix = " " format-prefix = " "
; format-prefix = " " format-prefix-foreground = ${colors.icon}
; 
format-prefix-foreground = ${colors.foreground-alt}
; format-underline = #4bffdc
label = %gb_free% label = %gb_free%
label-foreground = ${xrdb:color6} label-foreground = ${colors.memory}
; ########################## ;
; ######### WIFI ######### ;
; ########################## ;
[module/wifi] [module/wifi]
type = internal/network type = internal/network
@ -207,20 +218,20 @@ interval = 10.0
;format-connected = <ramp-signal> <label-connected> ;format-connected = <ramp-signal> <label-connected>
format-connected-prefix = " " format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.foreground-alt} format-connected-prefix-foreground = ${colors.icon}
format-connected = <label-connected> format-connected = <label-connected>
label-connected = "%essid% %downspeed% %upspeed%" label-connected = "%essid% %downspeed% %upspeed%"
label-connected-foreground = ${xrdb:color1} label-connected-foreground = ${colors.wifi-connected}
format-disconnected-prefix = " " format-disconnected-prefix = " "
format-disconnected-prefix-foreground = ${colors.foreground-alt} format-disconnected-prefix-foreground = ${colors.icon}
format-disconnected = "N/A" format-disconnected = "N/A"
; format-disconnected = <label-disconnected> ; format-disconnected = <label-disconnected>
; format-disconnected-underline = ${self.format-connected-underline} ; format-disconnected-underline = ${self.format-connected-underline}
; label-disconnected = %ifname% disconnected ; label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt} ; label-disconnected-foreground = ${colors.wifi-disconnected}
ramp-signal-0 =  ramp-signal-0 = 
ramp-signal-1 =  ramp-signal-1 = 
@ -234,15 +245,19 @@ interface = ${env:BAR_ETH_INTERFACE}
interval = 10.0 interval = 10.0
format-connected-prefix = " " format-connected-prefix = " "
format-connected-prefix-foreground = ${xrdb:color8} format-connected-prefix-foreground = ${colors.icon}
label-connected = %upspeed% %downspeed% label-connected = %upspeed% %downspeed%
label-connected-foreground = ${xrdb:color1} label-connected-foreground = ${colors.eth-connected}
format-disconnected = N/A format-disconnected = N/A
; format-disconnected = <label-disconnected> ; format-disconnected = <label-disconnected>
; format-disconnected-underline = 0 ; format-disconnected-underline = 0
; label-disconnected = %ifname% disconnected ; label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt} ; label-disconnected-foreground = ${colors.eth-disconnected}
; ########################### ;
; ######### CLOCK ######### ;
; ########################### ;
[module/date] [module/date]
type = internal/date type = internal/date
@ -254,41 +269,47 @@ date-alt =
time = %H:%M:%S time = %H:%M:%S
time-alt = %H:%M time-alt = %H:%M
label-foreground = ${xrdb:color7} label-foreground = ${colors.time}
; format-prefix = " " format-prefix = " "
; format-prefix = "" format-prefix-foreground = ${colors.icon}
format-prefix-foreground = ${colors.foreground-alt}
; format-underline = #0a6cf5
label = %date%%time% label = %date%%time%
; ########################## ;
; ######## VOLUME ######## ;
; ########################## ;
[module/volume] [module/volume]
type = internal/alsa type = internal/alsa
format-volume = <label-volume> <bar-volume> format-volume = <label-volume> <bar-volume>
label-volume =  label-volume = 
label-volume-foreground = ${colors.foreground-alt} label-volume-foreground = ${colors.icon}
format-muted-prefix = " " format-muted-prefix = " "
format-muted-foreground = ${colors.foreground-alt} format-muted-foreground = ${colors.icon}
label-muted = M label-muted = M
bar-volume-width = 5 bar-volume-width = 5
bar-volume-foreground-0 = ${xrdb:color3} bar-volume-foreground-0 = ${colors.bar-bg}
bar-volume-foreground-1 = ${xrdb:color3} bar-volume-foreground-1 = ${colors.bar-bg}
bar-volume-foreground-2 = ${xrdb:color3} bar-volume-foreground-2 = ${colors.bar-bg}
bar-volume-foreground-3 = ${xrdb:color3} bar-volume-foreground-3 = ${colors.bar-bg}
bar-volume-foreground-4 = ${xrdb:color3} bar-volume-foreground-4 = ${colors.bar-bg}
bar-volume-foreground-5 = ${xrdb:color3} bar-volume-foreground-5 = ${colors.bar-bg}
bar-volume-foreground-6 = ${xrdb:color3} bar-volume-foreground-6 = ${colors.bar-bg}
bar-volume-gradient = false bar-volume-gradient = false
bar-volume-indicator = | bar-volume-indicator = |
bar-volume-indicator-font = 0 bar-volume-indicator-font = 0
bar-volume-fill = - bar-volume-fill =
bar-volume-fill-font = 0 bar-volume-fill-font = 0
bar-volume-empty = - bar-volume-empty =
bar-volume-empty-font = 0 bar-volume-empty-font = 0
bar-volume-empty-foreground = ${colors.foreground-alt} bar-volume-empty-foreground = ${colors.icon}
; ######################### ;
; ####### BATTERY ####### ;
; ######################### ;
[module/battery] [module/battery]
type = internal/battery type = internal/battery
@ -296,34 +317,36 @@ battery = BAT0
adapter = ADP1 adapter = ADP1
full-at = 98 full-at = 98
label-discharging-foreground = ${xrdb:color3} label-discharging-foreground = ${colors.battery-discharging}
label-charging-foreground = ${xrdb:color2} label-charging-foreground = ${colors.battery-charging}
label-full-foreground = ${xrdb:color4} label-full-foreground = ${colors.battery-full}
format-charging = <animation-charging> <label-charging> format-charging = <animation-charging> <label-charging>
format-discharging-prefix = format-discharging-prefix =
format-discharging-prefix-foreground = ${colors.foreground-alt} format-discharging-prefix-foreground = ${colors.icon}
format-discharging = <ramp-capacity> <label-discharging> format-discharging = <ramp-capacity> <label-discharging>
; format-discharging-underline = ${self.format-charging-underline}
format-charging-prefix = format-charging-prefix =
format-charging-prefix-foreground = ${colors.foreground-alt} format-charging-prefix-foreground = ${colors.icon}
format-full-prefix = " " format-full-prefix = " "
format-full-prefix-foreground = ${colors.foreground-alt} format-full-prefix-foreground = ${colors.icon}
; empty battery 
ramp-capacity-0 = "" ramp-capacity-0 = ""
ramp-capacity-1 = "" ramp-capacity-1 = ""
ramp-capacity-2 = "" ramp-capacity-2 = ""
ramp-capacity-foreground = ${colors.foreground-alt} ramp-capacity-foreground = ${colors.icon}
animation-charging-0 = "" animation-charging-0 = ""
animation-charging-1 = "" animation-charging-1 = ""
animation-charging-2 = "" animation-charging-2 = ""
animation-charging-foreground = ${colors.foreground-alt} animation-charging-foreground = ${colors.icon}
animation-charging-framerate = 750 animation-charging-framerate = 1000
; ########################## ;
; ####### THERMALS ####### ;
; ########################## ;
[module/temperature] [module/temperature]
type = internal/temperature type = internal/temperature
@ -331,56 +354,34 @@ thermal-zone = 0
warn-temperature = 60 warn-temperature = 60
format = <ramp><label> format = <ramp><label>
; format-underline = #f50a4d
format-warn = <ramp> <label-warn> format-warn = <ramp> <label-warn>
; format-warn-underline = ${self.format-underline} label-foreground = ${colors.thermal}
label-foreground = ${xrdb:color2}
format-prefix = format-prefix =
format-prefix-foreground = ${colors.foreground-alt} format-prefix-foreground = ${colors.icon}
label = %temperature-c% label = %temperature-c%
label-warn = %temperature-c% label-warn = %temperature-c%
label-warn-foreground = ${xrdb:color1} label-warn-foreground = ${colors.icon}
ramp-0 = " " ramp-0 = " "
ramp-1 = " " ramp-1 = " "
ramp-2 = "t " ramp-2 = " "
ramp-foreground = ${colors.foreground-alt} ramp-foreground = ${colors.icon}
[module/powermenu] ; ######################## ;
type = custom/menu ; ###### SETTINGS ###### ;
; ######################## ;
format-spacing = 1
label-open =
label-open-foreground = ${colors.secondary}
label-close = cancel
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 = sudo reboot
menu-2-0 = power off
menu-2-0-exec = sudo poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
[settings] [settings]
screenchange-reload = true screenchange-reload = true
pseudo-transparency = true pseudo-transparency = true
;compositing-background = xor compositing-background = source
;compositing-background = screen compositing-foreground = source
;compositing-foreground = source compositing-border = source
;compositing-border = over
; ######################### ;
; ####### GLOBALS ####### ;
; ######################### ;
[global/wm] [global/wm]
margin-top = ${env:WINDOW_GAP} margin-top = ${env:WINDOW_GAP}

View file

@ -30,6 +30,7 @@ fi
if command -v sxhkd >/dev/null 2>&1; then if command -v sxhkd >/dev/null 2>&1; then
# export HIGHLIGHT_COLOR=$(xrdb -query | sed -ne 's/.*font:\s*xft:.*\-\(.*\)$/\1/p' | head -n 1) # export HIGHLIGHT_COLOR=$(xrdb -query | sed -ne 's/.*font:\s*xft:.*\-\(.*\)$/\1/p' | head -n 1)
export NICE_HOME
sxhkd -m -1 & sxhkd -m -1 &
fi fi

View file

@ -237,7 +237,7 @@ super + ctrl + {alt +,_} Escape
bspc quit 1} bspc quit 1}
Print Print
scrot scrot "$NICE_HOME/img/scrots/%Y-%m-%d_%H-%M-%S_\$wx\$h.png"
# make sxhkd reload its configuration files: # make sxhkd reload its configuration files:
super + Escape super + Escape

View file

@ -63,6 +63,7 @@ alias tcom="tmux attach -t comms || tmux new -s comms"
# git aliases # git aliases
# TODO: make these git aliases in the gitconfig? # TODO: make these git aliases in the gitconfig?
alias g="git"
alias gs="git status" alias gs="git status"
alias gpl="git pull" alias gpl="git pull"
alias gp="git push --all" alias gp="git push --all"
@ -104,6 +105,7 @@ alias pt="htop -t" # experimental htop tree-view-by-default
alias resrc="source \$HOME/.bashrc" alias resrc="source \$HOME/.bashrc"
alias redshift="redshift -l 39.0997:-94.5786" alias redshift="redshift -l 39.0997:-94.5786"
alias gpmdpe="electron --app=/usr/share/gpmdp/resources/app.asar" alias gpmdpe="electron --app=/usr/share/gpmdp/resources/app.asar"
alias t="task"
export NOTES_DIR="$NICE_HOME" export NOTES_DIR="$NICE_HOME"

View file

@ -7,10 +7,12 @@
# making sure they're loaded! # making sure they're loaded!
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"
export DOTFILES_PATH="$XDG_CONFIG_HOME/dotfiles" export DOTFILES_PATH="$XDG_CONFIG_HOME/dotfiles"
export NICE_HOME="$HOME" NICE_HOME="$HOME"
[[ $(basename "${HOME}") = "usr" ]] && export NICE_HOME="$HOME/.." [[ $(basename "${HOME}") = "usr" ]] && NICE_HOME="$(realpath "$HOME/..")"
[[ $(basename "${HOME}") = ".home" ]] && export NICE_HOME="$HOME/.." [[ $(basename "${HOME}") = ".home" ]] && NICE_HOME="$(realpath "$HOME/..")"
export NICE_HOME
# TODO: nice home on a per-device basis # TODO: nice home on a per-device basis

View file

@ -3,19 +3,21 @@
COLOR_RESET='\[\e[0m\]' COLOR_RESET='\[\e[0m\]'
PROMPT_SUCCESS_COLOR='\[\e[0;34m\]' PROMPT_SUCCESS_COLOR='\[\e[0;34m\]'
PROMPT_FAILURE_COLOR='\[\e[0;31m\]' PROMPT_FAILURE_COLOR='\[\e[0;31m\]'
DIR_COLOR='\[\e[0;33m\]' DIR_COLOR='\[\e[0;35m\]'
# prompt rendering functions # prompt rendering functions
preprocess_pwd() { preprocess_pwd() {
name="$PWD" name="$PWD"
# if we're in the home directory, replace it with tilde # if we're in the home directory, replace it with tilde
[[ "$name" =~ ^"$NICE_HOME"(/|$) ]] && name="~${name#$NICE_HOME}" # [[ "$name" =~ ^"$NICE_HOME"(/|$) ]] && name="~${name#$NICE_HOME}"
[[ "$name" == "${NICE_HOME}" ]] && name="~"
# replace all non-basename parts of the PWD with only the first two letters # replace all non-basename parts of the PWD with only the first two letters
curdir=$(echo "$PWD" | sed -r 's|.*/(.+)$|\1|g') curdir=$(echo "$PWD" | sed -r 's|.*/(.+)$|\1|g')
name=$(echo "$name" | sed -r 's|/(..)[^/]*|/\1|g' | sed -r 's|(.*/)(.+)$|\1|g') name=$(echo "$name" | sed -r 's|/(...)[^/]*|/\1|g' | sed -r 's|(.*/)(.+)$|\1|g')
# if we're just in the home directory, don't show any path stuff # if we're just in the home or root directory, don't show any path stuff
[[ "$name" == "/" ]] && curdir=""
[[ "$name" == "~" ]] && curdir="" [[ "$name" == "~" ]] && curdir=""
# return our transformed PWD # return our transformed PWD