YAD - Tips
I forget to hit enter, or I'm too lazy to click OK I have been using Xdialog --timeout --interval, would have been surprised if yad could not do the same--although it required some reading between the lines.phat7 wrote: May I ask how you want to use it?
Code: Select all
suspend; z=$(timeout -s SIGUSR1 5 yad --text "enter password" --entry --no-buttons) ; if correct then resume else log out
z=$(timeout -s SIGUSR1 5 yad --text "Shut down and save, or..." --form --field "No save":CHK --field "Reboot":CHK) ; case $z in...
- misko_2083
- Posts: 114
- Joined: Tue 08 Nov 2016, 13:42
yad has an option:Wognath wrote:I forget to hit enter, or I'm too lazy to click OK I have been using Xdialog --timeout --interval, would have been surprised if yad could not do the same--although it required some reading between the lines.phat7 wrote: May I ask how you want to use it?Code: Select all
suspend; z=$(timeout -s SIGUSR1 5 yad --text "enter password" --entry --no-buttons) ; if correct then resume else log out z=$(timeout -s SIGUSR1 5 yad --text "Shut down and save, or..." --form --field "No save":CHK --field "Reboot":CHK) ; case $z in...
Code: Select all
yad --text "Shut down and save, or..." --form --field "No save":CHK --field "Reboot":CHK --timeout=5 --timeout-indicator=bottom
That doesn't give any output for me without clicking OK (which is where this is all about)misko_2083 wrote:yad has an option:
Code:
yad --text "Shut down and save, or..." --form --field "No save":CHK --field "Reboot":CHK --timeout=5 --timeout-indicator=bottom
@All , note that the "timeout" command can probably be a symlink to busybox on Puppy and there's difference between busybox versions, see radky's and mochimoppels's comments here:
http://murga-linux.com/puppy/viewtopic. ... 80#1031680
http://murga-linux.com/puppy/viewtopic. ... 95#1031795
Fred
- misko_2083
- Posts: 114
- Joined: Tue 08 Nov 2016, 13:42
Well patch it.fredx181 wrote:That doesn't give any output for me without clicking OK (which is where this is all about)misko_2083 wrote:yad has an option:
Code:
yad --text "Shut down and save, or..." --form --field "No save":CHK --field "Reboot":CHK --timeout=5 --timeout-indicator=bottom
@All , note that the "timeout" command can probably be a symlink to busybox on Puppy and there's difference between busybox versions, see radky's and mochimoppels's comments here:
http://murga-linux.com/puppy/viewtopic. ... 80#1031680
http://murga-linux.com/puppy/viewtopic. ... 95#1031795
Fred
in src/main.c find timeout_cb function
and add the call to function yad_print_result () before yad_exit ()
This is an example with 0.41 with added yad_print_result function
Code: Select all
static gboolean
timeout_cb (gpointer data)
{
static guint count = 1;
GtkWidget *w = (GtkWidget *) data;
if (options.data.timeout < count)
{
yad_print_result ();
yad_exit (YAD_RESPONSE_TIMEOUT);
return FALSE;
}
if (w)
{
gdouble percent = ((gdouble) options.data.timeout - count) / (gdouble) options.data.timeout;
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (w), percent);
if (g_settings_get_boolean (settings, "show-remain"))
{
gchar *lbl = g_strdup_printf (_("%d sec"), options.data.timeout - count);
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (w), lbl);
g_free (lbl);
}
}
count++;
return TRUE;
}
Code: Select all
yad --text "Shut down and save, or..." --form --field "No save":CHK --field "Reboot":CHK --timeout=5 --timeout-indicator=bottom
- josejp2424
- Posts: 556
- Joined: Sun 01 Aug 2010, 22:35
- Contact:
translate-shell
It would be nice to make an icon in the systray. to have the translator at hand.
Dear all,
Here is trans-paste and trans-tray. Put them both into some executable dir. Start trans-tray. Left click and you get a trans-paste box that will do the translation if the clipboard has a non-English text. I also supplied an icon and desktop file that you can edit for the icon location.
With kind regards,
vovchik
PS. All of this is very quick and dirty...
Here is trans-paste and trans-tray. Put them both into some executable dir. Start trans-tray. Left click and you get a trans-paste box that will do the translation if the clipboard has a non-English text. I also supplied an icon and desktop file that you can edit for the icon location.
With kind regards,
vovchik
PS. All of this is very quick and dirty...
- Attachments
-
- trans-paste.tar.gz
- (1.24 KiB) Downloaded 149 times
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Bonjour,
You were very quick indeed!
Icons aside (which are not really adapted) everything is perfect.
Now, a right-click menu would be useful for some settings as well as internationalization by the same token?
I wonder if josejp2424 wouldn't currently be working on scripts of the same kind?
Thank you vovchik for this.
Cordialement.
I'm afraid of what some people might think of my own scripts.PS. All of this is very quick and dirty...
You were very quick indeed!
Icons aside (which are not really adapted) everything is perfect.
Now, a right-click menu would be useful for some settings as well as internationalization by the same token?
I wonder if josejp2424 wouldn't currently be working on scripts of the same kind?
Thank you vovchik for this.
Cordialement.
Here's a (not so quick, but very dirty ) script, modified vovchik's script with addition of simple right-click menu with option to set the target language to translate to (provides list with languages to choose from)
A lot more can be done of course with all the options from "translate-shell", this is just a simple setup for testing, but maybe can be a start for a much more advanced program, who knows !
Attached trans_tray (merged together trans-tray and trans-paste from vovchik's concept) remove fake .gz and make executable.
Fred
A lot more can be done of course with all the options from "translate-shell", this is just a simple setup for testing, but maybe can be a start for a much more advanced program, who knows !
Attached trans_tray (merged together trans-tray and trans-paste from vovchik's concept) remove fake .gz and make executable.
Fred
- Attachments
-
- 2019-08-18-234825_635x710_scrot_635x710.jpg
- In italian
- (97.27 KiB) Downloaded 363 times
-
- trans_tray.gz
- Remove fake .gz and make executable, depends on translate-shell and yad
- (5.55 KiB) Downloaded 141 times
Last edited by fredx181 on Sun 18 Aug 2019, 21:50, edited 1 time in total.
- josejp2424
- Posts: 556
- Joined: Sun 01 Aug 2010, 22:35
- Contact:
trans_tray
it is excellent fredx181 and vovchikfredx181 wrote:Here's a (not so quick, but very dirty ) script, modified vovchik's script with addition of simple right-click menu with option to set the target language to translate to (provides list with languages to choose from)
A lot more can be done of course with all the options from "translate-shell", this is just a simple setup for testing, but maybe can be a start for a much more advanced program, who knows !
Attached trans_tray (merged together trans-tray and trans-paste from vovchik's concept) remove fake .gz and make executable.
Fred
Dear josejp2424,
Well done. Thanks. I think one thing we might want eventually to include in the right-click menu is the selection of translation engine (google, bing, yandex and deepl). Some engines are better at certain languages and worse at others, and deepl, for example, cannot handle very many. It's just a thought... In any case,trans_tray works nicely as it is.
With kind regards,
vovchik
Well done. Thanks. I think one thing we might want eventually to include in the right-click menu is the selection of translation engine (google, bing, yandex and deepl). Some engines are better at certain languages and worse at others, and deepl, for example, cannot handle very many. It's just a thought... In any case,trans_tray works nicely as it is.
With kind regards,
vovchik
- josejp2424
- Posts: 556
- Joined: Sun 01 Aug 2010, 22:35
- Contact:
tran_tray
fredx181 and vovchik
I included gettext to trans_tray.
Change the icon and color. Do not modify the lines of the icon.
icon to differentiate who is a translator
gettext in GUI
I included gettext to trans_tray.
Change the icon and color. Do not modify the lines of the icon.
icon to differentiate who is a translator
gettext in GUI
- Attachments
-
- translate_shell+GUI-0.9.6.11-dpupbuster64.pet
- for which you use dpupbuster64.
complete package for testing.
translate-shell + trans-tray - (46.75 KiB) Downloaded 102 times
-
- trans_tray.tar.bz2
- trans_tray+gettext+icono+locale-es
- (5.99 KiB) Downloaded 119 times
Nice josejp !josejp2424 wrote:fredx181 and vovchik
I included gettext to trans_tray.
Change the icon and color. Do not modify the lines of the icon.
icon to differentiate who is a translator
In the meantime I worked on a version with choice of different engines in the menu, see attached. (but not gettext added, sorry)
The engine choices are Google, Bing and Yandex, but Yandex doesn't always work well, half of the time I get message:
Code: Select all
[ERROR] Oops! Something went wrong and I can't translate it for you :(
https://github.com/soimort/translate-shell#installation
I think with older version the Bing translator doesn't work.
Fred
Fred
- Attachments
-
- trans_tray.gz
- Remove fake .gz and make executable
- (6.28 KiB) Downloaded 100 times
-
- 2019-08-19-165754_633x713_scrot_533x600.jpg
- Added choice of translate engines
- (55.37 KiB) Downloaded 283 times
- josejp2424
- Posts: 556
- Joined: Sun 01 Aug 2010, 22:35
- Contact:
button exit
the EXIT button should be removed .fredx181 wrote:And thanks again to you, vovchik ! for your great start concept.
For me it's ok for the most as it is, except maybe some help text could be added, do you perhaps have any more ideas for changes or improvement ?
Fred
because it eliminates the sistray program
Not sure if I understand, if you don't want to eliminate the sistray program, then just don't click on EXIT, or are you perhaps saying that for you it eliminates without clicking on EXIT, (accidentally ?)josejp2424 wrote:the EXIT button should be removed .
because it eliminates the sistray program
Fred
- josejp2424
- Posts: 556
- Joined: Sun 01 Aug 2010, 22:35
- Contact:
button exit
If the exit button is pressed by mistake, the program closes.fredx181 wrote:Not sure if I understand, if you don't want to eliminate the sistray program, then just don't click on EXIT, or are you perhaps saying that for you it eliminates without clicking on EXIT, (accidentally ?)josejp2424 wrote:the EXIT button should be removed .
because it eliminates the sistray program
Fred
and is no longer available in the systray bar.
That is why it should be removed.