nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Pop-up window in KDE/GNOME

This is a discussion on Pop-up window in KDE/GNOME within the Coding in General forums, part of the Development/Scripting category; Hello there, Maybe this is not the best place to ask but I would be interested how I could write ...

Register free or login to your existing account and remove all advertisements.


Go Back   nixCraft Linux Forum > Development/Scripting > Coding in General

Linux answers from nixCraft.


Coding in General Discussion on PHP/Perl/Python/Ruby/GNU C or C++. MySQL, PgSQL and (X)HTML or any other programming languages you want.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-15-2008, 06:35 PM
Junior Member
User
 
Join Date: Aug 2008
OS: RedHat
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
meanitback is on a distinguished road
Default Pop-up window in KDE/GNOME

Hello there,

Maybe this is not the best place to ask but I would be interested how I could write a script/app which basically would pop up a window for my users when they are logged on via the xserver (KDE/gnome) as I would like to schedule it. This would be for requesting some information of the users and getting a view who is using which workstation.

Could you please give me an idea where I could start to have a look at?

thx,

joey
Reply With Quote
  #2 (permalink)  
Old 08-16-2008, 04:21 AM
rockdalinux's Avatar
Is that all you got?
User
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 703
Thanks: 15
Thanked 19 Times in 18 Posts
Rep Power: 10
rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light
Default

Use zenity. It is a program that will display GTK+ dialogs (Gnome), and return (either in the return code, or on standard output) the users input. This allows you to present information, and ask for information from the user, from all manner of shell scripts.

Hello world code:
Code:
zenity --info --text "Hello world"
Another example (see attached screen shot)
Code:
zenity --info --text "All updates are complete. System will reboot now"
A sample shell code to input file and delete it...

Code:
#!/bin/bash
# Get input
fileName=$(zenity --entry --text "Enter a file name to delete: " --title "File Delete")

# now verification
zenity --question --text "Are you sure?" --title "Delete - $fileName"
retVal=$?
[ $retVal -eq 0 ] && /bin/rm $fileName
You can also use python or ruby to build more complex GUI stuff.

HTH
Attached Images
File Type: png test-.png (10.6 KB, 9 views)
__________________
Rocky Jr.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote
  #3 (permalink)  
Old 08-16-2008, 04:37 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,695
Thanks: 11
Thanked 243 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default GUI Programming in Python

More info about GUI scripting programming:

  1. Linux GUI Programming in Python : GuiProgramming - PythonInfo Wiki
  2. GUI Programming in Ruby: Shoes • Colorful programs for Mac OS X, Linux and Windows
  3. GUI Programming in Php: PHP-GTK
  4. GUI Programming in Perl: perl.com: Writing GUI Applications in Perl/Tk


If you need more hard core GUI stuff you can use X Windows, KDE (Qt and KDE) and Gnome SDK and so on.

Good luck!
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #4 (permalink)  
Old 08-18-2008, 09:10 PM
Junior Member
User
 
Join Date: Aug 2008
OS: RedHat
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
meanitback is on a distinguished road
Default Thx

Thank you for the responses. I give them a try.
Reply With Quote
Reply

Tags
bash , zenity


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Linux GNOME change / create or make a custom logon banner chimu Getting started tutorials 0 12-19-2006 12:20 AM
Clearing outgoing mail queue Window server with Mailenable raj Windows Xp/2000/2003 server administration 1 07-14-2006 05:10 PM
KDE or GNOME Ashish Pathak Linux software 11 04-05-2006 08:35 PM
gtk warning cannot open display gnome Linux software 1 03-14-2006 12:50 PM


All times are GMT +5.5. The time now is 10:09 PM.


Powered by vBulletin® Version 3.8.4 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38