From 2fbcbe8a2472e2a1fe9a7567c337aa16d3d26fcf Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 11 Feb 2017 14:00:54 -0600 Subject: [PATCH 1/2] laptop fixes --- de/bar/bar.bash | 6 ++++-- de/bspwmrc | 14 ++++++++++++++ de/xinitrc | 13 ------------- env/x/xresources | 42 ++++++++++++++++++++++++++++++++++++++++++ shell/shell_funcs | 5 +++-- 5 files changed, 63 insertions(+), 17 deletions(-) create mode 100755 env/x/xresources diff --git a/de/bar/bar.bash b/de/bar/bar.bash index b1b645f..e08a7cf 100755 --- a/de/bar/bar.bash +++ b/de/bar/bar.bash @@ -1,12 +1,14 @@ #!/usr/bin/env bash -export BAR_MONITOR="DVI-I-2" +export BAR_MONITOR="$(polybar --list-monitors | tail -n 1 | sed -n 's/^\s*\(.*\):.*$/\1/p')" export BAR_HEIGHT=25 export BAR_ON_TOP=0 export BAR_SIDE_MARGIN=200 +echo "$BAR_MONITOR" + export GAP=$(bspc wm -d | grep -Po '(windowGap.*?,)' | grep -Po '\d*' | head -n 1) -MONITOR_WIDTH=$(xrandr | grep DVI-I-2 | grep -Po ' \d+' | head -n 1) +MONITOR_WIDTH=$(xrandr | grep "$BAR_MONITOR" | grep -Po ' \d+' | head -n 1) export BAR_WIDTH=$((MONITOR_WIDTH - GAP - GAP - BAR_SIDE_MARGIN - BAR_SIDE_MARGIN)) export BAR_FONT=$(xrdb -query | sed -ne 's/.*font:\s*xft:\(.*\)\-.*$/\1/p' | head -n 1) export BAR_FONT_SIZE=$(xrdb -query | sed -ne 's/.*font:\s*xft:.*\-\(.*\)$/\1/p' | head -n 1) diff --git a/de/bspwmrc b/de/bspwmrc index 2bb0d7c..b85b13b 100755 --- a/de/bspwmrc +++ b/de/bspwmrc @@ -34,6 +34,20 @@ if command -v sxhkd >/dev/null 2>&1; then sxhkd & fi +if [ -f "$HOME/.fehbg" ]; then + "$HOME/.fehbg" & +fi + +# launch optional and helpful apps +if command -v unclutter >/dev/null 2>&1; then + unclutter & +fi + +if command -v compton >/dev/null 2>&1; then + compton & +fi + +# launch bar if [[ $START_BAR -eq 1 ]]; then ${BAR_COMMAND} & fi diff --git a/de/xinitrc b/de/xinitrc index 603dfb0..fef0872 100644 --- a/de/xinitrc +++ b/de/xinitrc @@ -11,23 +11,10 @@ if [ -f "$HOME/.xprofile" ]; then source "$HOME/.xprofile" fi -if [ -f "$HOME/.fehbg" ]; then - "$HOME/.fehbg" & -fi - # allow a per-device config to override options if [ -f "$HOME/.env_xinitrc" ]; then source "$HOME/.env_xinitrc" fi -# launch optional and helpful apps -if command -v unclutter >/dev/null 2>&1; then - unclutter & -fi - -if command -v compton >/dev/null 2>&1; then - compton & -fi - # fire up wm exec "$DOTFILES_PATH/de/wmstart" diff --git a/env/x/xresources b/env/x/xresources new file mode 100755 index 0000000..2f99b37 --- /dev/null +++ b/env/x/xresources @@ -0,0 +1,42 @@ +#define primaryfont xft:Terminus-9 +#define secondaryfont xft:Open Sans-9 +#define iconfont xft:stlarch-9 +#define primaryletterspace 0 + +#define emacspfont Monaco 9 + +! I like this font on my desktop (use in `~/.Xresources.env`!) +!#define primaryfont xft:lemon-11 +!#define primaryletterspace 0 + +! I like this font on my desktop for code streaming +!#define primaryfont xft:Monaco-9 +!#define primaryletterspace -2 + +! I like this font on my laptop +!#define primaryfont xft:Monaco-11 +!#define primaryletterspace -1 + +URxvt.font: xft:xos4 Terminus-10 +URxvt.faceName: xft:xos4 Terminus-10 +URxvt.boldFont: xft:xos4 Terminus-10 +URxvt.letterSpace: 0 +URxvt.scrollBar: false +URxvt.cursorUnderline: true +URxvt.cursorBlink: true +URxvt.termName: rxvt-unicode +URxvt.intensityStyles: true +*utf8: 2 +URxvt.scaleHeight: 1 + +URxvt.depth: 32 + +URxvt.internalBorder: 24 + +Xcursor.theme: human + +URxvt.perl-ext-common: default,matcher,keyboard-select +URxvt.keysym.M-Escape: perl:keyboard-select:activate +URxvt.url-launcher: /usr/bin/xdg-open +URxvt.matcher.button: 1 +URxvt.iso14755: False diff --git a/shell/shell_funcs b/shell/shell_funcs index 173120b..70e53a1 100644 --- a/shell/shell_funcs +++ b/shell/shell_funcs @@ -8,8 +8,9 @@ export -f calc stopbar() { # TODO: get the proper monitor! - bspc config -m "DVI-I-2" bottom_padding "0" - bspc config -m "DVI-I-2" top_padding "0" + BAR_MONITOR="$(polybar --list-monitors | tail -n 1 | sed -n 's/^\s*\(.*\):.*$/\1/p')" + bspc config -m "$BAR_MONITOR" bottom_padding "0" + bspc config -m "$BAR_MONITOR" top_padding "0" killall -q polybar while pgrep -x polybar >/dev/null; do sleep 1; done } From a9667311d4951171b0188e15a9bef387375ba8b4 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 11 Feb 2017 14:04:43 -0600 Subject: [PATCH 2/2] few more laptop fixes --- de/bspwmrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/de/bspwmrc b/de/bspwmrc index b85b13b..01fdea2 100755 --- a/de/bspwmrc +++ b/de/bspwmrc @@ -34,6 +34,10 @@ if command -v sxhkd >/dev/null 2>&1; then sxhkd & fi +if [ -f "$DOTFILES_PATH/de/xloadresources" ]; then + source "$DOTFILES_PATH/de/xloadresources" +fi + if [ -f "$HOME/.fehbg" ]; then "$HOME/.fehbg" & fi