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
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}

View File

@ -4,13 +4,14 @@
# dmenu_drun - dmenu script that simulates 'rofi -show drun' #
# #
# Author: q3aql <q3aql@duck.com> #
# 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

View File

@ -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

View File

@ -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}

View File

@ -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

View File

@ -4,7 +4,7 @@
# dmenu_wrun - dmenu script that simulates 'rofi -show window' #
# #
# Author: q3aql <q3aql@duck.com> #
# 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

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} },
{ 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} },

View File

@ -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} },

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
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