dotfiles

Cem's Dotfiles
git clone git://git.ckyln.com/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit dbd7a9f962b9f5228e1744bb713aa64137093ceb
parent 0487a30b27226b8e132e9c1f5462464b00f2cd2b
Author: Cem Keylan <cem@ckyln.com>
Date:   Mon, 11 Nov 2019 16:41:55 +0300

add zathura config and zathura colors

Diffstat:
A.config/zathura/zathurarc | 5+++++
M.local/bin/dmenuresources | 2++
A.local/bin/zc | 43+++++++++++++++++++++++++++++++++++++++++++
3 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc @@ -0,0 +1,5 @@ +include /tmp/zathura-color +set selection-clipboard clipboard +set pages-per-row 1 + +# vim:filetype=conf diff --git a/.local/bin/dmenuresources b/.local/bin/dmenuresources @@ -1,4 +1,5 @@ #!/usr/bin/env sh +. "$HOME"/.profile # User chooses between dark and light themes theme="$(printf "dark\nlight" | dmenu -p "Do you want a light theme or a night theme?")" @@ -8,4 +9,5 @@ lsrsrc="$(ls $HOME/.local/share/xresource-themes/$theme/)" selrsrc="$(echo "$lsrsrc" | dmenu -p "choose the resource you want to set")" [ -z "$selrsrc" ] && exit xrdb $HOME/.local/share/xresource-themes/$theme/$selrsrc && notify-send "Xresources Changed" "Your theme has been set to $selrsrc" +[ "$ZATHURA_RECOLOR" = "true" ] && zc printf "$HOME/.local/share/xresource-themes/$theme/$selrsrc" > $HOME/.lastresource diff --git a/.local/bin/zc b/.local/bin/zc @@ -0,0 +1,43 @@ +#!/usr/bin/env sh +if [ "$1" = "off" ]; then + sed -i 's/true/false/g' /tmp/zathura-color + exit 0 +fi + +. "$HOME"/.profile + +foreground="$(xrdb -query | grep foreground | head -n 1 | awk '{print $2}')" +background="$(xrdb -query | grep background | head -n 1 | awk '{print $2}')" +color1="$(xrdb -query | grep color1 | head -n 1 | awk '{print $2}')" +color2="$(xrdb -query | grep color2 | head -n 1 | awk '{print $2}')" + +rm /tmp/zathura-color >/dev/null 2>&1 +cat >/tmp/zathura-color <<EOF +set recolor "$ZATHURA_RECOLOR" + +set completion-bg "$background" +set completion-fg "$foreground" +set completion-group-bg "$background" +set completion-group-fg "$color2" +set completion-highlight-bg "$foreground" +set completion-highlight-fg "$background" +set recolor-lightcolor "$background" +set recolor-darkcolor "$foreground" +set default-bg "$background" +set inputbar-bg "$background" +set inputbar-fg "$foreground" +set notification-bg "$background" +set notification-fg "$foreground" +set notification-error-bg "$color1" +set notification-error-fg "$foreground" +set notification-warning-bg "$color1" +set notification-warning-fg "$foreground" +set statusbar-bg "$background" +set statusbar-fg "$foreground" +set index-bg "$background" +set index-fg "$foreground" +set index-active-bg "$foreground" +set index-active-fg "$background" +set render-loading-bg "$background" +set render-loading-fg "$foreground" +EOF