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 Sun 26 Oct 2014, 03:29
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
GTKdialog newbie - my first effort
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
koulaxizis


Joined: 17 Jul 2011
Posts: 428
Location: Greece

PostPosted: Fri 16 Aug 2013, 07:03    Post_subject:  GTKdialog newbie - my first effort  

I suppose that everyone offers what he can and, even if i can't offer much, i did a little something while i was experimenting with gtkdialog for the first time. Smile


Nothing great, not even usefull for you maybe, but here it is...


GO TO SLEEP

Code:
#!/bin/sh

GTKDIALOG=gtkdialog

export DIALOG='
<window title="Go to sleep" window_position="1">
<vbox>
<frame Shutdown computer in...>
<hbox>
 <entry>
<default>...seconds</default>
<variable>ENTRY</variable>
</entry>
</hbox>
</frame>
<text>
<label>30 minutes = 1800 seconds</label>
</text>
<text>
<label>60 minutes = 3600 seconds</label>
</text>
<text>
<label>90 minutes = 5400 seconds</label>
</text>
<hseparator></hseparator>
<hbox>
<button>
<label>Sleep!</label>
<action>sleep "$ENTRY" && wmpoweroff &</action>
<action>exit:EXIT</action>
</button>
<button cancel></button>
</hbox>
</vbox>
</window>
'

$GTKDIALOG --program=DIALOG



AUTOSTART ME

Code:
#!/bin/sh

GTKDIALOG=gtkdialog

funcbtnCreate() {
echo '<button>
<input file stock="gtk-'$2'"></input>
<action>fileselect:ent'$1'</action>
</button>'
}


export MAIN_DIALOG='
<window title="Autostart Me" window_position="1">
<vbox>
<frame Choose app to autostart>
<hbox>
<entry fs-action="file" fs-folder="/usr/bin/"
fs-title="Select the executable you want to autostart">
<variable>ent1</variable>
</entry>
'"$(funcbtnCreate 1 new)"'
</hbox>
</frame>
<hbox>
<button>
<label>Do it!</label>
<action>ln -s "$ent1" /root/Startup/ &</action>
<action>exit:EXIT</action>
</button>
<button cancel></button>
</hbox>
</vbox>
</window>
'

$GTKDIALOG --program=MAIN_DIALOG

_________________
Christos Koulaxizis
Woof woof from Greece...

[ Puppy packages | Puppy search ]
Back to top
View user's profile Send_private_message Visit_website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Fri 16 Aug 2013, 11:25    Post_subject:  

Nice .. Haven't checked the code yet .

Sleep normally refers to RAM sleep in acpi powermanagement terms .

Puppy default kernels dont't support hibernation to disk .
Pemasus's kernels support hibernation to disk as far as I know .
Am unsure about current Slacko Puppy kernels by 01micko .

Slacko-5.3.1 kernel 2.6.37.6 :
DOTconfig-K2.6.37.6-SMP-TICKLESS-20110520:# CONFIG_HIBERNATION is not set

DOTconfig-K2.6.37.6-SMP-TICKLESS-20110520:CONFIG_PM_SLEEP_SMP=y
DOTconfig-K2.6.37.6-SMP-TICKLESS-20110520:CONFIG_PM_SLEEP=y
DOTconfig-K2.6.37.6-SMP-TICKLESS-20110520:CONFIG_ACPI_SLEEP=y
Back to top
View user's profile Send_private_message Visit_website 
koulaxizis


Joined: 17 Jul 2011
Posts: 428
Location: Greece

PostPosted: Fri 16 Aug 2013, 13:01    Post_subject:  

Karl Godt wrote:
Nice .. Haven't checked the code yet .

Sleep normally refers to RAM sleep in acpi powermanagement terms .

Puppy default kernels dont't support hibernation to disk .
Pemasus's kernels support hibernation to disk as far as I know .
Am unsure about current Slacko Puppy kernels by 01micko .

Slacko-5.3.1 kernel 2.6.37.6 :
DOTconfig-K2.6.37.6-SMP-TICKLESS-20110520:# CONFIG_HIBERNATION is not set

DOTconfig-K2.6.37.6-SMP-TICKLESS-20110520:CONFIG_PM_SLEEP_SMP=y
DOTconfig-K2.6.37.6-SMP-TICKLESS-20110520:CONFIG_PM_SLEEP=y
DOTconfig-K2.6.37.6-SMP-TICKLESS-20110520:CONFIG_ACPI_SLEEP=y


In this case "sleep" means computer shutdown because it's owner fell asleep! Laughing

_________________
Christos Koulaxizis
Woof woof from Greece...

[ Puppy packages | Puppy search ]
Back to top
View user's profile Send_private_message Visit_website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Fri 16 Aug 2013, 17:08    Post_subject:  

Puppy actually has a POWERTIMEOUT mechanism that can be invoked by the /usr/sbin/eventmanager ( to be found to the System Menu ) .
That is also a gtkdialog GUI .
I have played a medium bit with it privately and modded it slightly .
Mainly added the Drive Icon Placement Tab .

Have FUN !!
eventmanager.jpg
 Description   
 Filesize   82.13 KB
 Viewed   260 Time(s)

eventmanager.jpg

Back to top
View user's profile Send_private_message Visit_website 
koulaxizis


Joined: 17 Jul 2011
Posts: 428
Location: Greece

PostPosted: Sat 17 Aug 2013, 02:50    Post_subject:  

Thanks for mentioning that, i didn't know! It's a really useful feature (to me at least)! Smile

Oh, well, it doesn't matter, my ignorance was a nice opportunity to play with gtkdialog! Laughing

_________________
Christos Koulaxizis
Woof woof from Greece...

[ Puppy packages | Puppy search ]
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0553s ][ Queries: 12 (0.0054s) ][ GZIP on ]