master
Daniel Napora 2021-10-21 18:15:31 +02:00
parent ba9cd67d25
commit 6065ffb611
4 changed files with 40 additions and 14 deletions

27
bin/mbx
View File

@ -88,6 +88,7 @@ stay_alive = 0
terminal_exec = ${terminal:-terminator}
terminal_args = -e
hover_delay = 80
columns = ${columns:-1}
# MENU
menu_halign = ${menu_halign:-left}
menu_valign = ${menu_valign:-center}
@ -244,19 +245,31 @@ about() {
theight=$((HEIGHT/4))
THUMB="$(DISPLAY=:0 scrot -t ${twidth}x${theight} -o $HOME/.config/mbxutils/mbx.png -e 'echo $m')"
# TODO better menu height calculation
columns=2
icon_size=$((font_size*item_height_factor/100-2))
menu_halign=center
menu_padding=8
menu_width=$((twidth+menu_padding*2))
menu_padding_top=$((theight+menu_padding*2))
item_height=$((font_size*item_height_factor/100))
menu_padding_top=$((theight+menu_padding*2+40))
menu_height_max=$((menu_padding_top+menu_padding+item_height*7+sep_height*6))
menu_height_min=$((menu_padding_top+menu_padding+item_height*7+sep_height*6))
configure
cat <<EOF > ${MENU_ITEMS}
@icon,,${menu_padding},${menu_padding},${twidth},${theight},4,left,top,,,$THUMB
^sep(About mbxutils)
Visit website,xdg-open https://maboxlinux.org
@text,,$((menu_padding+20)),$((menu_padding+theight)),${twidth},25,4,left,top,${fgcolor},#DDDDDD,<span font="20px"><b>mbxutils</b></span><span font="12px"> 0.2.0 (technical preview)</span>
@text,,$((menu_padding+40)),$((menu_padding+theight+20)),${twidth},25,4,left,top,${fgcolor} 60,${fgcolor} 12,<span font="12px"><i>a set of lightweight and handy utilities for your X11 window manager</i></span>
#^sep(mbxutils <span font-weight="normal"><sub><i>handy utils for your X11 window manager</i></sub></span>)
^sep(Utilities)
Main menu,mbx mmenu,menu
Left SidePanel,mbx lpanel,arrow-left
Right SidePanel,mbx rpanel,arrow-right
Quick Filebrowser,mbx files,folder
Preferences,^pipe(mbx preferences mmenu),firefox
^sep(Manual)
Configure keybindings,xdg-open https://mbxutils.maboxlinux.org,firefox
Roadmap
EOF
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null

View File

@ -10,7 +10,7 @@ CNF_FILE="$CNF_DIR/mbx.conf"
mkdir -p "$CNF_DIR"/inc
check_fonts() {
search_fonts=(Ubuntu "DejaVu Serif" "Autour One" "Noto Sans" "Noto Sans Light" "JetBrains Mono" "Droid Sans" Roboto Helvetica Cantarell)
search_fonts=(Ubuntu "Noto Sans" "Noto Sans Light" "DejaVu Serif" "Autour One" "JetBrains Mono" "Droid Sans" Roboto Helvetica Cantarell)
while read -r x
do
if ( dlm=$'\x1F' ; IFS="$dlm" ; [[ "$dlm${search_fonts[*]}$dlm" == *"$dlm${x}$dlm"* ]] ) ; then
@ -18,6 +18,7 @@ check_fonts() {
fi
done < <(fc-list| cut -d: -f2|cut -d, -f1,2 |tr , '\n'|sort|uniq)
printf '%s\n' "${fonts[@]}" > "$CNF_DIR"/inc/fonts.inc
mbx setvar "font=\'${fonts[0]}\'"
}
check_terminals() {
@ -33,7 +34,7 @@ check_terminals() {
}
check_browsers() {
search_browsers=(firefox chromium vivaldi opera midori)
search_browsers=(firefox chromium vivaldi opera brave midori qutebrowser falkon)
for i in "${search_browsers[@]}"
do
if hash ${i} 2>/dev/null; then
@ -41,6 +42,7 @@ check_browsers() {
fi
done
printf '%s\n' "${browsers[@]}" > "$CNF_DIR"/inc/browsers.inc
mbx setvar wwwbrowser=${browsers[0]}
}
check_file_managers() {

View File

@ -0,0 +1,11 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=MBX Utils
Comment=Enhance your X11 window manager
Keywords=
Icon=mbxcolors
TryExec=mbx
Exec=mbx
Categories=Utilities;
#NoDisplay=true

View File

@ -1,8 +1,8 @@
^sep(Ulubione)
Terminal,exo-open --launch TerminalEmulator,utilities-terminal
Przeglądarka WWW,exo-open --launch WebBrowser,firefox
Menedżer plików,exo-open --launch FileManager,system-file-manager
Dodaj/Usuń programy,pamac-manager,pamac
^sep(Favorites)
Terminal,^term(/bin/bash),utilities-terminal
Web Browser,xdg-open about:start,firefox
Files,xdg-open ~,system-file-manager
Software,pamac-manager,pamac
^sep()
~/.config,^pipe(mbxfiles ~/.config),folder
^sep()

1 ^sep(Ulubione) ^sep(Favorites)
2 Terminal,exo-open --launch TerminalEmulator,utilities-terminal Terminal,^term(/bin/bash),utilities-terminal
3 Przeglądarka WWW,exo-open --launch WebBrowser,firefox Web Browser,xdg-open about:start,firefox
4 Menedżer plików,exo-open --launch FileManager,system-file-manager Files,xdg-open ~,system-file-manager
5 Dodaj/Usuń programy,pamac-manager,pamac Software,pamac-manager,pamac
6 ^sep() ^sep()
7 ~/.config,^pipe(mbxfiles ~/.config),folder ~/.config,^pipe(mbxfiles ~/.config),folder
8 ^sep() ^sep()