Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Icon reload #36

Open
aoe-mak opened this issue Apr 23, 2018 · 7 comments
Open

Feature request: Icon reload #36

aoe-mak opened this issue Apr 23, 2018 · 7 comments

Comments

@aoe-mak
Copy link

@aoe-mak aoe-mak commented Apr 23, 2018

Hey,

it would be nice if kdocker is able to reload or load another icon while running.

I want to use it for Thunderbird and a mail check via a plugin which can run a command.
Unfortunately other plugins for these purposes (with icon change) are not supported anymore.
I was hoping to fix that with kdocker.

Cheers

@Druco

This comment has been minimized.

Copy link
Contributor

@Druco Druco commented Sep 20, 2018

This would be a great addition given the latest Thunderbird update.

@xdenyer

This comment has been minimized.

Copy link

@xdenyer xdenyer commented Oct 29, 2018

I'm also using KDocker to tray Thunderbird, plus this hacky script with https://addons.thunderbird.net/en-US/thunderbird/addon/mailbox-alert/ to create an icon on new mail;

#!/bin/bash
if ! pgrep -f yad.*mail-mark-unread.*thunderbird &> /dev/null 2>&1; then
yad --notification --image="mail-mark-unread" --listen --command="sh -c 'thunderbird ; pkill -f yad.*mail-mark-unread.*thunderbird'" &
fi

Yad would probably also do what you're wanting, it's pretty flexible.

@dmarkdvt

This comment has been minimized.

Copy link

@dmarkdvt dmarkdvt commented Dec 4, 2019

Can not test the alternative because https://addons.thunderbird.net/en-US/thunderbird/addon/mailbox-alert/ is not compatible with Thunderbird 68.

@dmarkdvt

This comment has been minimized.

Copy link

@dmarkdvt dmarkdvt commented Dec 4, 2019

Currently running Kdocker with the suggestion from @xdenyer.

#!/bin/bash

if pidof thunderbird >/dev/null
then
	# if an instance with kdocker is already open use the open instance
	# thunderbird does internal magic to find a running instance)
	/usr/bin/thunderbird $@
else
	# no thunderbird with kdocker is running so open it
	/usr/bin/kdocker -i ./thunderbird.png -m -q /usr/bin/thunderbird $@
fi

This solution is not working well. Take the one in two posts below: #36 (comment)

#!/bin/bash

# https://bugzilla.mozilla.org/show_bug.cgi?id=1482674
while true
do
	inotifywait -m ~/.thunderbird/PROFILE/Mail/localhost/Inbox.msf -e modify |
	while read output;
	do
	    sleep 1
	    icon_already_exists=$(pgrep -f yad.*mail-mark-unread.*thunderbird)
	    if [ -z "$icon_already_exists" ]
	    then
	        yad --notification --image="mail-mark-unread" --listen --command="sh -c '/usr/local/bin/thunderbird ; pkill -f yad.*mail-mark-unread.*thunderbird'" &
	    fi
	done
done

JFYI: This needs more optimization and is a suggestion for only experienced users.

@xdenyer

This comment has been minimized.

Copy link

@xdenyer xdenyer commented Dec 4, 2019

Ah, you've gone with monitoring the mailbox file directly -- I find I tend to modify mailbox items, and went with monitoring a (silent) sound file that Thunderbird's configured to play on new mail. But glad the approach works for you, inotifywait seems like a really useful tool.

If anyone else wants, now that Thunderbird's broken the alert extension...

https://bugzilla.mozilla.org/show_bug.cgi?id=1482674

#!/bin/sh
inotifywait -m -e access /home/username/.myscripts/watch_silent.wav |
while read output;
do
    sleep 1
    icon_already_exists=$(pgrep -f yad.*mail-mark-unread.*thunderbird)
    if [ -z "$icon_already_exists" ]
    then
        yad --notification --image="mail-mark-unread" --listen --command="sh -c 'thunderbird ; pkill -f yad.*mail-mark-unread.*thunderbird'" &
    fi
done

It'd be nice if the Thunderbird devs hopped off the Gnome bandwagon and better supported normal desktop environments.

And on-topic, being able to update KDocker icons would be useful.

@dmarkdvt

This comment has been minimized.

Copy link

@dmarkdvt dmarkdvt commented Dec 5, 2019

@xdenyer Now I got it. Thx. Your approach is fixing my current problem with an icon popping up even when I delete a mail. But you know it already and solved it quiet funny. Thx for the inspiration.
This is my outcome. This script actually runs really daemon wise or more endless.

#!/bin/bash

# https://bugzilla.mozilla.org/show_bug.cgi?id=1482674
while true
do
	if /usr/bin/inotifywait -qq -e access ./thunderbird.wav
	then
		/usr/bin/yad --notification --image="mail-mark-unread" --command="/bin/sh -c '/usr/local/bin/thunderbird; /usr/bin/pkill -f yad.*mail-mark-unread.*thunderbird >/dev/null 2>&1'"
	fi
done
@xdenyer

This comment has been minimized.

Copy link

@xdenyer xdenyer commented Dec 27, 2019

For info (was googling earlier) the developer has been able to update the Mailbox Alert plugin, which makes it straightforward again to run a script on new mail: https://tjeb.nl/Projects/Mailbox_Alert/

They note; "Open issue: I am aware that the custom Filter action for Mailbox Alert isn't working (due to the removal of XBL bindings), but have yet to discover how the new interfaces work. In recent versions of Thunderbird (>63) it is currently not possible to set the target action for the MailboxAlert Filter."

Tested working with Thunderbird 68.2.2, I'm using the script I was originally;

#!/bin/bash
if ! pgrep -f yad.*mail-mark-unread.*thunderbird &> /dev/null 2>&1; then
	yad --notification --image="mail-mark-unread" --listen --command="sh -c 'thunderbird ; pkill -f yad.*mail-mark-unread.*thunderbird'" &
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.