[OPEN] Tint2 Modification

Post Reply
edmorbius
Crewman
Posts: 6
Joined: Fri Feb 21, 2020 10:12 pm

[OPEN] Tint2 Modification

Post by edmorbius »

Hi All

I am hoping that I can get a quick tip on what I am going wrong. My goal is to add the output from some personal shells scripts to my Tint2. One example would be to add weather information.

I have found several resources so I thought I new what I was doing. But, when I append the following lines to tint2rc and restart Tint2, I don't see anything.

Code: Select all

execp = new
execp_command = echo "test"
execp_interval = 60
execp_has_icon = 0
execp_continuous = 0
execp_font = Noto Sans 10
execp_font_color = #ffffff 100
execp_padding = 0 0
execp_centered = 0
The echo replaced my weather script to remove any issue that I may have with that script. Shouldn't I see "test" somewhere in the Tint2 bar?

kes__
Crewman
Posts: 6
Joined: Fri Jun 05, 2020 11:30 am

Re: [OPEN] Tint2 Modification

Post by kes__ »

Ed

Although scripting the tint2 toolbar is easy, as you correctly point out there is little or no documentation.

I have included my step-by-step tint2rc scripting guide, below, so you can see how to add scripts, & custom icons & custom txt, to your tint2 toolbar.

Here are the necessary steps

1.

Open your tint2rc text config file.
This is usually in

Code: Select all

~/.config/tint2/tint2rc
eg

Code: Select all

vim ~/.config/tint2/tint2rc

I moved my tint2rc text file, and anything else that was in the original tint2 folder, to my `scripts_tint2` folder, becasue then it is with my other scripting/ config files on google drive. Then I created a symlink between these locations, so that everything still works, as follows,

Code: Select all

# create the new directory location which is backed up on google drive
mkdir /home/user/google_drive/scripts/script_tint2 

# move the tint2rc config file & anything else in the original directory to the new backed up directory
mv ~/.config/tint2/* /home/user/google_drive/scripts/script_tint2 

# remove the original directory
rm  ~/.config/tint2/tint2rc

# create the symlink between the old location and the new backed up location 
ln -s /home/user/google_drive/scripts/script_tint2 ~/.config/tint2
2.

I store my custom tint2 png icons and custom tint2 scripts in this backed up folder too.

After the above tidy up, open up your

Code: Select all

~/.config/tint2/tint2rc
text config file, and ..


3.

.. scroll down to the bottom of this post, and have a look at my attached tint2rc text config file.

Notice particularly the 12 custom executor sections I have added, at the very end of the file.

Above this file is also pasted one of the script files that is called by the 'printing` `Executor` so you can see this too.

Spend a moment having a look at the structure of these two files.


4.

Now go back to the tint2rc file ..

IMPORTANT step: make sure that there as many E's in the `panel_items =` line of your custom script, as there are executors.

There will be one Executor for each icon text pair you wish to display.
And there will be 1 E in
`panel_items = `
for each one as well.

So if you have 4 seperate unique `Executor` scripts you want represented in your tint2 toolbar, you would need 4 Executor sections at the end of your your tint2rc text file and 4 E's in
`panel_items = `
like this ..

Code: Select all

panel_items = TEEEEFSLBC
Notice 4 E's for exactly 4 custom scripted apps.
If you have 3E's only, 3 scripted apps will show up on your tint2 tool bar, even if they are more than 3 executor sections present in your `tint2rc` file.

So becasue I have 12 executors, I have 12 E's, or

Code: Select all

panel_items = TEEEEEEEEEEEEFSLBC


5.


IMPORTANT step:

Set the refresh frequency on each executor, for the frequency, in seconds, you want each individual executor to refresh with.

It is fairly obvious how to do this by studying just one executor section.

6.


IMPORTANT step:

restart tint2 effortlessly, while experimenting with customisation set-up, with the following command

Code: Select all

killall -SIGUSR1 tint2
7.

files below are ...

a. example script called by one tint2rc executor ... below ..

Code: Select all

#!/bin/bash

# check that topics are all RETAINED or this will not work

# configure tint2
#      https://gitlab.com/o9000/tint2/blob/master/doc/tint2.md     


snmp_version="-v1"
printer_ip="mqtt.sytes.net"
colon=":"
port="3332"



###################### STEP ONE, ECHO ANY NECESSSARY SMALL PNG ICON #########################

# MQTT power status
printer_power_status=$(mosquitto_sub -C 1 -h $printer_ip -t house/groundfloor/livingroom/printer_HPLJ2200/stat/sonoff/POWER1)


# choose the correct icon to reflect the status of the SONOFF power switch

# echo green printer icon if the printer is on
if [ "$printer_power_status" = "ON" ]; then  echo "/home/user/google_drive/scripts/script_tint2/laser_printer_green.png"; fi

# echo transparent printer icon of the printer is off
if [ "$printer_power_status" = "OFF" ]; then echo "/home/user/google_drive/scripts/script_tint2/laser_printer.png";       fi




###################### STEP TWO, ECHO ANY NECESSSARY DISPLAY TEXT #########################

# no alphanumeric text is echoed with this script, but you could put something here just to see how it works
echo "ON"

#echo " test"


/home/user/google_drive/scripts/script_tint2/mqtt_laser_printer_status.sh



b. tint2rc file below ..

Code: Select all

# 
# `panel_items=` is up here to remind me that if I don't change it it won't work
# panel_items = TEEEEEEEEEEEEFSLBC
#
#
#---- Generated by tint2conf 1a13 ----
# See https://gitlab.com/o9000/tint2/wikis/Configure for 
# full documentation of the configuration options.
#-------------------------------------
# Gradients
# Gradient 1
gradient = radial
start_color = #000000 0
end_color = #000000 0

# Gradient 2
gradient = radial
start_color = #000000 0
end_color = #000000 0

# Gradient 3
gradient = radial
start_color = #000000 0
end_color = #000000 0

# Gradient 4
gradient = radial
start_color = #000000 0
end_color = #000000 0

# Gradient 5
gradient = radial
start_color = #000000 0
end_color = #000000 0

# Gradient 6
gradient = radial
start_color = #000000 0
end_color = #000000 0

# Gradient 7
gradient = radial
start_color = #000000 0
end_color = #000000 0

#-------------------------------------
# Backgrounds
# Background 1: 
rounded = 0
border_width = 1
border_sides = T
border_content_tint_weight = 0
background_content_tint_weight = 0
background_color = #000000 80
border_color = #333333 80
background_color_hover = #000000 80
border_color_hover = #555555 80
background_color_pressed = #000000 80
border_color_pressed = #555555 80

# Background 2: Default task, Iconified task
rounded = 0
border_width = 2
border_sides = B
border_content_tint_weight = 0
background_content_tint_weight = 0
background_color = #777777 0
border_color = #777777 0
background_color_hover = #777777 21
border_color_hover = #cccccc 30
background_color_pressed = #5a5a5a 21
border_color_pressed = #777777 30

# Background 3: Active task
rounded = 0
border_width = 2
border_sides = B
border_content_tint_weight = 0
background_content_tint_weight = 0
background_color = #ffffff 0
border_color = #4d75ff 100
background_color_hover = #ffffff 21
border_color_hover = #4c73ff 100
background_color_pressed = #989898 21
border_color_pressed = #4c73ff 100

# Background 4: Urgent task
rounded = 0
border_width = 0
border_sides = TBLR
border_content_tint_weight = 0
background_content_tint_weight = 0
background_color = #aa4400 100
border_color = #aa7733 100
background_color_hover = #aa4400 100
border_color_hover = #aa7733 100
background_color_pressed = #aa4400 100
border_color_pressed = #aa7733 100

# Background 5: 
rounded = 2
border_width = 1
border_sides = TBLR
border_content_tint_weight = 0
background_content_tint_weight = 0
background_color = #ffffaa 100
border_color = #999999 100
background_color_hover = #ffffaa 100
border_color_hover = #999999 100
background_color_pressed = #ffffaa 100
border_color_pressed = #999999 100

# Background 6: Inactive desktop name
rounded = 0
border_width = 2
border_sides = B
border_content_tint_weight = 0
background_content_tint_weight = 0
background_color = #777777 0
border_color = #777777 0
background_color_hover = #bdbdbd 21
border_color_hover = #cccccc 100
background_color_pressed = #777777 21
border_color_pressed = #777777 100

# Background 7: Active desktop name
rounded = 1
border_width = 6
border_sides = T
border_content_tint_weight = 0
background_content_tint_weight = 0
background_color = #ffffff 21
border_color = #4c73ff 100
background_color_hover = #ffffff 21
border_color_hover = #4d73ff 100
background_color_pressed = #a9a9a9 21
border_color_pressed = #4d73ff 100

#-------------------------------------
# Panel
panel_items = TEEEEEEEEEEEEFSLBC

#panel_size = 100% 32
#panel_size = 100% 64
panel_size = 100% 170

panel_margin = 0 0
panel_padding = 4 0 4
panel_background_id = 0
wm_menu = 1
panel_dock = 0
panel_pivot_struts = 0

#panel_position = top right horizontal
panel_position = left left vertical


panel_layer = normal
panel_monitor = all
panel_shrink = 0
autohide = 0
autohide_show_timeout = 0
autohide_hide_timeout = 0.5
autohide_height = 2
strut_policy = follow_size
panel_window_name = tint2
disable_transparency = 0
mouse_effects = 1
font_shadow = 0
mouse_hover_icon_asb = 100 0 10
mouse_pressed_icon_asb = 100 0 0
scale_relative_to_dpi = 0
scale_relative_to_screen_height = 1



#-------------------------------------
# Taskbar
taskbar_mode = multi_desktop
taskbar_hide_if_empty = 0
taskbar_padding = 0 0 8
taskbar_background_id = 0
taskbar_active_background_id = 0
taskbar_name = 1
taskbar_hide_inactive_tasks = 0
taskbar_hide_different_monitor = 0
taskbar_hide_different_desktop = 0
taskbar_always_show_all_desktop_tasks = 0
taskbar_name_padding = 4 1
taskbar_name_background_id = 6
taskbar_name_active_background_id = 7
taskbar_name_font = sans bold 9

#taskbar_name_font_color = #dddddd 100
#taskbar_name_active_font_color = #ffffff 100

# desktop font colour 
taskbar_name_font_color = #000000 100
taskbar_name_active_font_color = #000000 100

taskbar_distribute_size = 1
taskbar_sort_order = none
#task_align = right
task_align = left



#-------------------------------------
# Task
task_text = 1
task_icon = 1
task_centered = 0
urgent_nb_of_blink = 100000

task_maximum_size = 120 35
#task_maximum_size = 60 17

task_padding = 4 3 4
#task_padding = 24 18 24

# open applications descriptor font size 
task_font = Sans 10
task_tooltip = 1
task_thumbnail = 0
task_thumbnail_size = 210

# task font colour below
task_font_color = #0000000 100
task_active_font_color = #000000 100


task_icon_asb = 100 0 0
task_background_id = 2
task_active_background_id = 3
task_urgent_background_id = 4
task_iconified_background_id = 2

# mouse stuff on the task bar
mouse_left = toggle_iconify
mouse_middle = none
mouse_right = close
mouse_scroll_up = prev_task
mouse_scroll_down = next_task

#-------------------------------------
# System tray (notification area)
systray_padding = 0 0 2
systray_background_id = 0
systray_sort = ascending

# size of icons of default applications
systray_icon_size = 22
systray_icon_asb = 100 0 0
systray_monitor = 1
systray_name_filter = 

#-------------------------------------
# Launcher
launcher_padding = 0 0 2
launcher_background_id = 0
launcher_icon_background_id = 0
launcher_icon_size = 22
launcher_icon_asb = 100 0 0
launcher_icon_theme_override = 0
startup_notifications = 1
launcher_tooltip = 1
launcher_item_app = tint2conf.desktop
launcher_item_app = iceweasel.desktop
launcher_item_app = chromium-browser.desktop
launcher_item_app = x-terminal-emulator.desktop

#-------------------------------------
# Clock
time1_format = %H:%M:%S       %a %-d  %b  %Y
time2_format = %H:%M:%S        %a    %-d    %b
time1_font = sans bold 14
time1_timezone = Europe/London
time2_timezone = Asia/Colombo
time2_font = Sans 10
clock_font_color = #050202 100
clock_padding = 1 0
clock_background_id = 0
clock_tooltip = Left click for YAD calendar. Right click for Google Calendar
clock_tooltip_timezone = 
clock_lclick_command = zenity --calendar --text ""
clock_rclick_command = chromium https://calendar.google.com/calendar/r
clock_mclick_command = 
clock_uwheel_command = 
clock_dwheel_command = 

#-------------------------------------
# Battery
battery_tooltip = 1
battery_low_status = 10
battery_low_cmd = notify-send "battery low"
battery_full_cmd = 
bat1_font = Sans Bold 9
battery_font_color = #0a0505 100
bat1_format = 
bat2_format = 
battery_padding = 1 0
battery_background_id = 0
battery_hide = 101
battery_lclick_command = 
battery_rclick_command = 
battery_mclick_command = 
battery_uwheel_command = 
battery_dwheel_command = 
ac_connected_cmd = notify-send "AC Connected"
ac_disconnected_cmd = notify-send "AC Disconnected"

#-------------------------------------
# Executor 1

# KEROSCENE FUEL LEVEL

execp = new
execp_command = /home/user/google_drive/scripts/script_tint2/mqtt_keroscene_fuel_remaining.sh; keroscene_timestamp=$(mosquitto_sub -C 1 -h mqtt.sytes.net -t house/garage/keroscene_tank_TIMESTAMP);printf "keroscene fuel level\n\ntint2 update every hour\nfrom MQTT broker\n\nMQTT broker updates every\n32 mins\n\nlast update $keroscene_timestamp" 1>&2
execp_interval = 3600
execp_has_icon = 1
execp_cache_icon = 0
execp_continuous = 0
execp_markup = 1
execp_lclick_command = gnome-terminal --geometry=136x11+75+75 --tab -e "/bin/bash -c 'printf \"\e]2;fuel tank\a\";echo ""; mosquitto_sub -F \"\e[92m@Y-@m-@d__\e[96m@a__\e[95m@H:@M:@S : \e[96m%t : \e[95m\t\t%p\" -h mqtt.sytes.net -t \"#\" -v | grep \"house/garage/keroscene\"; exec /bin/bash -i'"

execp_rclick_command = 
execp_mclick_command = 
execp_uwheel_command = 
execp_dwheel_command = 
execp_font = Cantarell Bold 12
execp_font_color = #000000 100
execp_padding = 0 0
execp_background_id = 0
execp_centered = 0
execp_icon_w = 18
execp_icon_h = 18

#-------------------------------------
# Executor 2

# BOILER PRESSURE

execp = new
execp_command = /home/user/google_drive/scripts/script_tint2/mqtt_boiler_pressure.sh; boiler_timestamp=$(mosquitto_sub -C 1 -h mqtt.sytes.net -t house/garage/boiler/water_pressure_TIMESTAMP); printf "house boiler pressure\n\ntint2 update every 2 mins\nfrom MQTT broker\n\nMQTT broker updates every\n2 mins\n\nlast update $boiler_timestamp\n\n                                >= 1.15 bar  (green)\n       1.05 bar  >  &  <    1.15 bar  (yellow)\n<= 1.05 bar                                  (red)" 1>&2
#
#printf "house boiler pressure\n\ntint2 update every 2 mins\nfrom MQTT broker\n\nMQTT broker updates every\n2 mins\n\nlast update $boiler_timestamp\n\n>= 1.15 bar                       (green)\n< 1.15 bar &  > 1.05 bar   (yellow)\n<= 1.05 bar                       (red)" 1>&2
#                  >= 1.15 bar (green)
#   1.05 bar >  &  <  1.15 bar (yellow)
#<= 1.05 bar                   (red)
#
execp_interval = 120
execp_has_icon = 1
execp_cache_icon = 0
execp_continuous = 0
execp_markup = 1
execp_lclick_command = gnome-terminal --geometry=136x12+75+75  --tab -e "/bin/bash -c 'printf \"\e]2;boiler pressure\a\";echo ""; mosquitto_sub -F \"\e[92m@Y-@m-@d__\e[96m@a__\e[95m@H:@M:@S : \e[96m%t : \e[95m\t\t%p\" -h mqtt.sytes.net -t \"#\" -v | grep \"house/garage/boiler\"; exec /bin/bash -i'"
execp_rclick_command = 
execp_mclick_command = 
execp_uwheel_command = 
execp_dwheel_command = 
execp_font = Cantarell Bold 12
execp_font_color = #000000 100
execp_padding = 0 0
execp_background_id = 0
execp_centered = 0
execp_icon_w = 18
execp_icon_h = 18

#-------------------------------------
# Executor 3

# PRINTER 1 - ON / OFF

execp = new
execp_command = /home/user/google_drive/scripts/script_tint2/mqtt_laser_printer.sh; printer_uptime=$(snmpstatus -c public -v1 mqtt.sytes.net:3332 | grep -oE "Up: [ ,:0-9a-zA-Z]{1,15}" | grep -oE "[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}"); page_count=$(snmpwalk -c public -v1 mqtt.sytes.net:3332 1.3.6.1.2.1.43.10.2.1.4.1.1 | grep -oE ": [0-9]{1,6}" | grep -oE "[0-9]{1,6}$"); printf "printer\n\nupdate every 1 seconds\nfrom MQTT broker\n\nunshaded   (off)\ngreen         (on)\n\nuptime $printer_uptime\n\npage count $page_count" 1>&2


# printer interval
execp_interval = 1
execp_has_icon = 1
execp_cache_icon = 0
execp_continuous = 0
execp_markup = 1
execp_lclick_command = gnome-terminal --geometry=123x6+75+75  --tab -e "/bin/bash -c 'printf \"\e]2;printer\a\"; echo ""; mosquitto_sub -F \"\e[92m@Y-@m-@d__\e[96m@a__\e[95m@H:@M:@S : \e[96m%t : \e[95m\t\t%p\" -h mqtt.sytes.net -t \"#\" -v | grep \"printer\"; exec /bin/bash -i'"
execp_rclick_command = chromium http://192.168.1.240
execp_mclick_command = 
execp_uwheel_command = 
execp_dwheel_command = 
execp_font = Cantarell Bold 12
execp_font_color = #000000 100
execp_padding = 0 0
execp_background_id = 0
execp_centered = 0
execp_icon_w = 18
execp_icon_h = 18

#-------------------------------------
# Executor 4

# PRINTER 2  - STATUS

execp = new
execp_command = /home/user/google_drive/scripts/script_tint2/mqtt_laser_printer_status.sh; printer_uptime=$(snmpstatus -c public -v1 mqtt.sytes.net:3332 | grep -oE "Up: [ ,:0-9a-zA-Z]{1,15}" | grep -oE "[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}"); printf "printer - text status\n\nupdate every 1 seconds\nfrom SNMP device\n\nuptime $printer_uptime" 1>&2

# printer status interval
execp_interval = 1
execp_has_icon = 1
execp_cache_icon = 0
execp_continuous = 0
execp_markup = 1
execp_lclick_command = gnome-terminal --geometry=123x6+75+75  --tab -e "/bin/bash -c 'printf \"\e]2;printer\a\"; echo ""; mosquitto_sub -F \"\e[92m@Y-@m-@d__\e[96m@a__\e[95m@H:@M:@S : \e[96m%t : \e[95m\t\t%p\" -h mqtt.sytes.net -t \"#\" -v | grep \"printer\"; exec /bin/bash -i'"
execp_rclick_command = 
execp_mclick_command = 
execp_uwheel_command = 
execp_dwheel_command = 
execp_font = Cantarell Bold 12
execp_font_color = #000000 100
execp_padding = 0 0
execp_background_id = 0
execp_centered = 0
execp_icon_w = 18
execp_icon_h = 18

#-------------------------------------
# Executor 5

# PRINTER 3 - PAGE COUNT


#execp = new
#execp_command = /home/user/google_drive/scripts/script_tint2/mqtt_laser_printer_page_count.sh; page_count=$(snmpwalk -c public -v1 mqtt.sytes.net:3332 1.3.6.1.2.1.43.10.2.1.4.1.1 | grep -oE ": [0-9]{1,6}" | grep -oE "[0-9]{1,6}$");printf "printer - page count\n\nupdate every 1 seconds\nfrom SNMP device\n\npage count $page_count" 1>&2
# printer page count interval
#execp_interval = 1
#execp_has_icon = 1
#execp_cache_icon = 0
#execp_continuous = 0
#execp_markup = 1
#execp_lclick_command = gnome-terminal --geometry=123x6+75+75  --tab -e "/bin/bash -c 'printf \"\e]2;printer\a\"; echo ""; mosquitto_sub -F \"\e[92m@Y-@m-@d__\e[96m@a__\e[95m@H:@M:@S : \e[96m%t : \e[95m\t\t%p\" -h mqtt.sytes.net -t \"#\" -v | grep \"printer\"; exec /bin/bash -i'"
#execp_rclick_command = 
#execp_mclick_command = 
#execp_uwheel_command = 
#execp_dwheel_command = 
#execp_font = Cantarell Bold 10
#execp_font_color = #000000 100
#execp_padding = 0 0
#execp_background_id = 0
#execp_centered = 0
#execp_icon_w = 18
#execp_icon_h = 18

#-------------------------------------
# Executor 6

# DAWN

execp = new
execp_command = /home/user/google_drive/scripts/script_tint2/mqtt_dawn.sh; printf 'dawn\n\nupdates every hour\nfrom MQTT broker' 1>&2
execp_interval = 3600
execp_has_icon = 1
execp_cache_icon = 0
execp_continuous = 0
execp_markup = 1
execp_lclick_command = gnome-terminal --geometry=108x10+75+75  --tab -e "/bin/bash -c 'printf \"\e]2;dawn and dusk\a\";echo ""; mosquitto_sub -F \"\e[92m@Y-@m-@d__\e[96m@a__\e[95m@H:@M:@S : \e[96m%t : \e[95m\t\t%p\" -h mqtt.sytes.net -t \"#\" -v | grep \"time_events\"; exec /bin/bash -i'"
execp_rclick_command = 
execp_mclick_command = 
execp_uwheel_command = 
execp_dwheel_command = 
execp_font = Cantarell Bold 12
execp_font_color = #000000 100
execp_padding = 0 0
execp_background_id = 0
execp_centered = 0
execp_icon_w = 18
execp_icon_h = 18

#-------------------------------------
# Executor 7

# DUSK

execp = new
execp_command = /home/user/google_drive/scripts/script_tint2/mqtt_dusk.sh; printf 'dusk\n\nupdates every hour\nfrom MQTT broker' 1>&2
execp_interval = 3600
execp_has_icon = 1
execp_cache_icon = 0
execp_continuous = 0
execp_markup = 1
execp_lclick_command = gnome-terminal --geometry=108x10+75+75  --tab -e "/bin/bash -c 'printf \"\e]2;dawn and dusk\a\";echo ""; mosquitto_sub -F \"\e[92m@Y-@m-@d__\e[96m@a__\e[95m@H:@M:@S : \e[96m%t : \e[95m\t\t%p\" -h mqtt.sytes.net -t \"#\" -v | grep \"time_events\"; exec /bin/bash -i'"
execp_rclick_command = 
execp_mclick_command = 
execp_uwheel_command = 
execp_dwheel_command = 
execp_font = Cantarell Bold 12
execp_font_color = #000000 100
execp_padding = 0 0
execp_background_id = 0
execp_centered = 0
execp_icon_w = 18
execp_icon_h = 18

#-------------------------------------
# Executor 8

# WEATHER

execp = new
execp_command = weather=$(wget -qO- "http://api.openweathermap.org/data/2.5/weather?id=2657832&appid=751682a29f1ffea716e7894c660f31c5&units=metric"); echo $(echo $weather | jq -r '.weather[0] .description') $(echo $weather | jq -r '.main.temp' | grep -oE "^[0-9]{1,2}")˚C; printf "weather\n\nupdates every hour\nfrom openweathermap.org\n\nlast update                  $(date +"%d-%m-%Y  %H-%M:%S")\nlocation                        $(echo $weather | jq -r '.name')\ndescription                   $(echo $weather | jq -r '.weather[0] .description')\npressure (bar)              $(echo $weather | jq -r .main.pressure)\nhumidity                       $(echo $weather | jq -r .main.humidity)%%\nwind speed (m/s)         $(echo $weather | jq -r .wind.speed)\nwind direction (deg)     $(echo $weather | jq -r .wind.deg)\n\nAberdeen weather\no left click       for openweathermap.org/Aberdeen\no right click     for met office/Aberdeen\no middle click for MWIS EH" 1>&2
execp_interval = 3600
execp_has_icon = 0
execp_cache_icon = 0
execp_continuous = 0
execp_markup = 1
execp_lclick_command = chromium https://openweathermap.org/city/2657832
execp_rclick_command = chromium https://www.metoffice.gov.uk/weather/forecast/gfnt07u1s
execp_mclick_command = /home/user/google_drive/scripts/script_WEATHER-REPORTS-MOUNTAIN-MWIS/MWIS_Weather_pdf.sh
execp_uwheel_command = 
execp_dwheel_command = 
execp_font = Cantarell Bold 12
execp_font_color = #000000 100
execp_padding = 0 0
execp_background_id = 0
execp_centered = 0
execp_icon_w = 18
execp_icon_h = 18

#-------------------------------------
# Executor 9

# HALL TEMPERATURE

execp = new
execp_command = hall_temp=$(mosquitto_sub -C 1 -h mqtt.sytes.net -t house/groundfloor/hall/temperature_DS18B20); above_hall_temp=$(mosquitto_sub -C 1 -h mqtt.sytes.net -t house/loft/above_hall_cupboard/temperature_DS18B20); cupboard_temp=$(mosquitto_sub -C 1 -h mqtt.sytes.net -t house/groundfloor/hall_cupboard/temperature_DS18B20); temp_time_stamp=$(mosquitto_sub -C 1 -h mqtt.sytes.net -t house/temperature_DS18B20/TIMESTAMP); printf "hall $(echo $hall_temp | grep -oE "[0-9]{2}.[0-9]{1}") ˚C"; printf "hall temp\n\ntint2 update every 5 mins\nfrom MQTT broker\n\nMQTT broker updates every\n30 mins\n\nlast MQTT broker update\n$temp_time_stamp\n\nabove hall temp      $above_hall_temp ˚C\ncupboard temp        $cupboard_temp ˚C" 1>&2


#execp_command = bash -c 'hall_temp=$(mosquitto_sub -C 1 -h mqtt.sytes.net -t house/groundfloor/hall/temperature_DS18B20); \
#above_hall_temp=$(mosquitto_sub -C 1 -h mqtt.sytes.net -t house/loft/above_hall_cupboard/temperature_DS18B20); cupboard_temp=$(mosquitto_sub -C 1 -h mqtt.sytes.net -t house/groundfloor/#hall_cupboard/temperature_DS18B20); printf "hall $(echo $hall_temp | grep -oE "[0-9]{2}.[0-9]{1}") ˚C"; printf "hall temp\n\ntint2 update every 5 mins\nfrom MQTT broker\n\nMQTT broker updates #every\n30 mins\n\nlast MQTT broker update\n$(mosquitto_sub -C 1 -h mqtt.sytes.net -t house/temperature_DS18B20/TIMESTAMP)\n\nabove hall temp      $above_hall_temp ˚C\ncupboard temp        #$cupboard_temp ˚C" 1>&2'


execp_interval = 300
execp_has_icon = 0
execp_cache_icon = 0
execp_continuous = 0
execp_markup = 1
execp_lclick_command = gnome-terminal --geometry=109x7+75+75  --tab -e "/bin/bash -c 'printf \"\e]2;house temperatures\a\"; echo ""; mosquitto_sub -F \"\e[92m@Y-@m-@d__\e[96m@a__\e[95m@H:@M:@S : \e[96m%t : \e[95m\t\t%p\" -h mqtt.sytes.net -t \"#\" -v | grep \"temperature\"; exec /bin/bash -i'"
execp_rclick_command = 
execp_mclick_command = 
execp_uwheel_command = 
execp_dwheel_command = 
execp_font = Cantarell Bold 12
execp_font_color = #000000 100
execp_padding = 0 0
execp_background_id = 0
execp_centered = 0
execp_icon_w = 18
execp_icon_h = 18


#-------------------------------------
# Executor 10

# BATTERY CHARGE ICON

execp = new
execp_command = /home/user/google_drive/scripts/script_tint2/battery-icon.sh; charge_status=$(acpi | grep -o 'Charging\|Discharging' | tr '[:upper:]' '[:lower:]'); batt_z=$(acpi | grep -m 1 -oE "[0-9]{1,3}%" | grep -oE "[0-9]{1,3}"); time_until_charged=$(acpi | grep -oE "[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} until charged" | grep -oE "[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}"); max_battery_charge=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep "capacity" | grep -oE "[0-9]{1,3}.[0-9]{1,5}%" | grep -oE ^"[0-9]{1,3}"); charge_remaining=$(acpi -b | grep -oE "[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} remaining" | grep -oE "[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}"); power_connected=$(if [[ "$(cat /sys/class/power_supply/AC/online)" = "1" ]]; then echo "connected"; else echo "disconnected"; fi); printf "power       $power_connected\n\ncharge status       $charge_status\n\ncharge is              $batt_z %%\n\ntime\nuntil charged        $time_until_charged\n\ncharge remaining      $charge_remaining\n\nmax battery\ncharge possible     $max_battery_charge %%" 1>&2

#/home/user/google_drive/scripts/script_tint2/show_battery_status.sh

execp_interval = 300
execp_has_icon = 1
execp_cache_icon = 0
execp_continuous = 1
execp_markup = 1
execp_lclick_command = gnome-terminal --geometry=90x30+75+75  --tab -e "/bin/bash -c 'upower -i /org/freedesktop/UPower/devices/battery_BAT0;exec /bin/bash -i'"
execp_rclick_command = 
execp_mclick_command = 
execp_uwheel_command = 
execp_dwheel_command = 
execp_font = Cantarell Bold 12
execp_font_color = #000000 100
execp_padding = 0 0
execp_background_id = 0
execp_centered = 0
execp_icon_w = 18
execp_icon_h = 18

#-------------------------------------

# Executor 11

# BATTERY CHARGE %

execp = new
execp_command = echo $(acpi | grep -m 1 -oE "[0-9]{1,3}%" | grep -oE "[0-9]{1,3}") %;charge_status=$(acpi | grep -o 'Charging\|discharging' | tr '[:upper:]' '[:lower:]'); batt_z=$(acpi | grep -m 1 -oE "[0-9]{1,3}%" | grep -oE "[0-9]{1,3}"); time_until_charged=$(acpi | grep -oE "[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} until charged" | grep -oE "[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}"); max_battery_charge=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep "capacity" | grep -oE "[0-9]{1,3}.[0-9]{1,5}%" | grep -oE ^"[0-9]{1,3}"); charge_remaining=$(acpi -b | grep -oE "[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} remaining" | grep -oE "[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}"); power_connected=$(if [[ "$(cat /sys/class/power_supply/AC/online)" = "1" ]]; then echo "connected"; else echo "disconnected"; fi); printf "power       $power_connected\n\ncharge status       $charge_status\n\ncharge is              $batt_z %%\n\ntime\nuntil charged        $time_until_charged\n\ncharge remaining      $charge_remaining\n\nmax battery\ncharge possible     $max_battery_charge %%" 1>&2

execp_interval = 120
execp_has_icon = 0
execp_cache_icon = 0
execp_continuous = 0
execp_markup = 1
execp_lclick_command = gnome-terminal --geometry=90x30+75+75  --tab -e "/bin/bash -c 'upower -i /org/freedesktop/UPower/devices/battery_BAT0;exec /bin/bash -i'"
execp_rclick_command = 
execp_mclick_command = 
execp_uwheel_command = 
execp_dwheel_command = 
execp_font = Cantarell Bold 12
execp_font_color = #000000 100
execp_padding = 0 0
execp_background_id = 0
execp_centered = 0
execp_icon_w = 18
execp_icon_h = 18

#-------------------------------------


# Executor 12

# IS POWER CONNECTED ?

execp = new
execp_command = echo $(if [[ "$(cat /sys/class/power_supply/AC/online)" = "1" ]]; then echo "C"; else echo "D"; fi); printf "power     $(if [[ "$(cat /sys/class/power_supply/AC/online)" = "1" ]]; then echo "connected"; else echo "disconnected"; fi)" 1>&2

execp_interval = 10
execp_has_icon = 0
execp_cache_icon = 0
execp_continuous = 0
execp_markup = 1
execp_lclick_command = gnome-terminal --geometry=90x30+75+75  --tab -e "/bin/bash -c 'upower -i /org/freedesktop/UPower/devices/battery_BAT0;exec /bin/bash -i'"
execp_rclick_command = 
execp_mclick_command = 
execp_uwheel_command = 
execp_dwheel_command = 
execp_font = Cantarell Bold 12
execp_font_color = #000000 100
execp_padding = 0 0
execp_background_id = 0
execp_centered = 0
execp_icon_w = 18
execp_icon_h = 18

#-------------------------------------

# Tooltip
tooltip_show_timeout = 0
tooltip_hide_timeout = 0
tooltip_padding = 5 10
tooltip_background_id = 0
tooltip_font_color = #eeeeee 100
Last edited by kes__ on Fri Jun 05, 2020 3:57 pm, edited 15 times in total.

Post Reply

Return to “OpenBox”