From: Dmitry Fedotov Date: Sun, 10 Jan 2021 22:13:59 +0000 (+0300) Subject: Add selected color for dmenu scripts X-Git-Url: https://git.dmfe.net/?a=commitdiff_plain;h=e2cbcbf6a4cc330a04f6eb9ce12535b0a87c2a59;p=dotfiles Add selected color for dmenu scripts --- diff --git a/scripts/dmenu-run.sh b/scripts/dmenu-run.sh index ef15437..534c325 100755 --- a/scripts/dmenu-run.sh +++ b/scripts/dmenu-run.sh @@ -1,5 +1,6 @@ #!/bin/bash panel_background=$(xrdb -query | grep '*.panel_background' | awk '{print $NF}') +selected_background=$(xrdb -query | grep '*.ws_focused' | awk '{print $NF}') -dmenu_run -l 20 -fn Monospace-18 -nb ${panel_background} +dmenu_run -l 20 -fn Monospace-18 -nb ${panel_background} -sb "${selected_background}" diff --git a/scripts/dmenu-unicode.sh b/scripts/dmenu-unicode.sh index 6263a29..689ea78 100755 --- a/scripts/dmenu-unicode.sh +++ b/scripts/dmenu-unicode.sh @@ -1,8 +1,10 @@ #!/bin/bash panel_background=$(xrdb -query | grep '*.panel_background' | awk '{print $NF}') +selected_background=$(xrdb -query | grep '*.ws_focused' | awk '{print $NF}') + choose=$(grep -v "#" ~/.local/share/emoji | \ - dmenu -i -l 20 -fn Monospace-18 -nb ${panel_background} | \ + dmenu -i -l 20 -fn Monospace-18 -nb ${panel_background} -sb "${selected_background}"| \ awk '{print $1}') if [[ -z ${choose} ]]; then diff --git a/scripts/dmenumount.sh b/scripts/dmenumount.sh index 1bbf3e1..489e725 100755 --- a/scripts/dmenumount.sh +++ b/scripts/dmenumount.sh @@ -2,19 +2,20 @@ font="Monospace-18" panel_background=$(xrdb -query | grep '*.panel_background' | awk '{print $NF}') +selected_background=$(xrdb -query | grep '*.ws_focused' | awk '{print $NF}') pgrep -x dmenu && exit mountable=$(lsblk -lp | grep "part $" | awk '{print $1, "(" $4 ")"}') [[ "${mountable}" = "" ]] && exit 1 -chosen=$(echo "${mountable}" | dmenu -fn "${font}" -nb "${panel_background}" -i -p "Mount which drive?" | awk '{print $1}') +chosen=$(echo "${mountable}" | dmenu -fn "${font}" -nb "${panel_background}" -sb "${selected_background}" -i -p "Mount which drive?" | awk '{print $1}') [[ "${chosen}" = "" ]] && exit 1 mount "${chosen}" > /dev/null 2>&1 && notify-send "${chosen} mounted based on fstab" && exit 0 dirs=$(find /mnt /media /home -type d -maxdepth 3 2>/dev/null) -mountpoint=$(echo "${dirs}" | dmenu -fn "${font}" -nb "${panel_background}" -i -p "Type in mount point.") +mountpoint=$(echo "${dirs}" | dmenu -fn "${font}" -nb "${panel_background}" -sb "${selected_background}" -i -p "Type in mount point.") [[ "${mountpoint}" = "" ]] && exit 1 if [[ ! -d "${mountpoint}" ]]; then - mkdiryn=$(echo -e "Yes\nNo" | dmenu -fn "${font}" -nb "${panel_background}" -i -p "${mountpoint} does not exist. Create it?") + mkdiryn=$(echo -e "Yes\nNo" | dmenu -fn "${font}" -nb "${panel_background}" -sb "${selected_background}" -i -p "${mountpoint} does not exist. Create it?") [[ "${mkdiryn}" = Yes ]] && sudo mkdir -p "${mountpoint}" fi sudo mount $chosen $mountpoint -o uid="$(id -u `whoami`)",gid="$(id -g `whoami`)" && \ diff --git a/scripts/shutdown.sh b/scripts/shutdown.sh index bdca016..8c74e2f 100755 --- a/scripts/shutdown.sh +++ b/scripts/shutdown.sh @@ -2,14 +2,15 @@ font="Monospace-18" panel_background=$(xrdb -query | grep '*.panel_background' | awk '{print $NF}') +selected_background=$(xrdb -query | grep '*.ws_focused' | awk '{print $NF}') pgrep -x dmenu && exit -chosen=$(echo -e "Shutdown\nReboot" | dmenu -fn "${font}" -nb "${panel_background}" -i -p "What would you like to do?") +chosen=$(echo -e "Shutdown\nReboot" | dmenu -fn "${font}" -nb "${panel_background}" -sb "${selected_background}" -i -p "What would you like to do?") if [[ "${chosen}" = Shutdown ]]; then - yesno=$(echo -e "Yes\nNo" | dmenu -fn "${font}" -nb "${panel_background}" -i -p "Do you really want to shutdown?") + yesno=$(echo -e "Yes\nNo" | dmenu -fn "${font}" -nb "${panel_background}" -sb "${selected_background}" -i -p "Do you really want to shutdown?") [[ "${yesno}" = Yes ]] && sudo shutdown -h now elif [[ "${chosen}" = Reboot ]]; then - yesno=$(echo -e "Yes\nNo" | dmenu -fn "${font}" -nb "${panel_background}" -i -p "Do you really want to reboot?") + yesno=$(echo -e "Yes\nNo" | dmenu -fn "${font}" -nb "${panel_background}" -sb "${selected_background}" -i -p "Do you really want to reboot?") [[ "${yesno}" = Yes ]] && sudo reboot fi diff --git a/shell/init_scripts/configs.mrc b/shell/init_scripts/configs.mrc index fc5e3c4..31b529e 100644 --- a/shell/init_scripts/configs.mrc +++ b/shell/init_scripts/configs.mrc @@ -7,7 +7,7 @@ export XDG_CONFIG_HOME=${HOME}/.config +alias vi='vi -c "let g:tty='\''$(tty)'\''"' alias i3c="vi ${HOME}/.config/i3/config" alias bsc="vi ${HOME}/.bashrc" -alias emc="vi ${HOME}/.emacs" alias tmux="tmux -f ${XDG_CONFIG_HOME}/tmux/config"