Dotfiles config update (2022-07-16)

This commit is contained in:
q3aql 2022-07-16 13:28:07 +02:00
parent 3fe675e2f7
commit 22eb15c3c0
13 changed files with 70 additions and 33 deletions

View File

@ -30,5 +30,5 @@ function load_theme() {
} }
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} ${command_run}

View File

@ -4,13 +4,14 @@
# dmenu_drun - dmenu script that simulates 'rofi -show drun' # # dmenu_drun - dmenu script that simulates 'rofi -show drun' #
# # # #
# Author: q3aql <q3aql@duck.com> # # Author: q3aql <q3aql@duck.com> #
# Last update: 10-07-2022 # # Last update: 14-07-2022 #
############################################################## ##############################################################
# Configuration variables # Configuration variables
load_theme_path="${HOME}/.dmenu" load_theme_path="${HOME}/.dmenu"
load_themes="${load_theme_path}/themes" load_themes="${load_theme_path}/themes"
load_theme_file="${load_theme_path}/load_theme" load_theme_file="${load_theme_path}/load_theme"
load_desktop_files="${HOME}/.dmenu/desktop"
desktop_files="/usr/share/applications" desktop_files="/usr/share/applications"
desktop_files_home="${HOME}/.local/share/applications" desktop_files_home="${HOME}/.local/share/applications"
@ -40,7 +41,8 @@ function list_desktop_files() {
} }
function list_desktop_icons() { 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}" echo " ${current_desktop}"
done done
} }
@ -57,6 +59,32 @@ rundesk () {
fi 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 if [ -f /usr/bin/dex ] ; then
runDesktop="dex" runDesktop="dex"
else else
@ -64,12 +92,16 @@ else
fi fi
load_theme load_theme
list_output=$(list_desktop_icons | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -p " drun:") create_list_files
run_output=$(echo ${list_output} | cut -c 4-999) list_output=$(list_desktop_icons | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -l 18 -p " drun:")
system_file=$(echo -n ${desktop_files}/ ; echo ${run_output}) run_output=$(echo ${list_output} | cut -c 5-999)
home_file=$(echo -n ${desktop_files_home}/ ; echo ${run_output}) if [ ! -z "${run_output}" ] ; then
if [ -f "${system_file}" ] ; then if [ "${run_output}" == "Scan New Desktop Files" ] ; then
${runDesktop} "${system_file}" echo "0" > ${HOME}/.dmenu/read_list
elif [ -f "${home_file}" ] ; then create_list_files
${runDesktop} "${home_file}" $0
else
run_desktop_file=$(cat "${load_desktop_files}/${run_output}")
${runDesktop} "${run_desktop_file}"
fi
fi fi

View File

@ -66,7 +66,7 @@ function remove_icon() {
load_theme load_theme
file=1 file=1
while [ "${file}" ]; do 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}") file=$(remove_icon "${file_icon}")
echo "# ${file} #" echo "# ${file} #"
if [ -e "${file}" ]; then if [ -e "${file}" ]; then

View File

@ -56,6 +56,6 @@ function list_binaries_icons() {
} }
load_theme 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=$(echo "${list_output}" | cut -c4-999)
${run_output} ${run_output}

View File

@ -193,7 +193,7 @@ function remove_icon() {
} }
function load_theme_selector() { 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}") file=$(remove_icon "${file_icon}")
if [ -z "${file}" ] ; then if [ -z "${file}" ] ; then
echo "# Theme selector canceled" echo "# Theme selector canceled"
@ -208,4 +208,3 @@ function load_theme_selector() {
load_theme load_theme
load_themes_files load_themes_files
load_theme_selector load_theme_selector

View File

@ -4,7 +4,7 @@
# dmenu_wrun - dmenu script that simulates 'rofi -show window' # # dmenu_wrun - dmenu script that simulates 'rofi -show window' #
# # # #
# Author: q3aql <q3aql@duck.com> # # Author: q3aql <q3aql@duck.com> #
# Last update: 10-07-2022 # # Last update: 16-07-2022 #
################################################################ ################################################################
# Configuration variables # Configuration variables
@ -28,29 +28,29 @@ function load_theme() {
fi fi
} }
function list_applications() { function check_wmctrl() {
list_raw=$(xlsclients | cut -d " " -f 3 | sed -e 's/soffice/libreoffice/g') wmctrl -h &> /dev/null
for process in ${list_raw}; do error=$?
echo "${process}" if [ ${error} -ne 0 ] ; then
done 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() { function list_applications_icons() {
list_applications | while read current_app ; do wmctrl -l | while read current_app ; do
echo " ${current_app}" echo " ${current_app}"
done done
} }
load_theme load_theme
list_output=$(list_applications_icons | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -p " window:") check_wmctrl
run_output=$(echo ${list_output} | cut -c 4-999) list_output=$(list_applications_icons | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -l 18 -p " window:")
if [ "${run_output}" == "gimp" ] ; then run_output=$(echo ${list_output} | cut -c 5-999)
xdotool search --onlyvisible -classname "${run_output}" windowactivate &> /dev/null echo "# Selected: ${run_output}"
elif [ "${run_output}" == "gimp-2.10" ] ; then run_output=$(echo "${run_output}" | cut -d " " -f 1)
xdotool search --onlyvisible -classname "${run_output}" windowactivate &> /dev/null if [ -z "${run_output}" ] ; then
elif [ "${run_output}" == "truecrypt" ] ; then echo "# Selection window canceled"
xdotool search --onlyvisible -classname "${run_output}" windowactivate &> /dev/null
else else
xdotool search ".*${run_output}.*" windowactivate &> /dev/null wmctrl -ia "${run_output}" &> /dev/null
fi fi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -208,8 +208,11 @@ static Shortcut shortcuts[] = {
{ ShiftMask, XK_Print, printscreen, {.i = 0} }, { ShiftMask, XK_Print, printscreen, {.i = 0} },
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, { XK_ANY_MOD, XK_Print, printsel, {.i = 0} },
{ TERMMOD, XK_Prior, zoom, {.f = +1} }, { TERMMOD, XK_Prior, zoom, {.f = +1} },
{ ControlMask, XK_9, zoom, {.f = +1} },
{ TERMMOD, XK_Next, zoom, {.f = -1} }, { TERMMOD, XK_Next, zoom, {.f = -1} },
{ ControlMask, XK_8, zoom, {.f = -1} },
{ TERMMOD, XK_Home, zoomreset, {.f = 0} }, { TERMMOD, XK_Home, zoomreset, {.f = 0} },
{ ControlMask, XK_0, zoomreset, {.f = 0} },
{ TERMMOD, XK_C, clipcopy, {.i = 0} }, { TERMMOD, XK_C, clipcopy, {.i = 0} },
{ TERMMOD, XK_V, clippaste, {.i = 0} }, { TERMMOD, XK_V, clippaste, {.i = 0} },
{ TERMMOD, XK_Y, selpaste, {.i = 0} }, { TERMMOD, XK_Y, selpaste, {.i = 0} },

View File

@ -208,8 +208,11 @@ static Shortcut shortcuts[] = {
{ ShiftMask, XK_Print, printscreen, {.i = 0} }, { ShiftMask, XK_Print, printscreen, {.i = 0} },
{ XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, { XK_ANY_MOD, XK_Print, printsel, {.i = 0} },
{ TERMMOD, XK_Prior, zoom, {.f = +1} }, { TERMMOD, XK_Prior, zoom, {.f = +1} },
{ ControlMask, XK_9, zoom, {.f = +1} },
{ TERMMOD, XK_Next, zoom, {.f = -1} }, { TERMMOD, XK_Next, zoom, {.f = -1} },
{ ControlMask, XK_8, zoom, {.f = -1} },
{ TERMMOD, XK_Home, zoomreset, {.f = 0} }, { TERMMOD, XK_Home, zoomreset, {.f = 0} },
{ ControlMask, XK_0, zoomreset, {.f = 0} },
{ TERMMOD, XK_C, clipcopy, {.i = 0} }, { TERMMOD, XK_C, clipcopy, {.i = 0} },
{ TERMMOD, XK_V, clippaste, {.i = 0} }, { TERMMOD, XK_V, clippaste, {.i = 0} },
{ TERMMOD, XK_Y, selpaste, {.i = 0} }, { TERMMOD, XK_Y, selpaste, {.i = 0} },

BIN
.config/st/examples/st.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -5,7 +5,7 @@ TryExec=st
Icon=utilities-terminal Icon=utilities-terminal
Terminal=false Terminal=false
Categories=System;TerminalEmulator; Categories=System;TerminalEmulator;
Name=st Name=st Simple Terminal (Suckless)
GenericName=Terminal GenericName=Terminal
Comment=st is a simple terminal implementation for X Comment=st is a simple terminal implementation for X
StartupWMClass=st-256color StartupWMClass=st-256color