Results 1 to 8 of 8

Thread: Command to get this shutdown dialog?

  1. #1
    Join Date
    Mar 2008
    Location
    Ireland
    Beans
    835
    Distro
    Ubuntu 17.10 Artful Aardvark

    Command to get this shutdown dialog?

    Does anybody know of a command to get this Gnome shutdown dialog?

    Projects - PhotoFlare Image Editor | Xwii | URT-2D | BHR
    Hardware - System 76 - Galago UltraPro

  2. #2
    Join Date
    Mar 2008
    Location
    Ireland
    Beans
    835
    Distro
    Ubuntu 17.10 Artful Aardvark

    Re: Command to get this shutdown dialog?

    Hmm... already I have this partly figured out.

    Its called gtk-logout-helper. Now I just need to figure out a command to make it work.
    Projects - PhotoFlare Image Editor | Xwii | URT-2D | BHR
    Hardware - System 76 - Galago UltraPro

  3. #3
    Join Date
    Jul 2006
    Location
    Here
    Beans
    10,985

    Re: Command to get this shutdown dialog?

    thats a zenity --question script. i'm guessing something like:

    zenity --question --title="Shutdown" --text="are you sure you want to close all programs and shutdown the computer\?" --cancel-label="Cancel" --ok-label="Shutdown"

    i use a similar on mine.

    Code:
    #!/bin/bash
    
    zenity --question --title="Exit Options" --text="What do you want to do\?" --cancel-label="Shutdown" --ok-label="Log Out"
    
    if [ $? = 0 ]; then
    	gnome-session-save --logout-dialog
    elif [ $? = 1 ]; then
    	gnome-session-save --shutdown-dialog
    fi
    exit 0
    Last edited by kerry_s; August 24th, 2010 at 06:56 AM.

  4. #4
    Join Date
    Mar 2008
    Location
    Ireland
    Beans
    835
    Distro
    Ubuntu 17.10 Artful Aardvark

    Re: Command to get this shutdown dialog?

    Its actually the official shutdown dialog from Gnome session indicator applet.

    However I have sorted it now! Thanks for trying to help!
    Projects - PhotoFlare Image Editor | Xwii | URT-2D | BHR
    Hardware - System 76 - Galago UltraPro

  5. #5
    Join Date
    Jun 2008
    Location
    Calgary, Alberta
    Beans
    1,125
    Distro
    Ubuntu Studio 14.04 Trusty Tahr

    Re: Command to get this shutdown dialog?

    Quote Originally Posted by fallenshadow View Post
    Its actually the official shutdown dialog from Gnome session indicator applet.

    However I have sorted it now! Thanks for trying to help!
    Would you be willing to share?
    This is a signature. It is original.

  6. #6
    Join Date
    Jul 2006
    Location
    Here
    Beans
    10,985

    Re: Command to get this shutdown dialog?

    Quote Originally Posted by sydbat View Post
    Would you be willing to share?
    yeap, he's right.

    the command:
    Code:
    /usr/lib/indicator-session/gtk-logout-helper
    Application Options:
    -l, --logout Log out of the current session
    -s, --shutdown Switch off the entire system
    -r, --restart Restart the system
    Last edited by kerry_s; August 24th, 2010 at 06:57 AM.

  7. #7
    Join Date
    Mar 2008
    Location
    Ireland
    Beans
    835
    Distro
    Ubuntu 17.10 Artful Aardvark

    Re: Command to get this shutdown dialog?

    Ah you got it Kerry!

    See once you know what its called a simple file search will find it!

    Then you can check out the file properties to find its location in your filesystem.

    I found out the options just by guessing. ( like -l, -r, and -s )They are pretty common sense... s for shutdown etc.
    Projects - PhotoFlare Image Editor | Xwii | URT-2D | BHR
    Hardware - System 76 - Galago UltraPro

  8. #8
    Join Date
    Jul 2006
    Location
    Here
    Beans
    10,985

    Re: Command to get this shutdown dialog?

    Quote Originally Posted by fallenshadow View Post
    Ah you got it Kerry!

    See once you know what its called a simple file search will find it!

    Then you can check out the file properties to find its location in your filesystem.

    I found out the options just by guessing. ( like -l, -r, and -s )They are pretty common sense... s for shutdown etc.
    i just used the "--help" option. i rewrote my zenity script to use it, so i can add it as a single launcher.

    Code:
    #!/bin/bash
    
    sel=$(zenity --list --title="Exit Options" --text="Make your selection" --column= "Log Out" "Reboot" "Shutdown")
    
    if [ "$sel" = "Log Out" ]; then
    	/usr/lib/indicator-session/gtk-logout-helper -l
    elif [ "$sel" = "Reboot" ]; then
    	/usr/lib/indicator-session/gtk-logout-helper -r
    elif [ "$sel" = "Shutdown" ]; then
    	/usr/lib/indicator-session/gtk-logout-helper -s
    fi
    exit 0
    Last edited by kerry_s; August 24th, 2010 at 06:57 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •