Results 1 to 8 of 8

Thread: [HOWTO] Turn gnome-terminal into tilda (quake) like pop-up terminal

  1. #1
    Join Date
    Nov 2006
    Location
    Denmark
    Beans
    83

    Lightbulb HOWTO: Turn gnome-terminal, konsole or xfce4-terminal into quake like pop-up terminal

    HOWTO: Turn gnome-terminal, konsole or xfce4-terminal into quake like pop-up terminal
    Updated 2011-03-20

    Intro

    There are a lot of pop-up terminal emulators like tilda, vterminal, guake, Yakuake or Yeahconsole to choose from, but if none of them satisfies you (none of them supports "drag and drop" functionality for example), I will present here two guides that can be used to turn any ordinary terminal (gnome-terminal, xfce4-terminal, konsole) into a neat pop-up terminal.

    [The guides might look a bit long but that's mainly because I have included instructions for all the most popular ubuntu flavours - ubuntu, kubuntu and xubuntu.]

    Guide #1
    Pros:
    • Any keyboard shortcut can be used to hide the terminal

    Cons:
    • This guide will NOT work with default Xfce window manager xfwm4, because xfwm4 doesn't allow minimizing windows that have "skip_tasklist" attribute set. However, it will work for xfce users who use compiz instead of xfwm4.


    1. Install the required software
      1. Code:
        sudo apt-get install devilspie xbindkeys
      2. launch-restore
    2. Set initial title for your terminal which will be used by devilspie a bit later
      • gnome-terminal. Select Edit -> Profile Preferences, "Title and command" tab and input Terminal as initial title.
      • xfce4-terminal. Select Edit -> Preferences and specify Terminal as initial title.
      • konsole. Right click on the terminal and choose "Configure current profile" from the menu, then put Terminal as profile name. Plus there is one more step for this to work: go to "Tabs" tab and replace "Tab title format" with %w.
    3. Get rid of the menubar
      • gnome-terminal. Select Edit -> Profile Preferences. Untick "Show menubar by default in new terminals"
      • konsole. Settings -> Show menubar
      • xfce4-terminal. Select Edit -> Preferences, switch to Appearance tab and untick "Display menubar in new windows"
    4. Create .devilspie directory and open terminal.ds file (KDE users should replace gedit with kate and xfce with mousepad)
      Code:
      mkdir ~/.devilspie
      gedit ~/.devilspie/terminal.ds
    5. Copy the following code to the text file you just opened:
      Code:
      ; rule for pop-up terminal
      ( if 
      ( is ( window_name ) "Terminal" ) 
      ( begin 
      ( focus )
      ( skip_pager )
      ( skip_tasklist )
      ( stick )
      ( undecorate )
      ; terminal size: 660x400 position (relative to the upper left corner of the screen): +620+340 
      ( geometry "660x400+620+340" )
      ( println "match" )
      )
      )
    6. Edit the rule to customize terminal size and position (note the comments in the code)
    7. Open xbindkeys configuration file (KDE users should use kate and xfce - mousepad instead of gedit)
      Code:
      gedit ~/.xbindkeysrc
    8. Remove default rules (in most cases they are hindering more than helping) and add one of the following rules depending on what terminal emulator you are using (you can run "xbindkeys -k" to see how your preferred keyboard shortcut should be defined):
      • gnome-terminal (Gnome)
        Code:
        #Open/restore gnome-terminal by pressing Alt+Z
        "launch-restore Gnome-terminal gnome-terminal"
        Alt + z
      • konsole (KDE)
        Code:
        #Open/restore konsole by pressing Alt+Z
        "launch-restore Konsole konsole"
        Alt + z
      • xfce4-terminal (Xfce)
        Code:
        #Open/restore konsole by pressing Alt+Z
        "launch-restore Xfce4-terminal xfce4-terminal"
        Alt + z
    9. Now it's time to specify some handy shortcut for hiding the terminal:
      • Gnome. Run gnome-keybinding-properties and specify some keyboard shortcut for minimizing windows (if you can't find "Window Management" section there, it means that you are using compiz and should follow the same instructions as XFCE users in this case).
      • XFCE. For this guide to work in XFCE you have to be using compiz. So, install compizconfig-settings-manager, run it (ccsm), select "General Options", "Key bindings" tab and specify some keyboard shortcut for minimizing windows.
      • KDE. Run systemsettings, click "Shortcuts and gestures", go to "Global keyboard shortcuts" section, select KDE component: Kwin and search for "Minimize window".
    10. Add xbindkeys and devilspie to autostarted application list:
      • Gnome. Run gnome-session-properties.
      • XFCE. Run xfce4-session-settings and go to "Application Autostart" tab.
      • KDE. Run systemsettings and go to "Startup and Shutdown".
    11. Finally you can log-out and log-in again (or just run xbindkeys and devilspie) and press keyboard shortcut you specified in xbindkeys config (8th step, Alt+Z by default) to start/show the terminal and the shortcut you specified for minimizing applications to hide it.


    Guide #2
    Pros:
    • Can be used with any window manager including xfwm4 (default xfce4 window manager)

    Cons:
    • Unless you figure out how to fix alltray, very few keyboard buttons will be available for hiding the terminal.


    1. Install all the software we'll need:
      1. Code:
        sudo apt-get install xbindkeys alltray
      2. launch-restore
    2. Get rid of the menubar. Same as step 3 in guide #1.
    3. Open .terminal.sh (KDE users should use kate and xfce - mousepad instead of gedit)
      Code:
      gedit ~/.terminal.sh
    4. Now depending on what kind of terminal you are using copy one of the following bash scripts to the file
      • gnome-terminal
        Code:
        #!/bin/sh
        
        if (wmctrl -l | grep 'AllTray';) then
        	launch-restore Gnome-terminal gnome-terminal
        else
        	alltray -x -s -st -k 135 -g  660x400+706+210 -nt --skip-taskbar "gnome-terminal"
        fi
      • konsole
        Code:
        #!/bin/sh
        
        if (wmctrl -l | grep 'AllTray';) then
        	launch-restore Konsole konsole
        else
        	alltray -x -s -st -k 135 -g  660x400+706+210 -nt --skip-taskbar "konsole"
        fi
      • xfce4-terminal
        Code:
        #!/bin/sh
        
        if (wmctrl -l | grep 'AllTray';) then
        	launch-restore Xfce4-terminal xfce4-terminal
        else
        	alltray -x -s -st -k 135 -g  660x400+706+210 -nt --skip-taskbar "xfce4-terminal"
        fi
    5. Edit the script to suit your taste. Here are a couple of things that you might want to edit:
      • 660x400 here represents the size of the window
      • +706+210 determines window position (+x+y) relative to the upper left corner of the screen
      • -k switch followed by keycode determines the keyboard button to be used to hide the terminal. xev or "xbindkeys -k" command line utilities can be used to find out the keycode (135 is Menu - the key that acts like right mouse button). The problem here is that alltray hasn't been updated for a really long time and because of the changes to Xorg server now most of the keys can not be used here - they just cause alltray to crash. Some of the keys that worked for me are PrtSc (107), Menu (135), Insert (118).
      • -st switch means that the terminal will be visible on all workspaces (you can run "alltray --help" for some info about the other switches used here)
    6. Make it executable:
      Code:
      chmod +x ~/.terminal.sh
    7. Open xbindkeys configuration file (KDE users should use kate and xfce - mousepad instead of gedit):
      Code:
      gedit ~/.xbindkeysrc
    8. Replace the contents of the file with the following rule which will determine the keyboard shortcut that will be used to show our terminal (in the example "Alt + W" is the shortcut but it can be replaced with anything that suits your taste- just run "xbindkeys -k" to see how your preferred keyboard shortcut should be defined)
      Code:
      #Open/restore terminal by pressing Alt + w
      "sh $HOME/.terminal.sh"
      	Alt + w
    9. Add xbindkeys to your autostarted application list
      • Gnome. Run gnome-session-properties.
      • XFCE. Run xfce4-session-settings and go to "Application Autostart" tab.
      • KDE. Run systemsettings and go to "Startup and Shutdown".
    10. Now you can log-out and log-in again (or just run xbindkeys) and press keyboard shortcut you specified in xbindkeys config (7th step, Alt+W by default) to start/show the terminal and the shortcut you specified in .terminal.sh script (steps 4 & 5, keycode after -k switch) to hide it.


    Tips
    • xbindkeys has a handy tool for finding out how to define some hotkey:
      Code:
      xbindkeys -k
      After executing the command just press some keys at once and you should see two ways to define the key combination.
    • You can use gdevilspie devilspie gui to add new rules.
    • You can use xbindkeys-config xbindkeys gui to add new keyboard shortcuts.


    Similar guides
    HOWTO: Terminal as the desktop background.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screenshot.gif 
Views:	537 
Size:	411.7 KB 
ID:	103167  
    Last edited by Hakimio; March 20th, 2011 at 05:27 PM.

  2. #2
    Join Date
    Nov 2006
    Location
    Denmark
    Beans
    83

    Re: [HOWTO] Turn gnome-terminal into tilda (quake) like pop-up terminal

    The guide has been updated. Have fun everyone

  3. #3
    Join Date
    Dec 2008
    Location
    43° 7' 41" 131° 54' 3"
    Beans
    Hidden!

    Re: [HOWTO] Turn gnome-terminal into tilda (quake) like pop-up terminal

    I like this. +1
    EasyBCD.
    PrintersDatabase
    Boot Info Script: How to
    The post above and the post below suffer from the Rashomon effect!

  4. #4
    Join Date
    Nov 2006
    Location
    Denmark
    Beans
    83

    Smile Re: [HOWTO] Turn gnome-terminal into tilda (quake) like pop-up terminal

    Quote Originally Posted by jtarin View Post
    I like this. +1
    Yay! It seems I didn't write it for nothing after all

  5. #5
    Join Date
    Feb 2011
    Beans
    33
    Distro
    Xubuntu 11.04 Natty Narwhal

    Re: [HOWTO] Turn gnome-terminal into tilda (quake) like pop-up terminal

    I'll make cowsay's words my words... =)

    Oh, and one more thing: You can add the minimizing animation in Compiz to make it look exactly like Quake's console =)
    Problem making Emerald/Compiz work on Xubuntu? Check 'em: (also appliable to other distros)
    http://ubuntuforums.org/showthread.php?p=10796138

  6. #6
    Join Date
    Mar 2008
    Location
    Poland, Europe
    Beans
    211
    Distro
    Ubuntu

    Re: [HOWTO] Turn gnome-terminal into tilda (quake) like pop-up terminal

    Hmm. I'd like to try this, but installing the launch-restore is scary. It says the .deb quality is poor.


    Code:
    The installation of a package which violates the quality standards isn't allowed. This could cause serious problems on your computer. Please contact the person or organisation who provided this package file and include the details beneath.
    
    Lintian check results for /home/karni/Desktop/launch-restore-0.52.deb:
    E: launch-restore: wrong-file-owner-uid-or-gid usr/ 1000/1000
    E: launch-restore: wrong-file-owner-uid-or-gid usr/local/ 1000/1000
    E: launch-restore: wrong-file-owner-uid-or-gid usr/local/bin/ 1000/1000
    E: launch-restore: wrong-file-owner-uid-or-gid usr/local/bin/launch-restore 1000/1000
    Did you guys have the same issue? I didn't continue with the install

  7. #7
    Join Date
    Nov 2006
    Location
    Denmark
    Beans
    83

    Re: [HOWTO] Turn gnome-terminal into tilda (quake) like pop-up terminal

    Quote Originally Posted by mkarnicki View Post
    Did you guys have the same issue? I didn't continue with the install
    At least in ubuntu 10.10 and older it install just fine. If you are afraid that the deb package might break something, you can install it manually by just downloading the archive attached to this post, then launching nautilus as root ("sudo nautilus") and extracting the script in the archive to /usr/local/bin .
    Attached Files Attached Files

  8. #8
    Join Date
    Mar 2008
    Location
    Poland, Europe
    Beans
    211
    Distro
    Ubuntu

    Re: [HOWTO] Turn gnome-terminal into tilda (quake) like pop-up terminal

    Thanks! I'll give it a spin

Tags for this Thread

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
  •