Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 23 Sep 2014, 18:43
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Zenity/Yad and scripts
Post new topic   Reply to topic View previous topic :: View next topic
Page 4 of 5 [67 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Author Message
8-bit


Joined: 03 Apr 2007
Posts: 3368
Location: Oregon

PostPosted: Sun 17 Jul 2011, 21:18    Post subject:
Subject description: zenity project dead? Don't think so.
 

If you think the zenity project is dead, check this out.
It shows the last update as April 5, 2011.

It is version 3.0.

But there is a catch. It actually requires gtk+-3.0 for compiling

It requirements as listed are:

scrollkeeper
· intltool
· gtk+-2.0
· libglade-2.0
· libgnomecanvas-2.0
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Wed 24 Aug 2011, 07:51    Post subject: yad international
Subject description: Problem with NOT localized stock item
 

On my wary513 (German language pack) everything is fine. See
ymount
rodin.s has reported same (OK) for Russian and Ukrainian.

Is it just Dutch that does not localize or any other language except German and Russian Question

We can reduce the problem to one simple test:

If you have a LANG other than English please report fault or success by simply testing:
Code:
yad

Cancel button should show in your language if you have installed the language pack.

Thanks for your attention.
L
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Thu 01 Sep 2011, 16:11    Post subject:  

added a newer version (0.13.0+) in initial post with some fixes from svn

package size is significantly smaller

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Fri 02 Sep 2011, 15:35    Post subject: yad-0.13.0+
Subject description: no more relative links possible
 

technosaurus wrote:
added a newer version (0.13.0+) in initial post with some fixes from svn

package size is significantly smaller


Relative links no more possible.

I have used them in ymount

example
# ymount
/bin/ymount: line 40: ../usr/local/ymount/functions: No such file or directory

Changing from
. ../usr/local/ymount/functions # enables start from anywhere
to
. /usr/local/ymount/functions

Was that intended?
If so, no problem I will update ymount using the changes

L
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Fri 02 Sep 2011, 17:44    Post subject:  

probably not intended, I will try a recompile at 0.13.0 when I return tuesday
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Mon 05 Sep 2011, 09:23    Post subject: recompile
Subject description: localization problem
 

Localization again
De ru and uk had no problems

The text of the gtk buttons is in gtk20.mo.

I have made a new test on a fresh wary5141,
Dutch locale
Dutch language pack per sfs_load on the fly
yad 0.13.0
yad-NLS installed.

There must be something weird in the sources,
LINGUAS containing de ru uk and sk.
that seems to restrict translations to just these languages, just my thought.

The trick using LANGUAGE is showing that translation to another language, here nl, is possible.

But it really ought to work without tricks.
Smile

Edited:
The problem is not new to version 0.13
yad_localization_problem.png
 Description   
 Filesize   17.56 KB
 Viewed   2092 Time(s)

yad_localization_problem.png

Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Mon 05 Sep 2011, 11:38    Post subject: Re: recompile
Subject description: localization problem
 

L18L wrote:

But it really ought to work without tricks.


Found another trick:

Copied
/usr/share/locale/ru/LC_MESSAGES/yad.mo
to
/usr/share/locale/nl/LC_MESSAGES

and
Code:
yad

works Dutch Exclamation Exclamation Exclamation

This cannot be the solution but a pretty simple work around Smile

------------------------

The above mentioned

. ../usr/local/ymount/functions # enables start from anywhere

works in wary5141 Rolling Eyes
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Fri 09 Sep 2011, 09:07    Post subject: yad
Subject description: localization
 

Running yad-0.13.0 in wary5141 I have discovered something new for me (and maybe for you too): Buttons no more restricted to be placed at bottom line. See picture.

To get nearer to the solution of localization to languages other than de, sk, ru and uk I have set up this wary using Dutch locale again (without utf8), installed lang-pack-nl and copied just the German yad.mo to /usr/share/locale/nl/LC_MESSAGES and it works!

# locale -a
C
en_US
nl_NL
POSIX
# echo $LANG
nl_NL
# echo $LC_MESSAGES

# ls -l /usr/share/locale/nl/LC_MESSAGES/yad.mo
-rw-r--r-- 1 root root 8581 2011-07-04 23:47 /usr/share/locale/nl/LC_MESSAGES/yad.mo
# # is a copy of de/LC_MESSAGES/yad.mo !!!
#
# # it works: showing 'Cancel' translated to Dutch 'Annuleren'
# yad --version
0.13.0
#

technosaurus wrote:
probably not intended, I will try a recompile at 0.13.0 when I return tuesday


yad 0.14.2 is out.
I don't know why yad-NLS should be needed.
Developers are able to understand English
And for international users there is needed just one dummy yad.mo in user's LC_MESSAGES which enables the translations of gtk button texts.
form_field_type_BTN.png
 Description   
 Filesize   20.97 KB
 Viewed   2086 Time(s)

form_field_type_BTN.png

Back to top
View user's profile Send private message 
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Fri 09 Sep 2011, 09:34    Post subject:  

Hi L181,
Looks like there has been some nice updates in Yad recently - another new feature is form columns. Smile

Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Fri 09 Sep 2011, 10:04    Post subject: yad
Subject description: new features
 

stu90 wrote:
Hi L181,
Looks like there has been some nice updates in Yad recently - another new feature is form columns. Smile


Hi stu90,
thanks, looks like we can make more complex apps now Smile
Back to top
View user's profile Send private message 
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Sat 07 Jan 2012, 08:02    Post subject:  

Not sure how long this has been supported but works on yad 0.16.3 on my Bodhi install.

Button launcher with out the gui automatically closing and needing to be restarted.

Code:
yad --text=" Button launchers with gui still open " --button="Terminal:urxvt" --button="Text:geany" --button="gtk-quit"
Back to top
View user's profile Send private message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Sat 07 Jan 2012, 13:18    Post subject:  

stu90 wrote:
Not sure how long this has been supported but works on yad 0.16.3 on my Bodhi install.

Button launcher with out the gui automatically closing and needing to be restarted.

Code:
yad --text=" Button launchers with gui still open " --button="Terminal:urxvt" --button="Text:geany" --button="gtk-quit"


I have tested this script in my LazY Puppy. I have installed the yad 0.16.2, compiled in my LazY Puppy earlier. It works also!

JFYI: i have installed two versions of yad (0.12.4 and 0.16.2). I have renamed the files and set links to the yad files. Yad or yad1 calls yad-0.12.4 and yad2 calls yad-0.16.2. I just wanted to use the compiled 0.16.2 version without removing/overwriting the original lucid built in.

RSH

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 886

PostPosted: Wed 11 Jan 2012, 19:36    Post subject: Yad new Features
Subject description: CPU-usage tray icon notifier
 

As L18L and stu90 have mentioned, the latest yad has some interesting possibilites. So I loaded yad version 16.2 and put together this adaptation of 01micko's tray cpu percentage meter. It uses yad's new notification functions to provide icons "on-the-fly", allowing dynamic information updating in the tray (inside the icon itself).

A pipe is set up in the /tmp directory to receive messages from an updating input source (in this case from CPU usage code by Paul Colby (http://colby.id.au).

The output percentage ($DIFF_USAGE), is then compared to a range and a background color selected ($BG).

Those variables are then picked up in a template as suggested by technosaurus' use of svg for icons, and dynamically echo'd to the file /tmp/cpuicon in a loop.

When the command "echo icon:/tmp/cpuicon.svg >$PIPE" is issued, the tray icon is then refreshed.

As a bonus, if that icon starts heating up, you can left click the "cpu %" icon, and bring up pprocess. Further, you can also dynamically build right-click menus as well.

Middle clicking the icon kills the program.

Technosaurus: Svg definitely more powerful than xpm...thanks.

Cheers,
s

Code:
 #!/bin/bash
# seaside January 11, 2012
# yad version 16.2 required

PIPE=/tmp/cpupipe
mkfifo $PIPE
exec 3<> $PIPE
trap on_exit EXIT


function on_exit () {
    echo "quit" >&3
    rm -f $PIPE
}

yad --notification --kill-parent --listen \
    --image=gtk-stop --text="Average CPU Percent" \
    --command="pprocess" <&3 &
   
# following CPU usage code
# by Paul Colby (http://colby.id.au), no rights reserved ;)

PREV_TOTAL=0
PREV_IDLE=0

while true; do
  CPU=(`cat /proc/stat | grep '^cpu '`) # Get the total CPU statistics.
  unset CPU[0]                          # Discard the "cpu" prefix.
  IDLE=${CPU[4]}                        # Get the idle CPU time.

  # Calculate the total CPU time.
  TOTAL=0
  for VALUE in "${CPU[@]}"; do
    let "TOTAL=$TOTAL+$VALUE"
  done

  # Calculate the CPU usage since we last checked.
  let "DIFF_IDLE=$IDLE-$PREV_IDLE"
  let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL"
  let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10"

  # Remember the total and idle CPU times for the next check.
  PREV_TOTAL="$TOTAL"
  PREV_IDLE="$IDLE"
 
  # cpu tray meter and color coding from  01micko follows:

  BG=#FF69B4 #hotpink (default)

  [ "$DIFF_USAGE" -le "65" ] && BG=#ADD8E6  #lightblue
  [[ "$DIFF_USAGE" -gt "65" && "$DIFF_USAGE" -le "80" ]] && BG=#FFB6C1 #lightpink

  # technosaurus' use of svg for icons
   echo '<svg>
      <rect width="48" height="48" x="0" y="0" id="rect1"
        style="fill:'"$BG"';fill-opacity:1"/>
      <text x="6.7142859" y="27.428572" id="text1"
        style="font-size:36px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;font-family:Bitstream Vera Sans"
        >'"$DIFF_USAGE"'</text>
      <text x="3.1428573" y="43.57" id="text2"
        style="font-size:18px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;font-family:Bitstream Vera Sans"
        >cpu %</text>
    </svg> ' >/tmp/cpuicon.svg
   
   echo icon:/tmp/cpuicon.svg >$PIPE # send notice to change icon
      
  # Wait before checking again.
  sleep 1
done
CPU-average.png
 Description   Yad-tray-CPU-average.png
 Filesize   29.09 KB
 Viewed   1632 Time(s)

CPU-average.png

Back to top
View user's profile Send private message 
Burunduk

Joined: 21 Aug 2011
Posts: 62

PostPosted: Wed 29 Feb 2012, 17:35    Post subject: gtk+-2.0 support  

YAD author wrote:
i prepare to remove support of gtk+-2.0 in a next releases. what do
you think about it?


Maybe someone here feels an interest in this question.

https://groups.google.com/d/topic/yad-common/Tdl9c11XOps/discussion
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Wed 29 Feb 2012, 18:44    Post subject:  

Dear guys and gals,

I don't know when most apps will be ported to gtk3 - and there are tons of scripts that make use of gtkdialog (gtk 2.0). The transition isn't instant or easy. Peter van Eerten (gtk-server and BaCon) is maintaining gtk 2.0 Bacon HUG along with a new gtk3 version. And Bacon runs under Linux, BSD, OSX, peculiarities of each OS must be borne in mind. It also runs under cygwin. Gtk-server still compiles under gtk1. I hope ananasik - Yad's creator - will continue to maintain a gtk2 version for some time still. I remember when KDE made the leap to KDE4. The result for me was that I didn't install it, unlike KDE3.

With kind regards,
vovchik
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 4 of 5 [67 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1081s ][ Queries: 13 (0.0119s) ][ GZIP on ]