diff --git a/.config/dmenu/dmenu_cmd b/.config/dmenu/dmenu_cmd index dc257f5..657c1a2 100755 --- a/.config/dmenu/dmenu_cmd +++ b/.config/dmenu/dmenu_cmd @@ -30,5 +30,5 @@ function load_theme() { } load_theme -command_run=$(echo > /dev/null | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -p " command:") +command_run=$(echo > /dev/null | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -l 18 -p " command:") ${command_run} diff --git a/.config/dmenu/dmenu_drun b/.config/dmenu/dmenu_drun index 6e1ac18..3910552 100755 --- a/.config/dmenu/dmenu_drun +++ b/.config/dmenu/dmenu_drun @@ -4,13 +4,14 @@ # dmenu_drun - dmenu script that simulates 'rofi -show drun' # # # # Author: q3aql # -# Last update: 10-07-2022 # +# Last update: 14-07-2022 # ############################################################## # Configuration variables load_theme_path="${HOME}/.dmenu" load_themes="${load_theme_path}/themes" load_theme_file="${load_theme_path}/load_theme" +load_desktop_files="${HOME}/.dmenu/desktop" desktop_files="/usr/share/applications" desktop_files_home="${HOME}/.local/share/applications" @@ -40,7 +41,8 @@ function list_desktop_files() { } function list_desktop_icons() { - list_desktop_files | while read current_desktop ; do + echo " Scan New Desktop Files" + ls -1 "${load_desktop_files}/" | while read current_desktop ; do echo " ${current_desktop}" done } @@ -57,6 +59,32 @@ rundesk () { fi } +function create_list_files() { + mkdir -p ${load_desktop_files} + if [ ! -f ${HOME}/.dmenu/read_list ] ; then + echo "0" > ${HOME}/.dmenu/read_list + fi + exec_list=$(cat ${HOME}/.dmenu/read_list) + if [ ${exec_list} -eq 0 ] ; then + rm -rf ${load_desktop_files}/* + list_desktop_files | while read current_file ; do + if [ -f "${desktop_files}/${current_file}" ] ; then + name_show=$(cat "${desktop_files}/${current_file}" | grep "Name=" | head -1 | cut -d "=" -f 2 | sed 's/\//|/g') + if [ ! -z "${name_show}" ] ; then + echo "${desktop_files}/${current_file}" > "${load_desktop_files}/${name_show}" + fi + fi + if [ -f "${desktop_files_home}/${current_file}" ] ; then + name_show=$(cat "${desktop_files_home}/${current_file}" | grep "Name=" | head -1 | cut -d "=" -f 2 | sed 's/\//|/g') + if [ ! -z "${name_show}" ] ; then + echo "${desktop_files_home}/${current_file}" > "${load_desktop_files}/${name_show}" + fi + fi + done + echo "1" > ${HOME}/.dmenu/read_list + fi +} + if [ -f /usr/bin/dex ] ; then runDesktop="dex" else @@ -64,12 +92,16 @@ else fi load_theme -list_output=$(list_desktop_icons | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -p " drun:") -run_output=$(echo ${list_output} | cut -c 4-999) -system_file=$(echo -n ${desktop_files}/ ; echo ${run_output}) -home_file=$(echo -n ${desktop_files_home}/ ; echo ${run_output}) -if [ -f "${system_file}" ] ; then - ${runDesktop} "${system_file}" -elif [ -f "${home_file}" ] ; then - ${runDesktop} "${home_file}" +create_list_files +list_output=$(list_desktop_icons | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -l 18 -p " drun:") +run_output=$(echo ${list_output} | cut -c 5-999) +if [ ! -z "${run_output}" ] ; then + if [ "${run_output}" == "Scan New Desktop Files" ] ; then + echo "0" > ${HOME}/.dmenu/read_list + create_list_files + $0 + else + run_desktop_file=$(cat "${load_desktop_files}/${run_output}") + ${runDesktop} "${run_desktop_file}" + fi fi diff --git a/.config/dmenu/dmenu_fbrun b/.config/dmenu/dmenu_fbrun index 4b582b8..29125f5 100755 --- a/.config/dmenu/dmenu_fbrun +++ b/.config/dmenu/dmenu_fbrun @@ -66,7 +66,7 @@ function remove_icon() { load_theme file=1 while [ "${file}" ]; do - file_icon=$(show_icon_tree | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -p " filebrowser: $(basename $(pwd))") + file_icon=$(show_icon_tree | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -l 18 -p " filebrowser: $(basename $(pwd))") file=$(remove_icon "${file_icon}") echo "# ${file} #" if [ -e "${file}" ]; then diff --git a/.config/dmenu/dmenu_run b/.config/dmenu/dmenu_run index 4581eaa..64942ad 100755 --- a/.config/dmenu/dmenu_run +++ b/.config/dmenu/dmenu_run @@ -56,6 +56,6 @@ function list_binaries_icons() { } load_theme -list_output=$(list_binaries_icons | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -p " run:") +list_output=$(list_binaries_icons | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -l 18 -p " run:") run_output=$(echo "${list_output}" | cut -c4-999) ${run_output} diff --git a/.config/dmenu/dmenu_themes b/.config/dmenu/dmenu_themes index 5868700..fe499e3 100755 --- a/.config/dmenu/dmenu_themes +++ b/.config/dmenu/dmenu_themes @@ -193,7 +193,7 @@ function remove_icon() { } function load_theme_selector() { - file_icon=$(show_icon_tree | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -p " Theme:") + file_icon=$(show_icon_tree | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -l 18 -p " Theme:") file=$(remove_icon "${file_icon}") if [ -z "${file}" ] ; then echo "# Theme selector canceled" @@ -208,4 +208,3 @@ function load_theme_selector() { load_theme load_themes_files load_theme_selector - diff --git a/.config/dmenu/dmenu_wrun b/.config/dmenu/dmenu_wrun index 5124012..d9563a8 100755 --- a/.config/dmenu/dmenu_wrun +++ b/.config/dmenu/dmenu_wrun @@ -4,7 +4,7 @@ # dmenu_wrun - dmenu script that simulates 'rofi -show window' # # # # Author: q3aql # -# Last update: 10-07-2022 # +# Last update: 16-07-2022 # ################################################################ # Configuration variables @@ -28,29 +28,29 @@ function load_theme() { fi } -function list_applications() { - list_raw=$(xlsclients | cut -d " " -f 3 | sed -e 's/soffice/libreoffice/g') - for process in ${list_raw}; do - echo "${process}" - done +function check_wmctrl() { + wmctrl -h &> /dev/null + error=$? + if [ ${error} -ne 0 ] ; then + echo " Error: You need install 'wmctrl'" | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -l 18 -p " window:" + exit + fi } function list_applications_icons() { - list_applications | while read current_app ; do + wmctrl -l | while read current_app ; do echo " ${current_app}" done } load_theme -list_output=$(list_applications_icons | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -p " window:") -run_output=$(echo ${list_output} | cut -c 4-999) -if [ "${run_output}" == "gimp" ] ; then - xdotool search --onlyvisible -classname "${run_output}" windowactivate &> /dev/null -elif [ "${run_output}" == "gimp-2.10" ] ; then - xdotool search --onlyvisible -classname "${run_output}" windowactivate &> /dev/null -elif [ "${run_output}" == "truecrypt" ] ; then - xdotool search --onlyvisible -classname "${run_output}" windowactivate &> /dev/null +check_wmctrl +list_output=$(list_applications_icons | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -l 18 -p " window:") +run_output=$(echo ${list_output} | cut -c 5-999) +echo "# Selected: ${run_output}" +run_output=$(echo "${run_output}" | cut -d " " -f 1) +if [ -z "${run_output}" ] ; then + echo "# Selection window canceled" else - xdotool search ".*${run_output}.*" windowactivate &> /dev/null + wmctrl -ia "${run_output}" &> /dev/null fi - diff --git a/.config/dmenu/examples/dmenu_cmd.png b/.config/dmenu/examples/dmenu_cmd.png index aa3d03d..66383c9 100644 Binary files a/.config/dmenu/examples/dmenu_cmd.png and b/.config/dmenu/examples/dmenu_cmd.png differ diff --git a/.config/dmenu/examples/dmenu_drun.png b/.config/dmenu/examples/dmenu_drun.png index 9ba3e60..66ea3ce 100644 Binary files a/.config/dmenu/examples/dmenu_drun.png and b/.config/dmenu/examples/dmenu_drun.png differ diff --git a/.config/dmenu/examples/dmenu_wrun.png b/.config/dmenu/examples/dmenu_wrun.png index 56e78df..8961168 100644 Binary files a/.config/dmenu/examples/dmenu_wrun.png and b/.config/dmenu/examples/dmenu_wrun.png differ diff --git a/.config/st/config.def.h b/.config/st/config.def.h index 22e5bd1..b1c43dd 100644 --- a/.config/st/config.def.h +++ b/.config/st/config.def.h @@ -208,8 +208,11 @@ static Shortcut shortcuts[] = { { ShiftMask, XK_Print, printscreen, {.i = 0} }, { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, { TERMMOD, XK_Prior, zoom, {.f = +1} }, + { ControlMask, XK_9, zoom, {.f = +1} }, { TERMMOD, XK_Next, zoom, {.f = -1} }, + { ControlMask, XK_8, zoom, {.f = -1} }, { TERMMOD, XK_Home, zoomreset, {.f = 0} }, + { ControlMask, XK_0, zoomreset, {.f = 0} }, { TERMMOD, XK_C, clipcopy, {.i = 0} }, { TERMMOD, XK_V, clippaste, {.i = 0} }, { TERMMOD, XK_Y, selpaste, {.i = 0} }, diff --git a/.config/st/config.h b/.config/st/config.h index 22e5bd1..b1c43dd 100644 --- a/.config/st/config.h +++ b/.config/st/config.h @@ -208,8 +208,11 @@ static Shortcut shortcuts[] = { { ShiftMask, XK_Print, printscreen, {.i = 0} }, { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, { TERMMOD, XK_Prior, zoom, {.f = +1} }, + { ControlMask, XK_9, zoom, {.f = +1} }, { TERMMOD, XK_Next, zoom, {.f = -1} }, + { ControlMask, XK_8, zoom, {.f = -1} }, { TERMMOD, XK_Home, zoomreset, {.f = 0} }, + { ControlMask, XK_0, zoomreset, {.f = 0} }, { TERMMOD, XK_C, clipcopy, {.i = 0} }, { TERMMOD, XK_V, clippaste, {.i = 0} }, { TERMMOD, XK_Y, selpaste, {.i = 0} }, diff --git a/.config/st/examples/st.png b/.config/st/examples/st.png new file mode 100644 index 0000000..5dc0374 Binary files /dev/null and b/.config/st/examples/st.png differ diff --git a/.config/st/st.desktop b/.config/st/st.desktop index 814797e..457d757 100755 --- a/.config/st/st.desktop +++ b/.config/st/st.desktop @@ -5,7 +5,7 @@ TryExec=st Icon=utilities-terminal Terminal=false Categories=System;TerminalEmulator; -Name=st +Name=st Simple Terminal (Suckless) GenericName=Terminal Comment=st is a simple terminal implementation for X StartupWMClass=st-256color