master
Daniel Napora 2023-01-19 01:32:14 +01:00
parent 7fb19bf0a9
commit 0bbc0fab23
1 changed files with 31 additions and 22 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# mb-jgtools: Menu, Sidepanels, Screenshot Tool and Exit Dialog for Mabox # mb-jgtools: Menu, Sidepanels, Screenshot Tool and Exit Dialog for Mabox
# Copyright (C) 2019-2022 Daniel Napora <napcok@gmail.com> # Copyright (C) 2019-2023 Daniel Napora <napcok@gmail.com>
. $HOME/.config/mabox/mabox.conf . $HOME/.config/mabox/mabox.conf
jgmenu_theme=${jgmenu_theme:-obtheme} jgmenu_theme=${jgmenu_theme:-obtheme}
@ -25,7 +25,7 @@ item_height_factor=${item_height_factor:-200}
gtkbookmarks() { gtkbookmarks() {
if [ $places_bookmarks == true ]; then if [ $places_bookmarks == true ]; then
BOOKMARKS="$HOME/.gtk-bookmarks" BOOKMARKS="$HOME/.config/gtk-3.0/bookmarks"
if [[ -s "$BOOKMARKS" ]]; then if [[ -s "$BOOKMARKS" ]]; then
case $LANG in case $LANG in
pl*) GTK_BOOKMARKS="Zakładki";; pl*) GTK_BOOKMARKS="Zakładki";;
@ -443,17 +443,23 @@ esac
if [ $panels_heightpos == "full" ]; then if [ $panels_heightpos == "full" ]; then
WALLPALDIR="$HOME/.config/colormenu/palettes/wallp"
mkdir -p "$WALLPALDIR"
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2) read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2)
WALLPAPER=${WALLPATH##*/} THUMBDIR="$HOME/.cache/colorizer/thumbs"
THUMBDIR="$HOME/.config/mabox/wallthumbs" mkdir -p ${THUMBDIR}
mkdir -p ${THUMBDIR} NAME=${WALLPATH////_}
THUMB="${THUMBDIR}/${WALLPAPER}.png" if [[ "${NAME}" =~ ^_home_.* ]]; then
if [[ ! -f "$THUMB" ]] n=${#HOME}
then ((n++))
convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB} NAME=${NAME:${n}}
fi fi
THUMB="${THUMBDIR}/${NAME}.png"
if [[ ! -f "$THUMB" ]]
then
convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB}
fi
JGWIDTH=$((jgtools_padding + 270 + jgtools_padding)) JGWIDTH=$((jgtools_padding + 270 + jgtools_padding))
MENU_PADDING_TOP=$((jgtools_padding + 152)) MENU_PADDING_TOP=$((jgtools_padding + 152))
cat <<EOF > ${RHEAD} cat <<EOF > ${RHEAD}
@ -724,17 +730,20 @@ if [[ -x "$(command -v VBoxManage)" ]]; then
[[ $places_vboxes == true ]] && vboxes=". $HOME/.config/mabox/vboxes.csv" || vboxes="" [[ $places_vboxes == true ]] && vboxes=". $HOME/.config/mabox/vboxes.csv" || vboxes=""
fi fi
if [ $panels_heightpos == "full" ]; then if [ $panels_heightpos == "full" ]; then
WALLPALDIR="$HOME/.config/colormenu/palettes/wallp"
mkdir -p "$WALLPALDIR"
read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2) read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2)
WALLPAPER=${WALLPATH##*/} THUMBDIR="$HOME/.cache/colorizer/thumbs"
THUMBDIR="$HOME/.config/mabox/wallthumbs" mkdir -p ${THUMBDIR}
mkdir -p ${THUMBDIR} NAME=${WALLPATH////_}
THUMB="${THUMBDIR}/${WALLPAPER}.png" if [[ "${NAME}" =~ ^_home_.* ]]; then
if [[ ! -f "$THUMB" ]] n=${#HOME}
then ((n++))
convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB} NAME=${NAME:${n}}
fi fi
THUMB="${THUMBDIR}/${NAME}.png"
if [[ ! -f "$THUMB" ]]
then
convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB}
fi
JGWIDTH=$((jgtools_padding + 270 + jgtools_padding)) JGWIDTH=$((jgtools_padding + 270 + jgtools_padding))
MENU_PADDING_TOP=$((jgtools_padding + 152)) MENU_PADDING_TOP=$((jgtools_padding + 152))
cat <<EOF > ${LHEAD} cat <<EOF > ${LHEAD}