From c87cc70c08eb4e4a3e62469a29430924224fbcac Mon Sep 17 00:00:00 2001 From: q3aql Date: Thu, 26 May 2022 23:26:07 +0200 Subject: [PATCH] Dotfiles config update (2022-05-26) --- .Xresources | 3 ++- .config/dmenu/dmenu_drun | 13 ++++++++++--- .config/dmenu/dmenu_run | 35 +++++++++++++++++++++++------------ 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/.Xresources b/.Xresources index a90483f..d205cc7 100644 --- a/.Xresources +++ b/.Xresources @@ -9,8 +9,9 @@ Xft.hintstyle: hintfull Xft.lcdfilter: lcdfilter XTerm*renderFont: true -!XTerm*faceName: xft:Mononoki Nerd Font XTerm*faceName: xft:Monospace +!XTerm*faceName: xft:Liberation Mono +!XTerm*faceName: xft:Mononoki Nerd Font XTerm*faceSize: 10 XTerm*utf8: 2 XTerm*locale: true diff --git a/.config/dmenu/dmenu_drun b/.config/dmenu/dmenu_drun index fad5709..fd49479 100755 --- a/.config/dmenu/dmenu_drun +++ b/.config/dmenu/dmenu_drun @@ -5,13 +5,19 @@ desktop_files_home="${HOME}/.local/share/applications" list_desktop_files() { if [ -d "${desktop_files}" ] ; then - ls -1 "${desktop_files}" + ls -1 "${desktop_files}/" | grep ".desktop" fi if [ -d "${desktop_files_home}" ] ; then - ls -1 "${desktop_files_home}" + ls -1 "${desktop_files_home}/" | grep ".desktop" fi } +list_desktop_icons() { + list_desktop_files | while read desktop_file ; do + echo " ${desktop_file}" + done +} + rundesk () { if [ -z ${1} ] ; then echo "No file entry" @@ -30,7 +36,8 @@ else runDesktop="rundesk" fi -list_output=$(list_desktop_files | dmenu "$@") +#list_output=$(list_desktop_files | dmenu "$@") +list_output=$(list_desktop_icons | dmenu "$@") if [ -f "${desktop_files}/${list_output}" ] ; then ${runDesktop} "${desktop_files}/${list_output}" elif [ -f "${desktop_files_home}/${list_output}" ] ; then diff --git a/.config/dmenu/dmenu_run b/.config/dmenu/dmenu_run index 9f6d0c4..610c2ba 100755 --- a/.config/dmenu/dmenu_run +++ b/.config/dmenu/dmenu_run @@ -1,15 +1,26 @@ -#!/bin/sh +#!/bin/bash -dmenu_path_output() { - cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}" - cache="$cachedir/dmenu_run" - [ ! -e "$cachedir" ] && mkdir -p "$cachedir" - IFS=: - if stest -dqr -n "$cache" $PATH; then - stest -flx $PATH | sort -u | tee "$cache" - else - cat "$cache" - fi +list_binaries() { + binaries=0 + path_binaries=${PATH} + count_path=1 + while [ ${binaries} -eq 0 ] ; do + current_path=$(echo ${path_binaries} | cut -d ":" -f ${count_path}) + if [ -z "${current_path}" ] ; then + binaries=1 + else + ls -1 ${current_path}/ + count_path=$(expr ${count_path} + 1) + fi + done } -dmenu_path_output | dmenu "$@" | ${SHELL:-"/bin/sh"} & +list_binaries_icons() { + list_binaries | while read current_binary ; do + echo " ${current_binary}" + done +} + +#list_output=$(list_binaries | dmenu "$@") +list_output=$(list_binaries_icons | dmenu "$@") +${list_output}