Question about Shell Script (#!/bin/sh)

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#31 Post by jpeps »

RSH..I'm in a rush to get out here, so probably aren't addressing what you're asking. A gui frontend would just create to list from the checkbox. Here's the batch script, which makes multiple pets in /tmp

Code: Select all

#!/bin/sh
 
while read line; do
  newpet "$line"
 done </tmp/newpet-list

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#32 Post by RSH »

This is what i need.

Instead of COMBO using LIST :lol:

I've wrote it all the time --> List :lol:

I thought just about an option to extend those listed entries (add checkbox to each one as attribut or similar?)

Is that possible?
Attachments
solved-this-is-what-ive-searched.jpg
(13.31 KiB) Downloaded 757 times
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#33 Post by jpeps »

RSH wrote:
I thought just about an option to extend those listed entries (add checkbox to each one as attribut or similar?)

Is that possible?
A combobox-checkbox widget. I don't know of any. A workaround would be an editable list where you add marks to entries that you want included. I did something like that in PetCheck.

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#34 Post by RSH »

jpeps wrote:I did something like that in PetCheck.

http://murga-linux.com/puppy/viewtopic. ... 75&t=71341
Downloaded.

I will have look into it.

Thank you.
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#35 Post by jpeps »

Here's gnewpet with batch mode include. In batch mode, the file list button brings up an editable pet list. Remove the initial "?" for pets that you want included.

menu fix: Thanks pemasu
Attachments
gnewpet-3.1.pet
(2.11 KiB) Downloaded 539 times
gnewpet.png
(77.23 KiB) Downloaded 681 times
Last edited by jpeps on Sun 15 Jan 2012, 00:40, edited 2 times in total.

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#36 Post by vovchik »

Dear jpeps,

Good work. I like it....:)

With kind regards,
vovchik

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#37 Post by jpeps »

Thanks vovchik :)

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#38 Post by pemasu »

Thanks jpeps. Your script and menu entry will be in the next exprimo. I remade the menu entry to be as Gnewpet so that it would upper in the utility menu :)
I hope you dont mind.

Also I noticed that existing gnewpet.desktop file had couple of empty spaces at the end of the file, so that it didnt appear in my utility menu. Maybe it is just me....?
Anyway deleting the file with delete button after last character fixed my menu entry non-appearance.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#39 Post by jpeps »

Thanks pemasu. fixed! I was wondering why the menu never worked..I have it on my tray, so forgot about it :)

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#40 Post by RSH »

Hi jpeps,

thank you for adding my suggestions. Now it is the ultimate tool. The GUI code isn't exactly what i'd suggest, but it is as close as possible. It seems to be impossible to realize my exact suggestion of a GUI List using checkboxes to just click on item to enable or disable it - using gtkdialog.

RSH
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#41 Post by jpeps »

RSH wrote: It seems to be impossible to realize my exact suggestion of a GUI List using checkboxes to just click on item to enable or disable it - using gtkdialog.
Maybe we can spark some interest?

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#42 Post by amigo »

The greq (that'a a 'queue') GUI tool lets you put a check box under any of its' limited number of widgets.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#43 Post by jpeps »

amigo wrote:The greq (that'a a 'queue') GUI tool lets you put a check box under any of its' limited number of widgets.
Great! Maybe a link? I couldn't find anything. Thanks

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#44 Post by Keef »

Google got me here....
http://greq.berlios.de/

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#45 Post by seaside »


jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#46 Post by jpeps »

A little tricky, but I found a way to get it working. I don't think it has a scroll bar, which makes it kind of useless for long lists. Maybe an idea for our own gtkdialog development, though, since I'm sure it would get used a lot.
Attachments
gnewpet-greq.png
(58.39 KiB) Downloaded 848 times

User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

#47 Post by Moose On The Loose »

jpeps wrote:A little tricky, but I found a way to get it working. I don't think it has a scroll bar, which makes it kind of useless for long lists. Maybe an idea for our own gtkdialog development, though, since I'm sure it would get used a lot.
I just thought of a way to do long lists. Here is the basic idea:

Place a button above and below the space where a subset of the full list is shown.

When someone clicks on the up button, the dialog closes, and a new one opens with the list scrolled down by 1/2 the length of the sub-list you are showing. Te script needs to keep track of the state ON/OFF of the items in the full list and give the subset back with the right combination of check marks.

I have made a thing that works like a combo-box but allows the user entry to be filtered on a keystroke basis. This used the fact that there is an event for the loss of focus. If the scrolled list is done in its own box, this trick could be used to make the list a stand alone thing.

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#48 Post by seaside »

Could this be used-

Code: Select all

<tree selection-mode="3"
It gives you multiple selection capability with a scroll bar.

Cheers,
s

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#49 Post by RSH »

Could this be used-

Code:
<tree selection-mode="3"
This works fine. It ( selection-mode="3") gives you the possibility to select several files.

But how to distinguish (sort out) the selected and unselected items?
Attachments
tree-works.jpg
(31.81 KiB) Downloaded 794 times
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#50 Post by seaside »

RSH,
But how to distinguish (sort out) the selected and unselected items?
All the selected items are returned separated in this variable-

Code: Select all

<variable>TREECHOICES</variable>
Cheers,
s

Post Reply