Dotfiles config update (2022-07-21)

This commit is contained in:
q3aql 2022-07-21 01:39:20 +02:00
parent a15649627d
commit 393c602e67
2 changed files with 37 additions and 3 deletions

View File

@ -4,7 +4,7 @@
# 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: 16-07-2022 # # Last update: 20-07-2022 #
############################################################## ##############################################################
# Configuration variables # Configuration variables
@ -13,7 +13,9 @@ 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" load_desktop_files="${HOME}/.dmenu/desktop"
desktop_files="/usr/share/applications" desktop_files="/usr/share/applications"
desktop_files_local="/usr/local/share/applications"
desktop_files_home="${HOME}/.local/share/applications" desktop_files_home="${HOME}/.local/share/applications"
desktop_files_flatpak="/var/lib/flatpak/exports/share/applications"
function load_theme() { function load_theme() {
if [ -f "${load_theme_file}" ] ; then if [ -f "${load_theme_file}" ] ; then
@ -35,9 +37,15 @@ function list_desktop_files() {
if [ -d "${desktop_files}" ] ; then if [ -d "${desktop_files}" ] ; then
ls -1 "${desktop_files}/" | grep ".desktop" ls -1 "${desktop_files}/" | grep ".desktop"
fi fi
if [ -d "${desktop_files_local}" ] ; then
ls -1 "${desktop_files_local}/" | grep ".desktop"
fi
if [ -d "${desktop_files_home}" ] ; then if [ -d "${desktop_files_home}" ] ; then
ls -1 "${desktop_files_home}/" | grep ".desktop" ls -1 "${desktop_files_home}/" | grep ".desktop"
fi fi
if [ -d "${desktop_files_flatpak}" ] ; then
ls -1 "${desktop_files_flatpak}/" | grep ".desktop"
fi
} }
function list_desktop_icons() { function list_desktop_icons() {
@ -74,12 +82,24 @@ function create_list_files() {
echo "${desktop_files}/${current_file}" > "${load_desktop_files}/${name_show}" echo "${desktop_files}/${current_file}" > "${load_desktop_files}/${name_show}"
fi fi
fi fi
if [ -f "${desktop_files_local}/${current_file}" ] ; then
name_show=$(cat "${desktop_files_local}/${current_file}" | grep "Name=" | head -1 | cut -d "=" -f 2 | sed 's/\//|/g')
if [ ! -z "${name_show}" ] ; then
echo "${desktop_files_local}/${current_file}" > "${load_desktop_files}/${name_show}"
fi
fi
if [ -f "${desktop_files_home}/${current_file}" ] ; then 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') name_show=$(cat "${desktop_files_home}/${current_file}" | grep "Name=" | head -1 | cut -d "=" -f 2 | sed 's/\//|/g')
if [ ! -z "${name_show}" ] ; then if [ ! -z "${name_show}" ] ; then
echo "${desktop_files_home}/${current_file}" > "${load_desktop_files}/${name_show}" echo "${desktop_files_home}/${current_file}" > "${load_desktop_files}/${name_show}"
fi fi
fi fi
if [ -f "${desktop_files_flatpak}/${current_file}" ] ; then
name_show=$(cat "${desktop_files_flatpak}/${current_file}" | grep "Name=" | head -1 | cut -d "=" -f 2 | sed 's/\//|/g')
if [ ! -z "${name_show}" ] ; then
echo "${desktop_files_flatpak}/${current_file}" > "${load_desktop_files}/${name_show}"
fi
fi
done done
echo "1" > ${HOME}/.dmenu/read_list echo "1" > ${HOME}/.dmenu/read_list
fi fi

View File

@ -30,7 +30,7 @@ function load_theme() {
function load_themes_files() { function load_themes_files() {
count_themes=$(ls -1 "${load_themes}/" | wc -l) count_themes=$(ls -1 "${load_themes}/" | wc -l)
if [ ${count_themes} -lt 18 ] ; then if [ ${count_themes} -lt 20 ] ; then
# Default Purple # Default Purple
echo "#!/bin/bash" > ${load_themes}/default-purple echo "#!/bin/bash" > ${load_themes}/default-purple
echo "" >> ${load_themes}/default-purple echo "" >> ${load_themes}/default-purple
@ -164,6 +164,20 @@ function load_themes_files() {
echo "NBCOLOR=\"#a9a8a7\"" >> ${load_themes}/white-wine echo "NBCOLOR=\"#a9a8a7\"" >> ${load_themes}/white-wine
echo "SFCOLOR=\"#a9a8a7\"" >> ${load_themes}/white-wine echo "SFCOLOR=\"#a9a8a7\"" >> ${load_themes}/white-wine
echo "SBCOLOR=\"#861616\"" >> ${load_themes}/white-wine echo "SBCOLOR=\"#861616\"" >> ${load_themes}/white-wine
# Arc Dark
echo "#!/bin/bash" > ${load_themes}/arc-dark
echo "" >> ${load_themes}/arc-dark
echo "NFCOLOR=\"#bbbbbb\"" >> ${load_themes}/arc-dark
echo "NBCOLOR=\"#2f3239\"" >> ${load_themes}/arc-dark
echo "SFCOLOR=\"#dddddd\"" >> ${load_themes}/arc-dark
echo "SBCOLOR=\"#217dd0\"" >> ${load_themes}/arc-dark
# Gruvbox Dark
echo "#!/bin/bash" > ${load_themes}/gruvbox-dark
echo "" >> ${load_themes}/gruvbox-dark
echo "NFCOLOR=\"#efe4c2\"" >> ${load_themes}/gruvbox-dark
echo "NBCOLOR=\"#2e281f\"" >> ${load_themes}/gruvbox-dark
echo "SFCOLOR=\"#efe4c2\"" >> ${load_themes}/gruvbox-dark
echo "SBCOLOR=\"#655a4b\"" >> ${load_themes}/gruvbox-dark
fi fi
} }
@ -193,7 +207,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}" -l 18 -p " Theme:") file_icon=$(show_icon_tree | dmenu -i -nb "${NBCOLOR}" -nf "${NFCOLOR}" -sb "${SBCOLOR}" -sf "${SFCOLOR}" -l 20 -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"