uri-handler in yad based tools

master
Daniel Napora 2022-05-03 13:05:27 +02:00
parent 263118d6e7
commit e5371747f9
3 changed files with 29 additions and 19 deletions

24
bin/mcc
View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# mcc: Mabox Control Center # mcc: Mabox Control Center
# Copyright (C) 2019-2021 napcok <napcok@gmail.com> # Copyright (C) 2019-2022 napcok <napcok@gmail.com>
# #
EDITOR=geany EDITOR=geany
if hash btop 2>/dev/null; then if hash btop 2>/dev/null; then
@ -31,11 +31,11 @@ case $LANG in
MENU="Menu i Panele" MENU="Menu i Panele"
THEMES="Motywy" THEMES="Motywy"
HELP="Pomoc" HELP="Pomoc"
HELP_TXT="Visit <a href='https://manual.maboxlinux.org/mabox-doc-en/'>Mabox Linux Manual</a> to learn more about Mabox. \nDo you have questions? Want to get involved?\nTake a look at our: <a href='https://maboxlinux.org/'>official website</a>, <a href='https://forum.maboxlinux.org/'>forum</a>, <a href='https://blog.maboxlinux.org/'>blog</a>\n \n<i>Mabox Linux is developed with passion in spare time.\nMabox is free and it will always be.\nHowever, maintaining the project's infrastructure costs money.\nIf you like Mabox you can help by making a small <a href='https://maboxlinux.org/donate'>donation</a></i> \nThank you for choosing to use Mabox Linux!" HELP_TXT="Visit <a href='https://manual.maboxlinux.org/en/'>Mabox Linux Manual</a> to learn more about Mabox. \nDo you have questions? Want to get involved?\nTake a look at our: <a href='https://maboxlinux.org/'>official website</a>, <a href='https://forum.maboxlinux.org/'>forum</a>, <a href='https://blog.maboxlinux.org/'>blog</a>\n \n<i>Mabox Linux is developed with passion in spare time.\nMabox is free and it will always be.\nHowever, maintaining the project's infrastructure costs money.\nIf you like Mabox you can help by making a small <a href='https://maboxlinux.org/donate'>donation</a></i> \nThank you for choosing to use Mabox Linux!"
SYSTEM_DESC="Ustawienia oraz informacje systemowe i sprzętowe" SYSTEM_DESC="Ustawienia oraz informacje systemowe i sprzętowe"
MONITORS="<b>Monitor(y)</b>" MONITORS="<b>Monitor(y)</b>"
SOFTWARE_DESC="Aktualizacja - Instalacja Programów - Preferowane programy\n" SOFTWARE_DESC="Aktualizacja - Instalacja Programów - Preferowane programy\n"
AUTOSTART_DESC="<a href='https://manual.maboxlinux.org/mabox-doc-en/configuration/autostart/'>Pomoc (online)</a>\nOpenbox używa dwóch mechanizmów autostartu.\nPierwszy z nich to autostart XDG." AUTOSTART_DESC="<a href='https://manual.maboxlinux.org/en/configuration/autostart/'>Pomoc (online)</a>\nOpenbox używa dwóch mechanizmów autostartu.\nPierwszy z nich to autostart XDG."
AUTOSTART_DESC2="Drugim - specyficznym dla Openbox - jest skrypt <i><b>~/.config/openbox/autostart</b></i>." AUTOSTART_DESC2="Drugim - specyficznym dla Openbox - jest skrypt <i><b>~/.config/openbox/autostart</b></i>."
EDIT_XDG="Wybierz programy autostartu XDG" EDIT_XDG="Wybierz programy autostartu XDG"
EDIT_SCRIPT="Edytuj skrypt" EDIT_SCRIPT="Edytuj skrypt"
@ -78,7 +78,7 @@ case $LANG in
COMP_REMOVE="Usuń plik konfiguracyjny" COMP_REMOVE="Usuń plik konfiguracyjny"
COMP_DEFAULT="Przywróć domyślny plik konfiguracyjny" COMP_DEFAULT="Przywróć domyślny plik konfiguracyjny"
MT_MNGR="Menedżer Motywów Maboxa" MT_MNGR="Menedżer Motywów Maboxa"
MT_MNGR_DESC="\n<a href='https://manual.maboxlinux.org/mabox-doc-en/configuration/theme-manager/'>Pomoc (online)</a>\nMotyw Maboxa składa się z:\n - tapety\n - wystroju GTK2/GTK3 oraz obramowania okien Openboxa\n - ustawień panelu Tint2\n - uruchamianych automatycznie Conky \n\nZa pomocą menedżera motywów możesz w wygodny sposób zapisywać swoje konfiguracje, a następnie dowolnie przełączać się między nimi." MT_MNGR_DESC="\n<a href='https://manual.maboxlinux.org/en/configuration/theme-manager/'>Pomoc (online)</a>\nMotyw Maboxa składa się z:\n - tapety\n - wystroju GTK2/GTK3 oraz obramowania okien Openboxa\n - ustawień panelu Tint2\n - uruchamianych automatycznie Conky \n\nZa pomocą menedżera motywów możesz w wygodny sposób zapisywać swoje konfiguracje, a następnie dowolnie przełączać się między nimi."
;; ;;
es*) es*)
TITLE="Centro de control Mabox" TITLE="Centro de control Mabox"
@ -101,11 +101,11 @@ case $LANG in
MENU="Menú y Paneles" MENU="Menú y Paneles"
THEMES="Temas" THEMES="Temas"
HELP="Help" HELP="Help"
HELP_TXT="Visit <a href='https://manual.maboxlinux.org/mabox-doc-en/'>Mabox Linux Manual</a> to learn more about Mabox. \nDo you have questions? Want to get involved?\nTake a look at our: <a href='https://maboxlinux.org/'>official website</a>, <a href='https://forum.maboxlinux.org/'>forum</a>, <a href='https://blog.maboxlinux.org/'>blog</a>\n \n<i>Mabox Linux is developed with passion in spare time.\nMabox is free and it will always be.\nHowever, maintaining the project's infrastructure costs money.\nIf you like Mabox you can help by making a small <a href='https://maboxlinux.org/donate'>donation</a></i> \nThank you for choosing to use Mabox Linux!" HELP_TXT="Visit <a href='https://manual.maboxlinux.org/es/'>Mabox Linux Manual</a> to learn more about Mabox. \nDo you have questions? Want to get involved?\nTake a look at our: <a href='https://maboxlinux.org/'>official website</a>, <a href='https://forum.maboxlinux.org/'>forum</a>, <a href='https://blog.maboxlinux.org/'>blog</a>\n \n<i>Mabox Linux is developed with passion in spare time.\nMabox is free and it will always be.\nHowever, maintaining the project's infrastructure costs money.\nIf you like Mabox you can help by making a small <a href='https://maboxlinux.org/donate'>donation</a></i> \nThank you for choosing to use Mabox Linux!"
SYSTEM_DESC="Ajustes e información del sistema y de hardware" SYSTEM_DESC="Ajustes e información del sistema y de hardware"
MONITORS="<b>Monitor(es)</b>" MONITORS="<b>Monitor(es)</b>"
SOFTWARE_DESC="Instalación y actualización de programas - Aplicaciones preferidas.\n" SOFTWARE_DESC="Instalación y actualización de programas - Aplicaciones preferidas.\n"
AUTOSTART_DESC="<a href='https://manual.maboxlinux.org/mabox-doc-en/configuration/autostart/'>Info (online)</a>\nOpenbox ocupa 2 métodos de reinicio.\nEl primero es reinicio por XDG." AUTOSTART_DESC="<a href='https://manual.maboxlinux.org/es/configuration/autostart/'>Info (online)</a>\nOpenbox ocupa 2 métodos de reinicio.\nEl primero es reinicio por XDG."
AUTOSTART_DESC2="El segundo método de reinicio es usar el mismo archivo script de Openbox:\n<i><b>~/.config/openbox/autostart</b></i>. " AUTOSTART_DESC2="El segundo método de reinicio es usar el mismo archivo script de Openbox:\n<i><b>~/.config/openbox/autostart</b></i>. "
EDIT_XDG="Seleccionar ítemes para reinicio" EDIT_XDG="Seleccionar ítemes para reinicio"
EDIT_SCRIPT="Editar el archivo script de reinicio" EDIT_SCRIPT="Editar el archivo script de reinicio"
@ -148,7 +148,7 @@ case $LANG in
COMP_REMOVE="Eliminar archivo picom.conf" COMP_REMOVE="Eliminar archivo picom.conf"
COMP_DEFAULT="Reestablecer compositor grafico por defecto" COMP_DEFAULT="Reestablecer compositor grafico por defecto"
MT_MNGR="Gestor de Temas Mabox" MT_MNGR="Gestor de Temas Mabox"
MT_MNGR_DESC="\n<a href='https://manual.maboxlinux.org/mabox-doc-en/configuration/theme-manager/'>Help (online)</a>\nTemas Mabox consiste de:\n - fondos de pantalla\n - temas GTK2/GTK3\n - ajustes a tema Openbox\n - paneles Tint2 seleccionados\n - recuadros Conky seleccionados\n\nCon el gestor de Temas en Mabox puede fácilmente guardar nuevas configuraciones, y cambiar entre ellas." MT_MNGR_DESC="\n<a href='https://manual.maboxlinux.org/es/configuration/theme-manager/'>Help (online)</a>\nTemas Mabox consiste de:\n - fondos de pantalla\n - temas GTK2/GTK3\n - ajustes a tema Openbox\n - paneles Tint2 seleccionados\n - recuadros Conky seleccionados\n\nCon el gestor de Temas en Mabox puede fácilmente guardar nuevas configuraciones, y cambiar entre ellas."
;; ;;
*) *)
TITLE="Mabox Control Center" TITLE="Mabox Control Center"
@ -175,7 +175,7 @@ case $LANG in
SYSTEM_DESC="System and Hardware settings and information" SYSTEM_DESC="System and Hardware settings and information"
MONITORS="<b>Monitor(s)</b>" MONITORS="<b>Monitor(s)</b>"
SOFTWARE_DESC="Software installation and update - Preferred Applications.\n" SOFTWARE_DESC="Software installation and update - Preferred Applications.\n"
AUTOSTART_DESC="<a href='https://manual.maboxlinux.org/mabox-doc-en/configuration/autostart/'>Info (online)</a>\nOpenbox uses two autostart methods.\nFirst is XDG autostart." AUTOSTART_DESC="<a href='https://manual.maboxlinux.org/en/configuration/autostart/'>Info (online)</a>\nOpenbox uses two autostart methods.\nFirst is XDG autostart."
AUTOSTART_DESC2="Second method is Openbox own autostart script: <i><b>~/.config/openbox/autostart</b></i>. " AUTOSTART_DESC2="Second method is Openbox own autostart script: <i><b>~/.config/openbox/autostart</b></i>. "
EDIT_XDG="Select items to autostart" EDIT_XDG="Select items to autostart"
EDIT_SCRIPT="Edit script" EDIT_SCRIPT="Edit script"
@ -218,7 +218,7 @@ case $LANG in
COMP_REMOVE="Remove picom.conf" COMP_REMOVE="Remove picom.conf"
COMP_DEFAULT="Reset to default" COMP_DEFAULT="Reset to default"
MT_MNGR="Mabox Theme Manager" MT_MNGR="Mabox Theme Manager"
MT_MNGR_DESC="\n<a href='https://manual.maboxlinux.org/mabox-doc-en/configuration/theme-manager/'>Help (online)</a>\nMabox theme consist of:\n - wallpaper\n - GTK2/GTK3 Theme and Openbox window decoration \n - selected Tint2 panel(s)\n - selected Conkies \n\nWith Mabox Theme Manager you can easily save your configurations, and switch between them." MT_MNGR_DESC="\n<a href='https://manual.maboxlinux.org/en/configuration/theme-manager/'>Help (online)</a>\nMabox theme consist of:\n - wallpaper\n - GTK2/GTK3 Theme and Openbox window decoration \n - selected Tint2 panel(s)\n - selected Conkies \n\nWith Mabox Theme Manager you can easily save your configurations, and switch between them."
;; ;;
esac esac
@ -276,7 +276,7 @@ yad --plug=$KEY --tabnum=2 --borders=10 --text="$SOFTWARE_DESC" \
> $res2 & > $res2 &
#TAB 3 AUTOSTART #TAB 3 AUTOSTART
yad --plug=$KEY --tabnum=3 --borders=10 \ yad --plug=$KEY --tabnum=3 --borders=10 --uri-handler=xdg-open \
--text="<b>$AUTOSTART_HEAD</b>" --image=gtk-execute \ --text="<b>$AUTOSTART_HEAD</b>" --image=gtk-execute \
--columns=1 --form \ --columns=1 --form \
--field="$AUTOSTART_DESC:LBL" "" \ --field="$AUTOSTART_DESC:LBL" "" \
@ -354,14 +354,14 @@ yad --plug=$KEY --tabnum=8 --borders=10 \
#--field="$COMP_DEFAULT:FBTN" "cp /etc/skel/.config/picom.conf $HOME/.config/" \ #--field="$COMP_DEFAULT:FBTN" "cp /etc/skel/.config/picom.conf $HOME/.config/" \
#TAB 9 MOTYWY #TAB 9 MOTYWY
yad --plug=$KEY --tabnum=9 --borders=10 \ yad --plug=$KEY --tabnum=9 --borders=10 --uri-handler=xdg-open \
--text="<b>$MT_MNGR</b>\n $MT_MNGR_DESC" \ --text="<b>$MT_MNGR</b>\n $MT_MNGR_DESC" \
--form --field="$MT_MNGR!preferences-desktop-theme:FBTN" "mb-obthemes" \ --form --field="$MT_MNGR!preferences-desktop-theme:FBTN" "mb-obthemes" \
> $res9 & > $res9 &
#TAB 10 -HELP #TAB 10 -HELP
yad --plug=$KEY --tabnum=10 \ yad --plug=$KEY --tabnum=10 \
--image=/usr/share/icons/hicolor/128x128/apps/distributor-logo-mabox-trans.png --text-justify=center --text="$HELP_TXT" \ --image=/usr/share/icons/hicolor/128x128/apps/distributor-logo-mabox-trans.png --text-justify=center --uri-handler=xdg-open --text="$HELP_TXT" \
> $res10 & > $res10 &
#main window #main window

View File

@ -15,13 +15,23 @@ exo-open --launch WebBrowser https://pl.maboxlinux.org/przewodnik-uzytkownika/
} }
export -f userguide export -f userguide
;; ;;
*) es*)
function homewww() { function homewww() {
exo-open --launch WebBrowser https://maboxlinux.org exo-open --launch WebBrowser https://maboxlinux.org
} }
export -f homewww export -f homewww
function userguide() { function userguide() {
exo-open --launch WebBrowser https://manual.maboxlinux.org/mabox-doc-en/ exo-open --launch WebBrowser https://manual.maboxlinux.org/es/
}
export -f userguide
;;
*)
function homewww() {
exo-open --launch WebBrowser https://maboxlinux.org
}
export -f homewww
function userguide() {
exo-open --launch WebBrowser https://manual.maboxlinux.org/en/
} }
export -f userguide export -f userguide
;; ;;

View File

@ -6,7 +6,7 @@
case $LANG in case $LANG in
pl*) pl*)
TITLE="Edytor autostartu XDG" TITLE="Edytor autostartu XDG"
DESC="Wybierz programy/usługi, które mają być uruchamiane autamatycznie\nwraz z sesją OpenBox. <a href='https://manual.maboxlinux.org/mabox-doc-en/configuration/autostart/'>Pomoc (online)</a>" DESC="Wybierz programy/usługi, które mają być uruchamiane autamatycznie\nwraz z sesją OpenBox. <a href='https://manual.maboxlinux.org/en/configuration/autostart/'>Pomoc (online)</a>"
ENABLE="wł" ENABLE="wł"
FILE="Plik" FILE="Plik"
NAME="Nazwa" NAME="Nazwa"
@ -17,7 +17,7 @@ case $LANG in
;; ;;
es*) es*)
TITLE="XDG Autostart Editor" TITLE="XDG Autostart Editor"
DESC="Elegir apps o servicios para un reinicio en sesión Openbox.\n<a href='https://manual.maboxlinux.org/mabox-doc-en/configuration/autostart/'>Info (online)</a>" DESC="Elegir apps o servicios para un reinicio en sesión Openbox.\n<a href='https://manual.maboxlinux.org/es/configuration/autostart/'>Info (online)</a>"
ENABLE="ejecutar" ENABLE="ejecutar"
FILE="Archivo" FILE="Archivo"
NAME="Nombrar" NAME="Nombrar"
@ -28,7 +28,7 @@ case $LANG in
;; ;;
*) *)
TITLE="Mabox XDG Autostart Editor" TITLE="Mabox XDG Autostart Editor"
DESC="Choose apps/services to autostart with OpenBox session.\n<a href='https://manual.maboxlinux.org/mabox-doc-en/configuration/autostart/'>Info (online)</a>" DESC="Choose apps/services to autostart with OpenBox session.\n<a href='https://manual.maboxlinux.org/en/configuration/autostart/'>Info (online)</a>"
ENABLE="run" ENABLE="run"
FILE="File" FILE="File"
NAME="Name" NAME="Name"
@ -63,7 +63,7 @@ for f in $config_dir/autostart/*.desktop; do
#grep -m 1 -e '^[[:blank:]]*Exec' $f | cut -d = -f 2 #grep -m 1 -e '^[[:blank:]]*Exec' $f | cut -d = -f 2
comment=$(grep -m 1 -e '^[[:blank:]]*Comment=' $f | cut -d = -f 2) comment=$(grep -m 1 -e '^[[:blank:]]*Comment=' $f | cut -d = -f 2)
[ ! -z "$comment" ] && echo "<i>$comment</i>" || echo "$NO_DESC" [ ! -z "$comment" ] && echo "<i>$comment</i>" || echo "$NO_DESC"
done | yad --window-icon=distributor-logo-mabox --width=640 --height=500 --title="$TITLE" --image="gtk-execute" \ done | yad --window-icon=distributor-logo-mabox --width=640 --height=500 --title="$TITLE" --image="gtk-execute" --uri-handler=xdg-open \
--text="$DESC" --list --print-all --bool-fmt="t" \ --text="$DESC" --list --print-all --bool-fmt="t" \
--checklist --column="$ENABLE:CHK" --column="$FILE:HD" --column="$NAME" --column="$COMMENT" --tooltip-column=4 $CANCEL $OK > $results --checklist --column="$ENABLE:CHK" --column="$FILE:HD" --column="$NAME" --column="$COMMENT" --tooltip-column=4 $CANCEL $OK > $results