Tint2: Difference between revisions

From ArchWiki
m (→‎Configuration: Fix style. See Help:Style.)
m (Link back to the Chinese page)
 
(82 intermediate revisions by 29 users not shown)
Line 1: Line 1:
[[Category:Eye candy]]  
{{Lowercase title}}
[[ru:Tint2]]
[[Category:Eye candy]]
[[zh-CN:Tint2]]
[[ja:Tint2]]
[http://code.google.com/p/tint2/ tint2] is a system panel for linux. It is described by its developers as "simple panel/taskbar unobtrusive and light". It can be configured to include (or not include) among other things a system tray, a task list, a battery monitor and a clock. Its look can also be configured a great deal, and it does not have many dependencies. This makes it ideal for window manager users who want a panel but do not have one by default, like [[Openbox]] users.
[[zh-hans:Tint2]]
[https://gitlab.com/o9000/tint2 tint2] is a simple, unobtrusive and light [[panel]] for [[Xorg]]. It can be configured to include a system tray, a task list, a battery monitor and more. Its look is configurable and it only has few dependencies, making it ideal for window managers like [[Openbox]], that do not come with a panel.


==Installation==
== Installation ==
tint2 can be installed with the package {{Pkg|tint2}}, available in the [[official repositories]].


==Configuration==
[[Install]] the {{Pkg|tint2}} package.
tint2 has a configuration file in {{ic|~/.config/tint2/tint2rc}}. A skeleton configuration file with the default settings is created the first time you run tint2. You can then change this file to your liking. Full documentation on how to configure tint2 is found [http://code.google.com/p/tint2/wiki/Configure here]. You can configure the fonts, colors, looks, location and more in this file. The tint2 package now contains a GUI configuration tool that can be accessed by typing the command:
$ tint2conf


Alternatively, you can edit your {{ic|tint2rc}} configuration file graphically with {{AUR|tintwizard}} from the [[AUR]]. The alternate and now outdated development branch {{AUR|tintwizard-svn}} can also be used, but is the same as the {{ic|tint2conf}} command.
== Configuration ==


===Application Launchers in tint2-svn (AUR)===
''tint2'' has a configuration file in {{ic|~/.config/tint2/tint2rc}}. A skeleton configuration file with the default settings is created the first time you run ''tint2''. You can then change this file to your liking. Full documentation on how to configure ''tint2'' is found [https://gitlab.com/o9000/tint2/blob/master/doc/tint2.md#configuration here]. You can configure the fonts, colors, looks, location and more in this file. The ''tint2'' package also contains a GUI configuration tool which can be launched with ''tint2conf''.
With the version of tint2 in subversion (available via AUR: {{AUR|tint2-svn}}), it has become possible to add application launchers to tint2. In order to do this it is necessary to manually edit your tint2 configuration file, as {{AUR|tintwizard}} does not yet support the launchers.
 
{{Note|When you edit your tint2 config file using tintwizard after manually adding your launchers, tintwizard will delete any configuration options it does not recognize. I.e. it deletes your launchers.}}
=== Application launchers ===
It is necessary to add the following configuration options to your tint2 config file:
 
With version 0.12, it has become possible to add application launchers to ''tint2''. It is necessary to add the following configuration options to your ''tint2'' configuration file:
 
Under {{ic|#Panel}}:


Under {{Ic|#Panel}}:
  # Panel
  # Panel
  panel_items = LTSBC
  panel_items = LTSBC
Line 32: Line 32:
  launcher_item_app = /some/where/anotherapplication.desktop
  launcher_item_app = /some/where/anotherapplication.desktop


The option {{Ic|launcher_icon_theme}} seems not to be documented yet.
{{Ic|panel_items}} is a new configuration option which defines which items ''tint2'' shows and in what order:


{{Ic|panel_items}} is a new configuration option which defines which items tint2 shows and in what order:
; L: shows the Launcher
; L: Show Launcher
; T: shows the Taskbar
; T: Show Taskbar
; S: shows the Systray (also called notification area)
; S: Show Systray
; B: shows the Battery status
; B: Show Battery status
; C: shows the Clock
; C: Show Clock
; F: adds an extensible spacer (freespace). You can specify more than one. Has no effect if `T` is also present. ''(since 0.12)''
; E: adds an executor plugin. You can specify more than one. ''(since 0.12.4)''
; P: adds a push button. You can specify more than one. ''(since 0.14)''
; <nowiki>:</nowiki>: adds a separator. You can specify more than one. ''(since 0.13.0)''


===Applications Menu in OpenBox3===
=== Applications menu in Openbox ===
If running the {{AUR|tint2-svn}} from AUR, you have the ability to create launchers. Unfortunately, tint2 does not support nested menus yet, so there is no native function to enable an applications menu. With a little ingenuity, one can trick tint2 and get an applications menu anyway! This example will create such a launcher for Openbox3.


First, you have to [[Pacman|install]] {{Pkg|openbox}}, {{AUR|tint2-svn}} and {{Pkg|xdotool}}. Next you want to create a keybinding for opening the Openbox menu. For Openbox, this would require the following entry between the <keyboard> and </keyboard> tags in {{ic|~/.config/openbox/rc.xml}}:
Since version 0.12, you have the ability to create launchers. Unfortunately, ''tint2'' does not support nested menus yet, so there is no native function to enable an applications menu. This section describes a way to create a launcher for Openbox.
  <!-- Keybinding for opening OpenBox menu -->
  <keybind key="C-A-space">
    <action name="ShowMenu"><menu>root-menu</menu></action>
  </keybind>


This will set {{Keypress|Ctrl+Alt+Space}} to open the root-menu (this is the menu that opens when you right-click the desktop). You can change {{ic|root-menu}} to any menu-id that you have defined in {{ic|~/.config/openbox/menu.xml}}. Next we need to make that keybinding into a {{ic|.desktop}} file with {{ic|xdotool}}. First test that your keybind works with:
Besides ''tint2'' and Openbox, [[install]] the {{Pkg|xdotool}} package. Next, create a keybinding for opening the Openbox menu:
 
{{hc|~/.config/openbox/rc.xml|2=
<keyboard>
<nowiki> <!-- Keybinding for opening OpenBox menu --></nowiki>
<keybind key="C-A-space">
  <action name="ShowMenu"><menu>root-menu</menu></action>
</keybind>
</keyboard>
}}
 
This will set {{ic|Ctrl+Alt+Space}} to open the root-menu (this is the menu that opens when you right-click the desktop). You can change {{ic|root-menu}} to any menu-id that you have defined in {{ic|~/.config/openbox/menu.xml}}. Next we need to make that keybinding into a {{ic|.desktop}} file with {{ic|xdotool}}. First test that your keybind works with:


  $ xdotool key ctrl+alt+space
  $ xdotool key ctrl+alt+space


If the menu you chose pops up under your mouse cursor, you have done it right! Now create a {{ic|tint2.desktop}} file inside {{ic|/usr/share/applications/}} directory. Be sure to add the line {{Ic|Exec&#61;xdotool key ctrl+alt+space}} where {{Keypress|Ctrl+Alt+Space}} are your chosen key combinations. Open your new {{ic|tint2.desktop}} file from your file manager and, once again, you should see the menu appear under your cursor. Now just add this to tint2 as a launcher, and you have your Openbox Applications Menu as a launcher for tint2!
If the menu you chose pops up under your mouse cursor, you have done it right! Now create a {{ic|open-openbox-menu.desktop}} file inside the {{ic|~/.local/share/applications}} directory. Add the line {{ic|1=Exec=xdotool key ctrl+alt+space}} where {{ic|Ctrl+Alt+Space}} are your chosen key combinations. Open your new {{ic|open-openbox-menu.desktop}} file from your file manager and, once again, you should see the menu appear under your cursor. Now just add this to ''tint2'' as a launcher, and you have your Openbox Applications Menu as a launcher for ''tint2''. If you need to place the menu at a fixed position, you can use {{ic|xdotool mousemove x y}}. You can create a script and reference it in {{ic|open-openbox-menu.desktop}} since it involves two commands.


See [http://openbox.org/wiki/Help:Menus Openbox Menus] for further help on creating your own menu to use here, and {{Pkg|menumaker}} to generate a nice full {{ic|menu.xml}} for most (possibly all) of your installed programs.
See [http://openbox.org/wiki/Help:Menus Openbox Menus] for further help on creating your own menu to use here, and {{Pkg|menumaker}} to generate a nice full {{ic|menu.xml}} for most (possibly all) of your installed programs.


==Running tint2==
Since version 0.14, you have the ability to create buttons. Just add "xdotool key ctrl+alt+space" string from example above to button key action you want to be start menu action.
===Openbox===
 
You can run tint2 by simply typing the command:
=== Volume control ===
 
''tint2'' does not come with a volume control applet. See [[List of applications/Multimedia#Volume control]].
 
== Running tint2 ==
 
=== Openbox ===
 
You can run ''tint2'' by simply typing the command:
 
  $ tint2
  $ tint2


If you want to run it when starting [[X]], simply add this to {{ic|~/.xinitrc}}. For example if you run tint2 with [[Openbox]]:
If you want to run ''tint2'' when starting [[Openbox]], you will need to edit {{ic|~/.config/openbox/autostart}} and add the following line:
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
'''tint2 &'''
exec ck-launch-session openbox-session


If you want to run tint2 when starting [[Openbox]], you will need to update {{ic|~/.config/openbox/autostart}} by adding the following:
  tint2 &
  tint2 &


Note: if you do not have an autostart file in {{ic|~/.config/openbox}}, you can copy the default one from {{ic|/etc/xdg/openbox/autostart}}.
=== GNOME ===
 
In [[GNOME]], the Activities view has replaced the bottom panel and taskbar. To use ''tint2'' in its place, run
 
$ gnome-session-properties
 
and add {{ic|/usr/bin/tint2}} as an application to run on start-up. The next time GNOME starts, ''tint2'' will run automatically.
 
=== i3 ===
 
In [[i3]], to use ''tint2'' as a replacement for {{ic|i3status}}, append the following line to end of the i3 configuration file:
 
{{hc|~/.config/i3/config|2=
exec --no-startup-id tint2
}}
 
and comment out or remove any section like {{ic|bar{status_command i3status}}} from the same file.
 
=== Multiple panels ===
 
Multiple ''tint2'' panels can be simultaneously running by executing ''tint2'' with different configuration files:
 
tint2 -c ''path/to/first/config/file''
tint2 -c ''path/to/second/config/file''
 
== Enabling transparency ==
 
''tint2'' supports both fake and real transparency. Which one is used is regulated by the {{ic|disable_transparency}} option in the {{ic|tint2rc}} configuration file.
 
If you want to completely disable transparency you need to use {{ic|1=disable_transparency = 1}} and set the panel background opacity to 100. Eg:
 
  background_color = #000000 100
 
=== Fake transparency ===


Refer to [http://openbox.org/wiki/Help:Autostart Openbox help] for more information on autostart options for Openbox.
For fake transparency you need to set {{ic|1=disable_transparency = 1}}.


===Gnome 3===
Fake transparency captures a portion of the desktop background and uses that as the panel background. Because of that it is important to set the background image before ''tint2'' is activated. A startup script example for [[Openbox]] could be (using [[Feh]] for the background):
In Gnome 3, the Activities view has replaced the bottom panel and taskbar. To use tint2 in its place, run


  # gnome-session-properties
  ...
feh --randomize --no-fehbg --bg-fill ~/Pictures/wallpapers/
(sleep 1 && tint2) &
...


and add
=== Real transparency ===


# /usr/bin/tint2
For real transparency you need to activate a compositor like [[picom]] first and set {{ic|1=disable_transparency = 0}}.


as an application to run on startup. The next time gnome starts, tint2 will run automatically.
The opacity is regulated by the second parameter of the {{ic|background_color}} property in the ''tint2'' [https://gitlab.com/o9000/tint2/blob/master/doc/tint2.md#backgrounds-and-borders configuration file].


==Enabling transparency==
If you are making changes on the fly, you may need to restart ''tint2'' for the transparency to take effect.
To make tint2 look its best, some form of compositing is required. If your tint2 has a large black rectangular box behind it you are either using a window manager without native compositing (like Openbox) or it is not enabled.


To enable compositing under Openbox you can install [[Xcompmgr]] or [[Cairo Compmgr]], the packages are {{Pkg|xcompmgr}}, respectively {{AUR|cairo-compmgr}}.
== Fullscreen/Overlay ==


Xcompmgr can be started like this:
To force ''tint2'' to stay on top of the application (overlay), you need to set the panel_layer option appropriately. This can be helpful when you switch from a fullscreen window to a normal application using {{ic|Alt+Tab}}. There is a discussion on this at [https://crunchbang.org/forums/viewtopic.php?pid=70048 Crunchbang Forum]


$ xcompmgr
  #Panel
  panel_layer = top
  strut_policy = follow_size


You will have to kill and restart tint2 to enable transparency.
== Third party extensions ==


If Xcompmgr is used solely to provide tint2 with transparency effects it can be run at boot by changing the autostart section in {{ic|~/.config/openbox/autostart}} to this:
It is also possible to extend ''tint2'' with other applications. To add third party extensions, check the [https://gitlab.com/o9000/tint2/wikis/ThirdPartyApplets Applets] section of official Wiki.


# Launch Xcomppmgr and tint2 with openbox
== See also ==
if which tint2 >/dev/null 2>&1; then
  (sleep 2 && xcompmgr) &
  (sleep 2 && tint2) &
fi


Various other (better) ways to make Xcompmgr run at startup are discussed in the [[Openbox]] article.
* [https://gitlab.com/o9000/tint2/wikis/home Tint2 upstream wiki]

Latest revision as of 21:06, 27 January 2023

tint2 is a simple, unobtrusive and light panel for Xorg. It can be configured to include a system tray, a task list, a battery monitor and more. Its look is configurable and it only has few dependencies, making it ideal for window managers like Openbox, that do not come with a panel.

Installation

Install the tint2 package.

Configuration

tint2 has a configuration file in ~/.config/tint2/tint2rc. A skeleton configuration file with the default settings is created the first time you run tint2. You can then change this file to your liking. Full documentation on how to configure tint2 is found here. You can configure the fonts, colors, looks, location and more in this file. The tint2 package also contains a GUI configuration tool which can be launched with tint2conf.

Application launchers

With version 0.12, it has become possible to add application launchers to tint2. It is necessary to add the following configuration options to your tint2 configuration file:

Under #Panel:

# Panel
panel_items = LTSBC

And under the new section #Launchers:

# Launchers
launcher_icon_theme = LinuxLex-8
launcher_padding = 5 0 10
launcher_background_id = 9
launcher_icon_size = 85
launcher_item_app = /some/where/application.desktop
launcher_item_app = /some/where/anotherapplication.desktop

panel_items is a new configuration option which defines which items tint2 shows and in what order:

L
shows the Launcher
T
shows the Taskbar
S
shows the Systray (also called notification area)
B
shows the Battery status
C
shows the Clock
F
adds an extensible spacer (freespace). You can specify more than one. Has no effect if `T` is also present. (since 0.12)
E
adds an executor plugin. You can specify more than one. (since 0.12.4)
P
adds a push button. You can specify more than one. (since 0.14)
:
adds a separator. You can specify more than one. (since 0.13.0)

Applications menu in Openbox

Since version 0.12, you have the ability to create launchers. Unfortunately, tint2 does not support nested menus yet, so there is no native function to enable an applications menu. This section describes a way to create a launcher for Openbox.

Besides tint2 and Openbox, install the xdotool package. Next, create a keybinding for opening the Openbox menu:

~/.config/openbox/rc.xml
<keyboard>
 <!-- Keybinding for opening OpenBox menu -->
 <keybind key="C-A-space">
   <action name="ShowMenu"><menu>root-menu</menu></action>
 </keybind>
</keyboard>

This will set Ctrl+Alt+Space to open the root-menu (this is the menu that opens when you right-click the desktop). You can change root-menu to any menu-id that you have defined in ~/.config/openbox/menu.xml. Next we need to make that keybinding into a .desktop file with xdotool. First test that your keybind works with:

$ xdotool key ctrl+alt+space

If the menu you chose pops up under your mouse cursor, you have done it right! Now create a open-openbox-menu.desktop file inside the ~/.local/share/applications directory. Add the line Exec=xdotool key ctrl+alt+space where Ctrl+Alt+Space are your chosen key combinations. Open your new open-openbox-menu.desktop file from your file manager and, once again, you should see the menu appear under your cursor. Now just add this to tint2 as a launcher, and you have your Openbox Applications Menu as a launcher for tint2. If you need to place the menu at a fixed position, you can use xdotool mousemove x y. You can create a script and reference it in open-openbox-menu.desktop since it involves two commands.

See Openbox Menus for further help on creating your own menu to use here, and menumaker to generate a nice full menu.xml for most (possibly all) of your installed programs.

Since version 0.14, you have the ability to create buttons. Just add "xdotool key ctrl+alt+space" string from example above to button key action you want to be start menu action.

Volume control

tint2 does not come with a volume control applet. See List of applications/Multimedia#Volume control.

Running tint2

Openbox

You can run tint2 by simply typing the command:

$ tint2

If you want to run tint2 when starting Openbox, you will need to edit ~/.config/openbox/autostart and add the following line:

tint2 &

GNOME

In GNOME, the Activities view has replaced the bottom panel and taskbar. To use tint2 in its place, run

$ gnome-session-properties

and add /usr/bin/tint2 as an application to run on start-up. The next time GNOME starts, tint2 will run automatically.

i3

In i3, to use tint2 as a replacement for i3status, append the following line to end of the i3 configuration file:

~/.config/i3/config
exec --no-startup-id tint2

and comment out or remove any section like bar{status_command i3status} from the same file.

Multiple panels

Multiple tint2 panels can be simultaneously running by executing tint2 with different configuration files:

tint2 -c path/to/first/config/file
tint2 -c path/to/second/config/file

Enabling transparency

tint2 supports both fake and real transparency. Which one is used is regulated by the disable_transparency option in the tint2rc configuration file.

If you want to completely disable transparency you need to use disable_transparency = 1 and set the panel background opacity to 100. Eg:

 background_color = #000000 100

Fake transparency

For fake transparency you need to set disable_transparency = 1.

Fake transparency captures a portion of the desktop background and uses that as the panel background. Because of that it is important to set the background image before tint2 is activated. A startup script example for Openbox could be (using Feh for the background):

...
feh --randomize --no-fehbg --bg-fill ~/Pictures/wallpapers/
(sleep 1 && tint2) &
...

Real transparency

For real transparency you need to activate a compositor like picom first and set disable_transparency = 0.

The opacity is regulated by the second parameter of the background_color property in the tint2 configuration file.

If you are making changes on the fly, you may need to restart tint2 for the transparency to take effect.

Fullscreen/Overlay

To force tint2 to stay on top of the application (overlay), you need to set the panel_layer option appropriately. This can be helpful when you switch from a fullscreen window to a normal application using Alt+Tab. There is a discussion on this at Crunchbang Forum

 #Panel
 panel_layer = top
 strut_policy = follow_size

Third party extensions

It is also possible to extend tint2 with other applications. To add third party extensions, check the Applets section of official Wiki.

See also