commit 84c41ff395103f4cc2100469d4ec175436eb1a6c
parent 471ea3ec2ced1c0713a1676d48a13297d1688f2c
Author: Oscar Benedito <oscar@oscarbenedito.com>
Date:   Mon, 22 Jun 2020 12:19:34 +0200

Add .config/Xresources file

With config for dwm and dmenu.

Diffstat:
A.config/Xresources | 32++++++++++++++++++++++++++++++++
M.config/files | 2+-
M.local/bin/configure-monitors | 14++++++++++++--
T.profile | 0
4 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/.config/Xresources b/.config/Xresources @@ -0,0 +1,32 @@ +! vim: filetype=xdefaults + +! Xft.dpi: 192 + +#define black #282c34 +#define red #e06c75 +#define green #98c379 +#define yellow #e5c07b +#define blue #61afef +#define purple #c678dd +#define cyan #56b6c2 +#define white #d3d7de + +#define bg #000000 +#define fg #eeeeee +#define border #444444 +#define selbg #285577 +#define selfg #eeeeee +#define selborder selbg + + +dmenu.background: bg +dmenu.foreground: fg +dmenu.selbackground: selbg +dmenu.selforeground: selfg + +dwm.normbgcolor: bg +dwm.normfgcolor: fg +dwm.normbordercolor: border +dwm.selbgcolor: selbg +dwm.selfgcolor: selfg +dwm.selbordercolor: selborder diff --git a/.config/files b/.config/files @@ -5,5 +5,5 @@ cfd $XDG_CONFIG_HOME/directories cfe $XDG_CONFIG_HOME/zsh/.zshenv cff $XDG_CONFIG_HOME/files cfv $XDG_CONFIG_HOME/nvim/init.vim -cfx $HOME/.Xresources +cfx $XDG_CONFIG_HOME/Xresources cfz $XDG_CONFIG_HOME/zsh/.zshrc diff --git a/.local/bin/configure-monitors b/.local/bin/configure-monitors @@ -1,9 +1,19 @@ #!/usr/bin/env sh +xr="${XDG_CONFIG_HOME:-$HOME/.config}/Xresources" + if [ -n "$(xrandr --query | grep "DP2 connected")" ]; then xrandr --output eDP1 --off --output DP2 --auto - echo "! Xft.dpi: 192" > $HOME/.Xresources + if grep --quiet "Xft.dpi: 192" "$xr"; then + sed -i "s/^Xft.dpi: 192/! Xft.dpi: 192/g" "$xr" + else + echo "! Xft.dpi: 192" >> "$xr" + fi else xrandr --output eDP1 --auto --output DP2 --off - echo "Xft.dpi: 192" > $HOME/.Xresources + if grep --quiet "Xft.dpi: 192" "$xr"; then + sed -i "s/^! Xft.dpi: 192/Xft.dpi: 192/g" "$xr" + else + echo "Xft.dpi: 192" >> "$xr" + fi fi diff --git a/.profile b/.profile