You are not logged in.

#1 2015-10-23 21:41:35

ohnonot
...again
Registered: 2015-09-29
Posts: 4,020
Website

tint2-mods2 (with the useful Exec plugin)

https://gitlab.com/o9000/tint2-mods2/

It's a fork of tint2 into which o9000 (also known as ov on #! forums), the current main developer of tint2, has included some extra features. for example a plugin that executes a command at a given interval and displays its output.

screenshot: http://iki.fi/dt/stuff/tint2-mods2-moc.png

so, without further ado, here's my current tint2-mods2.rc:

# Background definitions
# Background 1: panel
rounded = 0
border_width = 0
background_color = #ffffff 5
border_color = #292929 100

# Background 2: normal/iconified tasks
rounded = 0
border_width = 0
background_color = #FFFFFF 5
border_color = #FFFFFF 30

# Background 3: active tasks
rounded = 0
border_width = 0
background_color = #FFFFFF 15
border_color = #ffffff 40

# Background 4: urgent tasks
rounded = 0
border_width = 0
background_color = #aa4400 100
border_color = #aa7733 100

# Background 5: tooltips
rounded = 0
border_width = 0
background_color = #FFFFFF 50
border_color = #222222 50

# Background 6: taskbar inactive
rounded = 0
border_width = 0
background_color = #000000 0
border_color = #FFFFFF 16

# Panel
panel_items = TESC
panel_monitor = all
panel_position = bottom center horizontal
panel_size = 100% 30
panel_margin = 0 0
panel_padding = 0 0 2
panel_dock = 0
wm_menu = 1
panel_layer = top
panel_background_id = 1
font_shadow = 0

# Panel Autohide
autohide = 0
autohide_show_timeout = 0
autohide_hide_timeout = 0.5
autohide_height = 2
strut_policy = follow_size

# Launcher
launcher_padding = 2 0 2
launcher_background_id = 0
launcher_icon_size = 28
launcher_icon_asb = 100 0 0
launcher_tooltip = 1
startup_notifications = 1
launcher_item_app = /usr/share/applications/iceweasel.desktop

# Taskbar
taskbar_mode = multi_desktop
taskbar_padding = 0 0 8
taskbar_background_id = 6
taskbar_active_background_id = 3
taskbar_name = 1
taskbar_name_padding = 8 0
taskbar_name_background_id = 0
taskbar_name_font = open sans bold 14
taskbar_name_font_color = #EEEEEE 40
taskbar_name_active_background_id = 0
taskbar_name_active_font_color = #EEEEEE 100

# Tasks
task_icon = 1
task_text = 0
task_centered = 1
task_maximum_size = 28 28
task_padding = 1 1 1
task_background_id = 2
task_active_background_id = 3
task_urgent_background_id = 4
task_iconified_background_id = 2
task_tooltip = 1
urgent_nb_of_blink = 100000

# Task Icons
task_icon_asb = 100 0 0
task_active_icon_asb = 100 0 0
task_urgent_icon_asb = 100 0 0
task_iconified_icon_asb = 50 0 0

# Fonts
task_font = open sans 8
task_font_color = #FFFFFF 90
task_active_font_color = #FFFFFF 90
task_urgent_font_color = #FFFFFF 90
task_iconified_font_color = #FFFFFF 90

# Mouse
mouse_left = toggle_iconify
mouse_middle = close
mouse_right = none
mouse_scroll_up = prev_task
mouse_scroll_down = next_task

# System Tray
systray_padding = 0 0 5
systray_sort = ascending
systray_background_id = 0
systray_icon_size = 28
systray_icon_asb = 100 0 0

# Clock
time1_format = %H:%M
time1_font = open sans bold 14
clock_font_color = #FFFFFF 60
clock_padding = 4 10
clock_background_id = 6
clock_rclick_command = xdotool key ctrl+alt+c
clock_tooltip = %c

# Tooltips
tooltip_padding = 1 1
tooltip_show_timeout = 0.5
tooltip_hide_timeout = 0.1
tooltip_background_id = 5
tooltip_font = open sans 8
tooltip_font_color = #222222 100

#---------------------------------------------
# E = EXECP
execp_centered = 0
execp_has_icon = 1
execp_cache_icon = 0
execp_icon_w = 28
execp_icon_h = 28
execp_command = tint2-mods2-moc 2 80 
execp_interval = 2
execp_font = open sans 8
execp_font_color = #ffffff 60
execp_background_id = 0
execp_padding = 2 0 2
execp_lclick_command = mocp --toggle-pause
execp_mclick_command = mocming
execp_rclick_command = mocp --next
execp_uwheel_command = amixer sset PCM,0 2+
execp_dwheel_command = amixer sset PCM,0 2-
#---------------------------------------------
task_normalhovered_background_id = 6
task_activehovered_background_id = 7
task_urgenthovered_background_id = 8
#---------------------------------------------
# End of config

and here's the script tint2-mods2-moc:

#!/bin/bash

# gets information from mocp, formats it to a defined maximum length, omitting
# characters in the middle.
# then it tries to seperate the string into a defined number of lines,
# respecting word boundaries (only normal whitespace)
# the first line returns the path to an icon, for use with the EXEC plugin from
# https://gitlab.com/o9000/tint2-mods2/

me="$(basename "$0")"
icon1="$HOME/.config/tint2/img/media-playback-pause.png"
icon2="$HOME/.config/tint2/img/media-playback-start.png"
maxlen="$2" # maximum length of string before dividing into lines
lines="$1" # it is best if maxlen%lines is 0
tmp_dir="/tmp"

function only_me_or_exit {
	# make sure only 1 instance is running
	touch "$1"
	read lastPID < "$1"
	# if lastPID is not null and a process with that pid exists , exit
	[ ! -z "$lastPID" -a -d /proc/$lastPID ] && { echo "An instance of $me is already running with pid $lastPID." ; exit 1 ; }
	# else - save my pid in the lock file, and continue
	echo $$ > "$1"
}
function exit_only_me {
	rm "$pidfile"
	exit
}

function otherinfo_func {
	# get song length and remaining time and such and format it nicely
	echo "${info[CurrentTime]#0}/${info[TotalTime]#0}"
}
function join_maxlen_func {
	# 2 strings - $1 and $2 - not more than $maxlen chars altogether.
	# but the first string is to be shortened, not the 2nd.
	dots=""
	[ ${#1} -gt $((maxlen - ${#2})) ] && dots="..."
	echo "${1:0:((maxlen - ${#dots} - ${#2}))}$dots $2"
}
function lines_func {
	string="$1"
	for (( ; lines > 1 ; lines-- ))
	do
		length=${#string}
		for (( fwd=$((length/lines)) , bwd=$((length/lines)) ; bwd >= 0 ; fwd++ , bwd-- ))
		do
			if [[ "${string:$fwd:1}" = " " ]]
			then
				echo "${string:0:$fwd}"
				string="${string:$((fwd + 1))}"
				break
			fi
			if [[ "${string:$bwd:1}" = " " ]]
			then
				echo "${string:0:$bwd}"
				string="${string:$((bwd + 1))}"
				break
			fi
			#~ "${string:$bwd:1}"
			#~ wordlength
		done
	done
	echo "$string"
}
function get_info_func {
	if [[ "${info[Title]}" == "" ]]
	then
		returnstring="$(basename "${info[File]}")"
		returnstring="${returnstring%\.*}"
	else
		returnstring="${info[Title]}"
	fi
	echo "$returnstring"
}
#############################################################################
# make sure only 1 instance is running
pidfile="$tmp_dir/${me}_pid"
only_me_or_exit "$pidfile"

if pidof mocp >/dev/null
then
	# the fields of the associative array are named after the information contained
	# in them (as provided by "mocp -i")
	declare -A info
	info=()
	timeout=0
	while [ "${#info[*]}" -le 1 ] && [ $timeout -le 10 ]
	do
		while read -r line
		do
			info[${line%%\: *}]="${line##*\: }"
		done < <(mocp -i)
	[ "${#info[*]}" -le 1 ] && sleep 0.1
	timeout=$((timeout + 1))
	done
	
	case "${info[State]}" in
		"PLAY") 
		infostring="$(get_info_func)"
		echo "$icon2"
		lines_func "$(join_maxlen_func "$infostring" "$(otherinfo_func)")"
		exit_only_me
		;;
		"PAUSE") 
		infostring="$(get_info_func)"
		echo "$icon1"
		lines_func "$(join_maxlen_func "$infostring" "$(otherinfo_func)")"
		exit_only_me
		;;
	esac
fi

echo # no icon for uptime?
lines_func "$(uptime -p)"
exit_only_me

=======================================

edit august 2017:
I have long since moved this to a github repo.
i'm sure it is mentioned somewhere further down in this thread, but here it is anyhow:
https://github.com/ohnonot/media-player-info

Last edited by ohnonot (2017-08-16 05:35:13)

Offline

#2 2015-10-24 03:11:44

nubilfi
Member
From: /etc/init.d
Registered: 2015-10-08
Posts: 3
Website

Re: tint2-mods2 (with the useful Exec plugin)

Woaahh looks great. I like the player in the panel. Let me try it.


#! account: m.i.h.h
Sorry for my bad english :)
--I will continue to seek knowledge--
i blog at: billnode

Offline

#3 2015-10-24 05:26:47

Snap
Member
Registered: 2015-10-02
Posts: 465

Re: tint2-mods2 (with the useful Exec plugin)

System monitoring and moc within (sorta) tint2? Definitely something to try.

Thanks for opening this, ohnonot.

Offline

#4 2015-10-24 06:18:39

Snap
Member
Registered: 2015-10-02
Posts: 465

Re: tint2-mods2 (with the useful Exec plugin)

Ooops...

The system monitor applet uses a lot of CPU (up to 1% on i7).

Offline

#5 2015-10-24 07:36:20

ohnonot
...again
Registered: 2015-09-29
Posts: 4,020
Website

Re: tint2-mods2 (with the useful Exec plugin)

^ i agree, snap.
tint2 is modular, and so is tint2-mods2, so if you don't use the system monitor, it doesn't eat resources.
I personally think it doesn't fit in with the philosophy of tint2 anyway.

what i really love is the ability to display the output of an arbitrary command.
with recently added onclick_commands, it's really almost like a small player in your systray :-)

Offline

#6 2015-10-24 08:19:24

Snap
Member
Registered: 2015-10-02
Posts: 465

Re: tint2-mods2 (with the useful Exec plugin)

Yes, E is actually the juicy part.

Offline

#7 2015-10-24 09:06:06

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 399
Website

Re: tint2-mods2 (with the useful Exec plugin)

Snap wrote:

Ooops...

The system monitor applet uses a lot of CPU (up to 1% on i7).

Ooops indeed. I haven't tried to optimize that code yet, but I'm not sure if I will make further improvements. I found it useful at some point years ago, but nowadays I use htop whenever I need performance monitoring.

But the executer seems to be interesting for a lot of people. I'm considering changing it in a way that multiple instances are possible, each with its own icon/command. This would also allow the implementation of buttons, which some people on the #! forum said would be useful.

Offline

#8 2015-10-24 10:45:08

ohnonot
...again
Registered: 2015-09-29
Posts: 4,020
Website

Re: tint2-mods2 (with the useful Exec plugin)

welcome to the forums, o9000!  big_smile

Offline

#9 2015-10-24 11:59:40

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 399
Website

Re: tint2-mods2 (with the useful Exec plugin)

ohnonot wrote:

welcome to the forums, o9000!  big_smile

Thanks smile

Offline

#10 2015-10-24 14:13:21

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: tint2-mods2 (with the useful Exec plugin)

Out of curiosity, is it possible to get a more tactile feel for launchers or buttons in tint2, such as on_hover or on_click events? I like BL's default launchers but dislike the fact that they don't respond to input so I am never really sure if they were clicked properly, etc. I have been intending to pull a newer version of tint2 and test this but haven't gotten around too it yet.

Offline

#11 2015-10-24 16:10:35

ohnonot
...again
Registered: 2015-09-29
Posts: 4,020
Website

Re: tint2-mods2 (with the useful Exec plugin)

tknomanzr, look at the wiki and sample configs for both the mainstream tint2 gitlab repository and the one for tint2-mods2.

some things can be configured to react on hover, but maybe not the launcher buttons? i don't know.
obviously they do react on click events.

Offline

#12 2015-10-24 19:01:24

ohnonot
...again
Registered: 2015-09-29
Posts: 4,020
Website

Re: tint2-mods2 (with the useful Exec plugin)

i noticed that the shell script tends to hang itself in an endless loop when moc isn't playing anything, and tint2-mods2 respawning it endlessly...
i hope it's fixed now (through the shell script, i don't think tint2-mods2 has the ability to check if a script is already running).
i also noticed that whichever script defined through execp_command is still being executed, even when i remove 'E' from panel_items.

Offline

#13 2015-10-24 19:03:07

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 399
Website

Re: tint2-mods2 (with the useful Exec plugin)

@tknomanzr

In the stable tint2 there is indeed no visual feedback for hover/press events. I agree with you that this feels unnatural.

Here is the feature request: https://gitlab.com/o9000/tint2/issues/44

In the experimental repo I added feedback for hover events on task buttons: you can set a different background (which also includes border). There is no visual feedback for launcher buttons. I implemented this change in 2010. At the time, Thierry (the creator of tint2) suggested a more elegant implementation that would use the same code for adding feedback to any element that accepts mouse events. However neither of us had time to work on this.

Technically, this is possible and might be added in the future.

There are 2 possible solutions:

Option A: Let the user configure 3 backgrounds instead of 1 for each element: one for normal state, one for hover, one for press. Configuring all of these can be tedious.

Option B: Add a default effect (ideally configurable) for all clickable elements, that behaves similarly to the one GTK/Qt icon buttons have (use the normal state's background/border/icon/text and makeit lighter on hover, darker on press). For example, something like:
hover_bg_color: brightness_multiplier alpha_multiplier saturaion_multiplier
hover_border_color: brightness_multiplier alpha_multiplier saturaion_multiplier
hover_icon_color: brightness_multiplier alpha_multiplier saturaion_multiplier
hover_text_color: brightness_multiplier alpha_multiplier saturaion_multiplier

and the same for press_*.

I think B is good enough, and not too difficult to configure. Option A would increase the number of config options greatly, which is not user friendly and also a pain to implement.

For now I am testing multiple bugfixes for the battery plugin (contributed by Sebastian Reichel; he is the original authour of the battery plugin). I will release a new minor version soon with these fixes. There are no other known bugs (yay!) so I can finally work on new features at the end of this year.

I am conservative when it comes to adding new features: I only add features if they are truly useful and "fit" into tint2, and if they do not affect performance; also I am against removing features. So any new feature must be designed carefully.

I will probably create a poll soon about these things to see what BL users would like to see in the next version.

Offline

#14 2015-10-25 03:50:32

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: tint2-mods2 (with the useful Exec plugin)

I wan't sure if it was possible yet or not, so no worries. Get to it when you can. I agree that point B is the better option. It doesn't need to be fancy, I just like the extra interface feedback, especially when on a laptop with those cheap Windows trackpads that have me steering the pointer like a drunk irishman. I will be happy to take it for a test spin when implemented.

Offline

#15 2015-11-04 00:45:53

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 399
Website

Re: tint2-mods2 (with the useful Exec plugin)

I wrote a first implementation of mouse hover effects.

You can grab and install the latest code from master: https://gitlab.com/o9000/tint2/wikis/In … l-manually

Add to config:

mouse_effects = 1

Optional: also set background_color_hover and border_color_hover for individual backgrounds.

Feedback is appreciated.

Offline

#16 2015-11-04 02:23:34

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: tint2-mods2 (with the useful Exec plugin)

It looks great for the taskbar icons. For the launchers, the effect is almost too subtle for me to see as it only affects the border of the launcher icons. I am not sure why the hover effect doesn't seem to affect the background like it does for the taskbar icons. It might be instead of doing a hover on effect on the background it might need to be done on the icon itself. I am testing it on a pretty much stock BunsenLabs tint2rc.

Offline

#17 2015-11-04 12:10:47

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 399
Website

Re: tint2-mods2 (with the useful Exec plugin)

Thanks. I implemented mouse down effects (not configurable yet) and icon tinting (also not configurable yet). I also fixed a few bugs.

Now tinting just increases brightness by 10% on hover and decreases by 10% on press. I think it's a good default, but I will add config options soon anyways (probably another asb).

Offline

#18 2015-11-04 17:29:12

ohnonot
...again
Registered: 2015-09-29
Posts: 4,020
Website

Re: tint2-mods2 (with the useful Exec plugin)

o9000 wrote:

(probably another asb).

that sounds sensible.

so is this about vanilla tint2? shouldn't you open a thread for tint2? it should really get all the attention it deserves, esp. since it's an essential part of bl.

Offline

#19 2015-12-12 23:10:16

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 399
Website

Re: tint2-mods2 (with the useful Exec plugin)

Just FYI, I merged the code for the executor plugin into tint2. Configuration is explained here:
https://gitlab.com/o9000/tint2/wikis/Configure#executor

The code is still under development, but I haven't seen any problems lately. There is no support for configuring it yet in tint2conf.

If you still hit the issue with the command running twice, or any other problems, let me know.

Also note that you should use

execp_cache_icon = 1

to let imlib cache the icons, since the files never change.

______________________________________________________________________________________

There are two main modes of running commands:

1. One-shot commands executed repeatedly such as df. These are programs that print something and exit; the executer then waits a given number of seconds and runs them again. For example, this prints the disk usage every 10 seconds:

# Execp 1 : print disk usage for the root partition
execp = new
execp_command = df -h | awk '/\/$/ { print $6 ": " $2 " " $5}'
execp_interval = 10
execp_centered = 1
execp_font = Liberation Mono 9
execp_font_color = #ffaaaa 100
execp_padding = 0 0
execp_tooltip =

2. One-shot commands executed once such as hostname or echo's. These are programs that print something and exit. They are executed only once when tint2 loads the config.

Note that clicking the executor triggers running the command again, if you need this.

For example, this prints the number of CPU cores:

# Execp 2 : print the number of CPU cores
execp = new
execp_command = echo "$(nproc) cores"
execp_interval = 0
execp_centered = 1
execp_font = Liberation Mono 9
execp_font_color = #aaffaa 100
execp_padding = 0 0
execp_tooltip =

This works as a button:

# Execp 3 : this works as a button, showing rich text and an icon
execp = new
execp_command = echo /usr/share/icons/elementary-xfce/emblems/24/emblem-colors-blue.png; echo '<span foreground="#7f7">Click</span> <span foreground="#77f">me</span> <span foreground="#f77">pls</span>'
execp_has_icon = 1
execp_interval = 0
execp_centered = 1
execp_font = sans 9
execp_markup = 1
execp_font_color = #aaffaa 100
execp_padding = 2 0
execp_tooltip = I will tell you a secret...
execp_lclick_command = zenity --info "--text=$(uname -sr)"
execp_background_id = 2

3. Continuous commands such as top or ping, which generate an infinite output. For these you need to specify the number of lines to display with execp_continuous:

# Execp 6 : show the RTT to the gateway
execp = new
execp_command = ping -i 1 -W 1 -O -D -n $(ip route | grep default | grep via | grep -o '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*') | awk '/no/ { print "<span foreground=\"#faa\">timeout</span>"; fflush(); }; /time=/ { gsub(/time=/, "", $8); printf "<span foreground=\"#7af\">%3.0f %s</span>\n", $8, $9; fflush(); } '
execp_continuous = 1
execp_interval = 1
execp_markup = 1
execp_font_color = #ffffff 100
execp_font = monospace 9

Here is a full example:

# Tint2 sample config file
# For information on manually configuring tint2 see https://gitlab.com/o9000/tint2/wikis/Configure

# Background definitions
# Background 1: panel
rounded = 0
border_width = 0
background_color = #000000 60
border_color = #000000 30

# Background 2: normal/iconified tasks
rounded = 4
border_width = 1
background_color = #777777 20
border_color = #777777 30
background_color_hover = #aaaaaa 22
border_color_hover = #eaeaea 44
background_color_pressed = #555555 4
border_color_pressed = #eaeaea 44

# Background 3: active tasks
rounded = 4
border_width = 1
background_color = #777777 20
border_color = #ffffff 40
background_color_hover = #aaaaaa 22
border_color_hover = #eaeaea 44
background_color_pressed = #555555 4
border_color_pressed = #eaeaea 44

# Background 4: urgent tasks
rounded = 4
border_width = 1
background_color = #aa4400 100
border_color = #aa7733 100
background_color_hover = #cc7700 100
border_color_hover = #aa7733 100
background_color_pressed = #555555 4
border_color_pressed = #aa7733 100

# Background 5: tooltips
rounded = 2
border_width = 1
background_color = #ffffaa 100
border_color = #999999 100

# Panel
panel_items = LTEEEEEESC
panel_monitor = all
panel_position = bottom center horizontal
panel_size = 100% 30
panel_margin = 0 0
panel_padding = 7 0 7
panel_dock = 0
wm_menu = 1
panel_layer = top
panel_background_id = 1
font_shadow = 0
strut_policy = follow_size
mouse_effects = 1

# Panel Autohide
autohide = 0
autohide_show_timeout = 0
autohide_hide_timeout = 0.5
autohide_height = 2

# Launcher
launcher_padding = 2 4 2
launcher_background_id = 0
launcher_icon_size = 22
launcher_icon_asb = 100 0 0
launcher_tooltip = 1
startup_notifications = 1
launcher_item_app = /usr/share/applications/tint2conf.desktop
launcher_item_app = /usr/local/share/applications/tint2conf.desktop
launcher_item_app = /usr/share/applications/firefox.desktop
launcher_item_app = /usr/share/applications/iceweasel.desktop
launcher_item_app = /usr/share/applications/chromium-browser.desktop
launcher_item_app = /usr/share/applications/google-chrome.desktop

# Taskbar
taskbar_mode = single_desktop
taskbar_padding = 2 2 2
taskbar_background_id = 0
taskbar_active_background_id = 0

# Tasks
task_icon = 1
task_text = 1
task_centered = 1
task_maximum_size = 150 35
task_padding = 6 1
task_background_id = 2
task_active_background_id = 3
task_urgent_background_id = 4
task_iconified_background_id = 2
task_tooltip = 1
urgent_nb_of_blink = 100000

# Task Icons
task_icon_asb = 100 0 0
task_active_icon_asb = 100 0 0
task_urgent_icon_asb = 100 0 0
task_iconified_icon_asb = 100 0 0

# Fonts
task_font_color = #FFFFFF 90
task_active_font_color = #FFFFFF 90
task_urgent_font_color = #FFFFFF 90
task_iconified_font_color = #FFFFFF 90

# Mouse
mouse_left = toggle_iconify
mouse_middle = none
mouse_right = close
mouse_scroll_up = toggle
mouse_scroll_down = iconify

# System Tray
systray_padding = 0 4 5
systray_sort = ascending
systray_background_id = 0
systray_icon_size = 22
systray_icon_asb = 100 0 0

# Clock
time1_format = %H:%M
time2_format = %A %d %B
clock_font_color = #FFFFFF 100
clock_padding = 1 0
clock_background_id = 0
clock_rclick_command = orage

# Tooltips
tooltip_padding = 2 2
tooltip_show_timeout = 0.5
tooltip_hide_timeout = 0.1
tooltip_background_id = 5
tooltip_font_color = #222222 100

# Battery
battery_low_status = 10
battery_low_cmd = notify-send "battery low"
battery_hide = 101
battery_font_color = #FFFFFF 100
battery_padding = 1 0
battery_background_id = 0

# Execp 1 : print disk usage for the root partition
execp = new
execp_command = df -h | awk '/\/$/ { print $6 ": " $2 " " $5}'
execp_interval = 10
execp_centered = 1
execp_font = Liberation Mono 9
execp_font_color = #ffaaaa 100
execp_padding = 0 0
execp_tooltip =

# Execp 2 : print the number of CPU cores
execp = new
execp_command = echo "$(nproc) cores"
execp_interval = 0
execp_centered = 1
execp_font = Liberation Mono 9
execp_font_color = #aaffaa 100
execp_padding = 0 0
execp_tooltip =

# Execp 3 : this works as a button, showing rich text and an icon
execp = new
execp_command = echo /usr/share/icons/elementary-xfce/emblems/24/emblem-colors-blue.png; echo '<span foreground="#7f7">Click</span> <span foreground="#77f">me</span> <span foreground="#f77">pls</span>'
execp_has_icon = 1
execp_interval = 0
execp_centered = 1
execp_font = sans 9
execp_markup = 1
execp_font_color = #aaffaa 100
execp_padding = 2 0
execp_tooltip = I will tell you a secret...
execp_lclick_command = zenity --info "--text=$(uname -sr)"
execp_background_id = 2

# Execp 4 : show the memory usage
execp = new
execp_command = free -s 2 | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%\n", 100*$3/($3+$4); fflush(stdout) }'
execp_interval = 1
execp_continuous = 1
execp_centered = 1
execp_font = Liberation Mono 9
execp_font_color = #ffffaa 100
execp_padding = 0 1
execp_tooltip =

# Execp 5 : show the network load
# Note the use of "stdbuf -oL" to force the program to flush the output line by line.
execp = new
execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | awk -F ';' '/total/ { printf "Net: %.0f Mb/s\n", ($5*8/1.0e6) }; fflush(stdout)'
execp_continuous = 1
execp_interval = 1
execp_centered = 1
execp_font = Liberation Mono 9
execp_font_color = #7777ff 100
execp_padding = 0 0
execp_tooltip =

# Execp 6 : show the RTT to the gateway
execp = new
execp_command = ping -i 1 -W 1 -O -D -n $(ip route | grep default | grep via | grep -o '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*') | awk '/no/ { print "<span foreground=\"#faa\">timeout</span>"; fflush(); }; /time=/ { gsub(/time=/, "", $8); printf "<span foreground=\"#7af\">%3.0f %s</span>\n", $8, $9; fflush(); } '
execp_continuous = 1
execp_interval = 1
execp_markup = 1
execp_font_color = #ffffff 100
execp_font = monospace 9

Screenshot:

Screenshot_execp.md.png

Offline

#20 2015-12-13 10:33:09

ohnonot
...again
Registered: 2015-09-29
Posts: 4,020
Website

Re: tint2-mods2 (with the useful Exec plugin)

amazing!
more functionality, and i can go back to the main branch.
"rich text", do you mean pango? certainly not RTF?

Offline

#21 2015-12-13 10:39:15

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 399
Website

Re: tint2-mods2 (with the useful Exec plugin)

Pango indeed.

Offline

#22 2015-12-23 16:42:03

AL13N
Member
Registered: 2015-10-05
Posts: 148

Re: tint2-mods2 (with the useful Exec plugin)

Installed tint2 0.12.3 to utilise taskbar_hide_inactive_tasks.

First time using git or make but everything went smoothly.

@o9000: Thank you for the new features/fixes and easy to follow instructions.

Offline

#23 2015-12-23 22:45:02

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 399
Website

Re: tint2-mods2 (with the useful Exec plugin)

@ohnonot

I finally had a bit of free time to merge tint2conf support for the executor plugin. Just pushed it to master. BTW gosh, tint2conf is so ugly... but it does the job.

@ALI3N

I'm glad it works well for you. Just to understand a little better the use case, may I ask how you use that option?

I know of only one other user, who wanted to use 2 panels, a normal one at the bottom and a top one with a huge task button to display the current window title on a top bar. This was the feature request: https://gitlab.com/o9000/tint2/issues/458

Offline

#24 2015-12-24 15:37:06

AL13N
Member
Registered: 2015-10-05
Posts: 148

Re: tint2-mods2 (with the useful Exec plugin)

^I'm using a 17px panel for tint2, conky and dmenu.  Tint2 displays current desktop and current window title.

GIF: https://scrot.moe/image/avXa

Scrolling up/down on the taskbar button switches to previous/next task.  Scrolling on the taskbar name or conky switches desktops.  Left-click on taskbar button to iconify.  Right-click and middle-click on tint2 or conky calls Openbox menu and Openbox desktops.

## https://gitlab.com/o9000/tint2/wikis/home
##
## simple-taskbar.tint2rc

## Backgrounds and borders
# ID 1
rounded = 0
border_width = 0
background_color = #202020 100

## Panel
panel_items = T
panel_monitor = all
panel_position = top left horizontal
panel_size = 806 17
panel_margin = 0 0
panel_padding = 0 0 0
panel_background_id = 1
wm_menu = 1
panel_dock = 0
panel_layer = top
strut_policy = follow_size
disable_transparency = 1

## Taskbar / Pager
taskbar_mode = single_desktop
taskbar_padding = 0 0 5
taskbar_background_id = 1
taskbar_active_background_id = 1
taskbar_hide_inactive_tasks = 1
task_align = left
taskbar_name = 1
taskbar_name_padding = 5 0
taskbar_name_background_id = 1
taskbar_name_font = Monospace bold 9.5
taskbar_name_font_color = #6699cc 100
taskbar_name_active_background_id = 1
taskbar_name_active_font_color = #6699cc 100

## Taskbar buttons
task_icon = 0
task_text = 1
task_centered = 0
task_tooltip = 0
task_maximum_size = 760
task_padding = 0 0
urgent_nb_of_blink = 0
task_font = Droid Sans bold 10
task_font_color = #c0c0c0 100
task_background_id = 1
task_active_font_color = #c0c0c0 100
task_active_background_id = 1
task_urgent_font_color = #e17b71 100
task_urgent_background_id = 1

## Mouse actions for taskbar buttons
mouse_middle = none
mouse_right = none
mouse_scroll_up = prev_task
mouse_scroll_down = next_task

# End of config

Thank you for your continuing work.

Last edited by AL13N (2015-12-28 20:43:00)

Offline

#25 2015-12-24 15:39:24

o9000
tint2 developer
From: Network Neighborhood
Registered: 2015-10-24
Posts: 399
Website

Re: tint2-mods2 (with the useful Exec plugin)

Looks nice!

Offline

Board footer

Powered by FluxBB