Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When Ubuntu was using gnome I was able to create a popup banner like the banner below before the login screen using zenity in the /etc/gdm/Init/Default. The line of code would be like this:

if [ -f "/usr/bin/zenity" ]; then /usr/bin/zenity --info --text="`cat /etc/issue`" --no-wrap; else xmessage -file /etc/issue -button ok -geometry 540X480; fi

How can I accomplish this with Unity?


This is a computer system and/or it is directly connected to a local network system. It is for authorized use only. Users (authorized or unauthorized) have no explicit or implicit expectation of privacy.

Any or all uses of this system and all files on this system may be intercepted, monitored, recorded, copied, audited, inspected, and disclosed to authorized site, Department of Energy, and law enforcement personnel, as well as authorized officials of other agencies, both domestic and foreign. By using this system, the user consents to such interception, monitoring, recording, copying, auditing, inspection, and disclosure at the discretion of authorized site or personnel.

Unauthorized or improper use of this system may result in administrative disciplinary action and civil and criminal penalties. By continuing to use this system you indicate your awareness of and consent to these terms and conditions of use.

LOG OFF IMMEDIATELY if you do not agree to the conditions stated in this warning.

share|improve this question
This doesn't work in Ubuntu 12.04 :( – user287099 May 31 '14 at 10:28

The configuration file /etc/lightdm/lightdm.conf defines the available sessions. The sessions themselves are defined in /usr/share/xsessions. It should be not a problem to modify the default /usr/share/xsessions/ubuntu.desktop to wrap the gnome-session command around in a script that first displays the zenity dialog, and then either exits with a nonzero status or launches the gnome-session command.


  1. Create a file called /usr/bin/ which contains, for example, the following:

    if  /usr/bin/zenity --question --text="`cat /etc/issue`" --no-wrap ; then gnome-session --session=ubuntu ; else exit 1 ; fi

    To edit this file, use

    gksu gedit /usr/bin/

    Also, make it executable

    sudo chmod a+x /usr/bin/
  2. Modify the file /usr/share/xsessions/ubuntu.desktop as follows:

    [Desktop Entry]
    Comment=This session logs you into Ubuntu

Now, if anyone tries to log on, the person has to click "Yes" in order to log in; otherwise, it will return to the login screen.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.