You are not logged in.

#1 2018-03-05 10:21:08

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Quake Terminal - Terminator, Tilix, XFCE4-Terminal urxvt, xterm, Tilda

There was a change regarding the default shortcuts on #BĹ. The menu will be on “super” only, which made “super+space” available for something else. I asked myself: How to use Terminator in quake mode via “super+space” (and/or via systray icon)?

If someone is not familiar with the term: Quake mode is basically a dropdown terminal opening via shortcut (any time after startup. It comes from the game Quake, which had something like that for messages). See screenshot: Press “super+space”, Terminator opens on the top of the screen, press “super+space” again, terminal hides – it’s the same by clicking that systray icon in the bottom right corner. While that quake mode terminal is open or hidden, the default Terminator window can still be opened.


quaketerminalterminatorverticaltint2.th.png

Yakuake (KDE) or guake (gnome) are offering this feature out-of-the-box.

On #BĹ I tested I. Terminator, II. Tilix and III. XFCE4-Terminal, which do not actually have “dropdown” windows, more like “hide/unhide”, which is very similar.

There is a true dropdown feature with IV. urxvt and V. xterm with yeahconsole and VI. Tilda. Luckily Tilda was the last one I discovered, because otherwise I would not have bothered with the other ones.

This is how it looks with Terminator borderless and without a scrollbar:
quaketerminalterminator.th.png

And this is Tilix in quake mode:
quaketerminaltilix.th.png


I. Terminator

Here are the steps to configure Terminator in quake mode on “super+space”:

1. “super+space” opened the openbox menu so far. On Helium pressing only “super” will open the openbox menu. Here is how to make “super+space” available for the quake mode terminal.

Check ~/openbox/.config/autostart – in this file on Helium there is:

xcape -e 'Super_L=Super_L|space'

It makes possible to start the menu by pressing only the super key.

Without this line the menu would open by pressing “super+space”, which goes back to the following line in Menu/Display Keybinds/Backup and Edit rc.xml:

<keybind key="W-space">

The shortcut itself does not matter as long as it’s the same in both (xcape and keybind key) lines. In order to get “super+space” available for the quake mode, change the menu-shortcut in rc.xml (<keybind key="W-space">) to e.g. super+alt+ctrl+p:

<keybind key="W-A-C-p">

And in ~/openbox/.config/autostart you’ll need to put accordingly (or only change if you are on Helium already):

xcape -e 'Super_L=Super_L|Alt_L|Control_L|p'

When those lines are changed and saved, restart openbox (Menu/Preferences/Openbox/Restart).


2. Open the terminal, right click, go to “Preferences”/“Keybindings”-tab, double click on the hide_window entry under the “Keybinding” section (“New Accelerator...” appeares) and press super + space. It shows “Super+Space” when it’s done.


3. Go to the “Profiles”-tab, click on “Add” a new Profile and name it e.g. to “quake”. Configure here as you like, uncheck “Show titlebar” and under the “Scrolling”-tab choose Scrollbar is “Disabled” (be careful that the profile “quake” is marked on the left and not "default").


4. On the “Global”-tab there are checked for me: "DBus Server",  "Smart Copy", "Extra Styling", "Window borders", "Tabs homogeneous" and  "Use the system font" (“Window borders” is checked, but it’s ok as starting Terminator with the “-b” switch means borderless. I checked “Dbus server”, but I think on #BĹ the default is unchecked while on Debian checked”).


5. Go to the “Layouts”-tab, click “Add” for a new layout and name it to “quake”. In the coloumn next to Layout click on “Terminal” and make sure that under “Profile” on the right side there is “quake”. Click on “save”. Having a “quake” Profile and a “quake” Layout makes it easy to have a separate quake mode configuration regardless the default layout and profile.


6. Open ~/.config/terminator/config (there will be now “super+space” under “[keybindings]”) and look under “[layouts]” for the “[[quake]]” section. Here delete the line “last_active_window = True”, otherwise the “-H” (hide) switch won’t work properly (the exact function of this line was a bit unclear to me. Does someone maybe know it?).

If you start the terminal with window borders (without the “-b” switch), you can have a custom title like “title = Terminator Quake Mode engineered by martix” by adding this line to the config file (or use the "--title" switch). Here is an example how a config file may look like (position and size settings from the config for the “quake” layout did not work for me, but it works via command line switch):
[don't use this code, this is just an example, you should have something similar]

[global_config]
  broadcast_default = off
[keybindings]
  hide_window = <Super>space
[layouts]
  [[default]]
    [[[child0]]]
      fullscreen = False
      last_active_term = 05333322-8446c-45533-b662a-3445552ac88f7
      last_active_window = True
      maximised = False
      order = 0
      parent = ""
      position = 313:82
      size = 781, 456
      title = name@hostname: ~
      type = Window
    [[[terminal1]]]
      order = 0
      parent = child0
      profile = default
      type = Terminal
      uuid = 05333322-8446c-45533-b662a-3445552ac88f7
  [[quake]]
    [[[child0]]]
      fullscreen = False
      last_active_term = 05333322-8446c-45533-b662a-3445552ac88f7
      maximised = False
      order = 0
      parent = ""
      position = 300:46
      size = 681, 456
      title = Terminator Quake Mode engineered by martix
      type = Window
    [[[terminal1]]]
      order = 0
      parent = child0
      profile = quake
      type = Terminal
      uuid = 05333322-8446c-45533-b662a-3445552ac88f7
[plugins]
[profiles]
  [[default]]
    background_darkness = 0.9
    background_type = transparent
    cursor_color = "#aaaaaa"
    icon_bell = False
    show_titlebar = False
  [[quake]]
    background_darkness = 0.85
    background_type = transparent
    cursor_color = "#aaaaaa"
    foreground_color = "#00ff00"
    icon_bell = False
    scrollbar_position = hidden
    show_titlebar = False

7. Close Terminator and try to open it in quake mode e.g. via gmrun (alt+F2):

terminator -H -b --geometry=681x456+300+46 --layout=quake --profile=quake

“-H” means “hidden”, i.e. there will be now window first, but after “super+space” the terminal should appear. Pressing “super+space” again and the window disappeares. If you check “Hide on lose focus” under “Preferences”/”Global”-tab (don’t forget to save under “Layouts” and Terminator may need to be restarted to activate changes), the window will disappear, if you click somewhere on the screen.
“-b” means borderless and “--geometry” stands for window position and size – could somebody maybe tell me the correct figures for the default tint2 on #BĹ so I can correct the numbers here? Change the figures according to your desktop configuration.


8. In order to have this feature available on start, paste the appropriate command to start Terminator

## Start Terminator in background in order to enable quake mode
(sleep 3; terminator -H -b --geometry=681x456+260+46 --layout=quake --profile=quake) &

in ~/.config/openbox/autostart (e.g. under starting the battery applet).

That was it for the shortcut. I tried a different setup with a separate config file for the quake mode and using the --config=Path switch, but it got messed up after starting the default Terminator.


9. For starting the terminal via System Tray icon I used the following in tint2rc (I’m not sure: Is there a need maybe for an additional “E” in the “panel_items =” line in this case? It worked for me without it):

# Execp - tint2rc executor for starting
# the terminal in quake mode via shortcut
# command per mouseclick on systray icon
execp = new
execp_has_icon = 1
execp_cache_icon = 1
execp_centered = 1
execp_command = echo /usr/share/icons/Papirus/22x22/categories/terminator.svg
execp_lclick_command = xdotool key super+space
execp_interval = 0
execp_continuous = 0
execp_tooltip = Terminal Quake Mode engineered by martix
execp_font = monospace 9
execp_font_color = #aaffaa 100
execp_padding = 0 0

This tint2 addition may need some polish. It simply uses the “super+space” shortcut via “xdotool key”. This command can be also activated via bl-hotcorners.



II. Tilix

The first step with Tilix is the same as above, so “super+space” will be available. Tilix is now in debian stretch backports. After installing it you just need to add the following to rc.xml and restart openbox:

<keybind key="W-space">
      <action name="Execute">
        <startupnotify>
          <enabled>false</enabled>
          <name>tilix</name>
        </startupnotify>
        <command>tilix --quake</command>
      </action>
    </keybind>

Under Preferences/Quake you can tweak the details. It’s possible to use it via systray icon the same way as described at Step 9 above. When Tilix opens via “super+space”, using F12 to show the open terminals within the terminal is really awesome.

Sidenote: I’m not sure if it’s still needed for Tilix to add the following to .bashrc:

if [ $TILIX_ID ] || [ $VTE_VERSION ]; then
        source /etc/profile.d/vte.sh
fi



III. XFCE4 Terminal

The configuration of XFCE4-Terminal in quake mode is also on the easy side. Step 1 is the same as above.

Otherwise it’s just an “apt install” away

sudo apt install xfce4-terminal

and the quake mode works via

xfce4-terminal --drop-down

Just put the following in rc.xml in order to use it via “super+space”

<keybind key="W-space">
      <action name="Execute">
        <startupnotify>
          <enabled>false</enabled>
          <name>XFCE4-Terminal</name>
        </startupnotify>
        <command>xfce4-terminal --drop-down</command>
      </action>
    </keybind>

and restart openbox.

Using the “Drop-down” tab under “Preferences” (bottom right corner) there is an option to check: “Show status icon in notification area”. Therefore there is no need to tweak tint2rc. Clicking on the systray icon will hide/unhide XFCE4-Terminal in quake mode. It can be configured to have a menu bar and a tool bar but there is no split-window feature.

It’s also possible to install all three terminals and put them on three different shortcuts.

Last edited by martix (2018-03-12 12:36:18)

Offline

#2 2018-03-05 20:13:59

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Quake Terminal - Terminator, Tilix, XFCE4-Terminal urxvt, xterm, Tilda

Thanks for this martix!

There is also this method for rxvt-unicode & openbox:

https://wiki.archlinux.org/index.php/Rx … in_Openbox


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#3 2018-03-07 05:00:06

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 7,295
Website

Re: Quake Terminal - Terminator, Tilix, XFCE4-Terminal urxvt, xterm, Tilda

Nice work!
---
Lithium isn't anywhere near released though: s/Lithium/Helium/g smile
Ampersand after xcape line is not needed (and not in the Helium file).
I would suggest a more obscure keybind for the menu, since no-one will actually use it - leaving W-p free:

<keybind key="W-A-C-p">

or something.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#4 2018-03-09 01:44:52

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Quake Terminal - Terminator, Tilix, XFCE4-Terminal urxvt, xterm, Tilda

^Thanks for the hints, corrected in the OP. Almost forgot: Here is a useful site for Terminator config options.

@HoaS I really had to laugh at that Arch page. Finally I understood Arch! I'm just saying it because there are two small scripts and all kinds of system tweaks, whereas there is a small package called yeahconsole doing the same. It was even Debian package of the day once. I found it so cool almost started a new thread for quake with rxvt-unicode and xterm. Btw did you configure those colors for urxvt? They're great.



IV. How to configure a quake mode Terminal on "super+space" with rxvt-unicode and xterm

1. First step is the same as described in the starting post -> make "super+space" available.

2. If you don't have it yet, install

sudo apt install rxvt-unicode

or

sudo apt install rxvt-unicode-256color

3. Install yeahconsole

sudo apt install yeahconsole

4. Put in ~/.Xresources (e.g. before or after the  ! urxvt -------------- part) and tweak xOffset and screenWidth for the right quake terminal position (see other settings as well, but read the next steps first):

! yeahconsole -------------------------------------

yeahconsole.term:urxvt
yeahconsole.restart:1
yeahconsole.xOffset:300
yeahconsole.screenWidth:768
yeahconsole.consoleHeight:25
yeahconsole.aniDelay:40
yeahconsole.stepSize:1
yeahconsole.toggleKey:Win+space
yeahconsole.keySmaller:Control+n
yeahconsole.keyBigger:Control+m
yeahconsole.keyFull:Alt+F11

5. When it is saved, go to your home folder (where you find .Xresources) by cd ~  and run

xrdb -load .Xresources

6. Start yeahconsole

yeahconsole

Press "super+space" to open the dropdown rxvt-unicode terminal.

7. To have it permanent paste in ~/.config/openbox/autostart

(sleep 3; yeahconsole) &

8. If you want to change settings, you have to stop yeahconsole (killall yeahconsole), change the appropriate line in .Xresources, save, use “xrdb -load .Xresources” and start yeahconsole again.


Shortcuts in .Xresources:
toggleKey:      key combo that toggles yeahconsole – above super+space
keyBigger:      increase  height of yeahconsole – above ctrl+m
keySmaller:     decrease height of yeahconsole – above ctrl+n
keyFull:        toggle fullscreenmode – above alt+F11 

Further settings to change in .Xresources:
screenWidth:    width (defaults to display width)
consoleHeight:  number of lines (defaults to 10)
xOffset:        x position (defaults to 0)
aniDelay:       delay for the slide animation (defaults to 40)
stepSize:        step size for the animation (defaults to 1)
handleWidth:    width for the resize handle (defaults to 3)
handleColor:    color for the handle    (defaults to grey70)

It’s possible to have multiple instances of yeahconsole because it looks up xresources by its name. It means you can have multiple instances of yeahconsole with different settings. To make this happen just make a symbolic link to yeahconsole with a different name, e.g yeahconsole2, and yeahconsole will look up it's resources in the form "yeahconsole2.foo:value".

The "-e" option starts an initial programm at startup. E.g. if you have the music player cmus, it’s possible to have it always available via dropdown terminal by putting

(sleep 3; yeahconsole -e cmus) &

in ~/.config/openbox/autostart.

For yeahconsole that tint2 systray icon does not work for some reason.



V. Xterm

Well, make it short: Same steps as above, install xterm but change the “yeahconsole.term:” line in .Xresources to

yeahconsole.term:xterm
VI. Tilda

Tilda is really great. I guess it was created with the following idea: Having a cool dropdown terminal. This is what Tilda does, and it does it well with a package less than 100 kb. It's in the repos and out-of-the-box Tilda offers the best user experience (also regarding Preferences).

The first step is the same as in the starting post, so "super+space" will be available.

Otherwise it's a simple

sudo apt install tilda

Default shortcut is F1, but it's easy to change to "super+space" under Preferences/Keybindings. It can be even configured to open from one side or the bottom. Toggle Searchbar (shift+ctrl+f) is also a cool feature.

Last edited by martix (2018-03-12 12:51:18)

Offline

#5 2018-03-13 15:02:13

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Quake Terminal - Terminator, Tilix, XFCE4-Terminal urxvt, xterm, Tilda

This line

last_active_window = True

just bothers me because still cannot explain what it is doing (or which setting it is). But if I search for terminator config files, usually it is there.

The terminator configuration above works, but there are minor issues sometimes, e.g. I had in xsession-errors:

<window.Window object at 0x7f193e234fa0 (terminatorlib+window+Window at 0x5650b2ff02a0)>
Traceback (most recent call last):
  File "/usr/share/terminator/terminatorlib/window.py", line 315, in on_hide_window
    print self.window
AttributeError: 'Window' object has no attribute 'window'
0
<window.Window object at 0x7f193e234fa0 (terminatorlib+window+Window at 0x5650b2ff02a0)>
Traceback (most recent call last):
  File "/usr/share/terminator/terminatorlib/window.py", line 315, in on_hide_window
    print self.window
AttributeError: 'Window' object has no attribute 'window'
0
<window.Window object at 0x7f193e234fa0 (terminatorlib+window+Window at 0x5650b2ff02a0)>
Traceback (most recent call last):
  File "/usr/share/terminator/terminatorlib/window.py", line 315, in on_hide_window
    print self.window
AttributeError: 'Window' object has no attribute 'window'
0
<window.Window object at 0x7f193e234fa0 (terminatorlib+window+Window at 0x5650b2ff02a0)>
Traceback (most recent call last):
  File "/usr/share/terminator/terminatorlib/window.py", line 315, in on_hide_window
    print self.window
AttributeError: 'Window' object has no attribute 'window'
0
<window.Window object at 0x7f193e234fa0 (terminatorlib+window+Window at 0x5650b2ff02a0)>
Traceback (most recent call last):
  File "/usr/share/terminator/terminatorlib/window.py", line 315, in on_hide_window
    print self.window
AttributeError: 'Window' object has no attribute 'window'

There used to be one more dropdown terminal called Stjerm, but it is abandoned by now.

Last edited by martix (2018-04-29 08:49:59)

Offline

Board footer

Powered by FluxBB