45 lines
1.6 KiB
Plaintext
45 lines
1.6 KiB
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
##############################################################
|
||
|
# bemenu_cmd - bemenu script that simulates 'rofi -show run' #
|
||
|
# only insert command #
|
||
|
# #
|
||
|
# Author: q3aql <q3aql@duck.com> #
|
||
|
# Last update: 03-12-2022 #
|
||
|
##############################################################
|
||
|
|
||
|
# Configuration variables
|
||
|
load_theme_path="${HOME}/.bemenu"
|
||
|
load_themes="${load_theme_path}/themes"
|
||
|
load_theme_file="${load_theme_path}/load_theme"
|
||
|
|
||
|
function load_theme() {
|
||
|
if [ -f "${load_theme_file}" ] ; then
|
||
|
source "${load_theme_file}"
|
||
|
else
|
||
|
mkdir -p "${load_theme_path}"
|
||
|
mkdir -p "${load_themes}"
|
||
|
echo "#!/bin/bash" > ${load_theme_file}
|
||
|
echo "" >> ${load_theme_file}
|
||
|
echo "NFCOLOR=\"#bbbbbb\"" >> ${load_theme_file}
|
||
|
echo "NBCOLOR=\"#1f1f35\"" >> ${load_theme_file}
|
||
|
echo "SFCOLOR=\"#eeeeee\"" >> ${load_theme_file}
|
||
|
echo "SBCOLOR=\"#664477\"" >> ${load_theme_file}
|
||
|
source "${load_theme_file}"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
function generate_spaces() {
|
||
|
num_spaces=${1}
|
||
|
count_spaces=1
|
||
|
while [ ${count_spaces} -le ${num_spaces} ] ; do
|
||
|
echo -n " "
|
||
|
count_spaces=$(expr ${count_spaces} + 1)
|
||
|
done
|
||
|
}
|
||
|
|
||
|
|
||
|
load_theme
|
||
|
command_run=$(echo > /dev/null | bemenu -c -i -W 0.5 --fn 'UbuntuMono Nerd Font 14' --tb "${SBCOLOR}" --tf "${SFCOLOR}" --fb "${NBCOLOR}" --ff "${NFCOLOR}" --nb "${NBCOLOR}" --ab "${NBCOLOR}" --nf "${NFCOLOR}" --af "${NFCOLOR}" --sb "${SBCOLOR}" --sf "${SFCOLOR}" --hb "${SBCOLOR}" --hf "${SFCOLOR}" -l 18 -p " command:")
|
||
|
${command_run}
|