colinkeenan / silentcast

Create silent mkv screencast and animated gif.
GNU General Public License v3.0
512 stars 22 forks source link

Added a python based indicator for Unity #3

Closed Seth-Johnson closed 9 years ago

Seth-Johnson commented 9 years ago

Yad notifcations don't work with Unity, due to its strict managment of indicators. I know you can use systray-trusty to enable indicator whitelisting, but this is another step for the user and means installing a non official upgrade to Unity. To me this is not renewable in the long run. I am not entirely sure how doing this will affect upgrading when newer versions of Unity come out but my gut tells me it won't be good.

Either way, I didn't want to go that route so I wrote this small indicator in python + Gtk and amended genffcom to use it in place of yad when Unity was detected. I have been using this on my build pretty much since I installed silentcast and it has proven stable enough.

If you would prefer having people go the systray-trusty route that's fine, but I figured I would at least show you.

colinkeenan commented 9 years ago

Thanks for this. I just took a quick look at it and it does seem like a simple and good idea. At first I thought you had replaced yad completely, but all you've done is replace yad for the one thing that doesn't work in Unity. So, it's just a short python script. I will look at it some more tomorrow and may use it as is or just make some minor changes.

How does Unity decide what's allowed in the system tray notifications? Why does your script work while yad and almost everything else doesn't?

On Fri, Sep 26, 2014 at 9:50 PM, Seth-Johnson notifications@github.com wrote:

Yad notifcations don't work with Unity, due to its strict managment of indicators. I know you can use systray-trusty to enable indicator whitelisting, but this is another step for the user and means installing a non official upgrade to Unity. To me this is not renewable in the long run. I am not entirely sure how doing this will affect upgrading when newer versions of Unity come out but my gut tells me it won't be good http://ubuntuforums.org/showthread.php?t=2217458&page=3&p=13130008#post13130008.

Either way, I didn't want to go that route so I wrote this small indicator in python + Gtk and amended genffcom to use it in place of yad when Unity was detected. I have been using this on my build pretty much since I installed silentcast and it has proven stable enough.

If you would prefer having people go the systray-trusty route that's fine,

but I figured I would at least show you.

You can merge this Pull Request by running

git pull https://github.com/Seth-Johnson/silentcast master

Or view, comment on, or merge it at:

https://github.com/colinkeenan/silentcast/pull/3 Commit Summary

  • Added an indicator for unity since yad doesn't work.
  • small typo

File Changes

Patch Links:

— Reply to this email directly or view it on GitHub https://github.com/colinkeenan/silentcast/pull/3.

Seth-Johnson commented 9 years ago

Unity only like indicators that use appindicator, which I don't think yad does (I'd have to look at the source). It does sorta support the old type, but they have to be whitelisted and currently the only way to do that is modify the source and recompile (which is what systray-trusty) does. It's kind of a stinky situation, I know.

Can I ask why you changed the icon to use relative paths? I don't really care, although it seems more complicated to me. Do you just prefer it that way or is there some other reason that I should know?

colinkeenan commented 9 years ago

The reason for relative paths is that I'm trying to take into account two possible situations:

In either case, they will also have to edit genffcom to set the py_script_dir variable I added. In the future, I might have a configuration file or something. But, this is just one variable that has to be edited and anyone doing stuff like this will figure it out.

colinkeenan commented 9 years ago

Do you like my new stop icons? I needed a way to distinguish between different instances of Silentcast running. You will need my latest push to see it.

colinkeenan commented 9 years ago

Also, I'm actually using the full path in unity_indicator.py. From https://docs.python.org/2/library/os.path.html

os.path.realpath(path)
    Return the canonical path of the specified filename, eliminating any symbolic links encountered in the path (if they are supported by the operating system).
Seth-Johnson commented 9 years ago

Ah, I hadn't thought of that. Sounds good.

The new icons look nice, although having a 1 in it when I'm only running one instance could potentially be confusing (no deal breaker though). Thanks for the realpath link.

colinkeenan commented 9 years ago

Late last night I made it so that anyone can run silentcast just by extracting it and double clicking on bash_silentcast.desktop (assuming they've installed the dependencies). They don't have to install it or edit any files, but the launcher won't be in their menus or findable by their system until they properly install it. Today, I made some corrections to the README concerning installing in Arch.

These changes don't necessarily affect you, but thought you should know about them.

colinkeenan commented 9 years ago

I thought about putting up a plain icon if only one was running, but then it would have to change when a second one started. Or, I could use something else besides numbers to distinguish them, but I can't think of anything obvious. Having one plain one and one that had a 2 in it doesn't seem right either. So, for simplicity, it's either 1, 2, or something other than numbers that would not be confusing when only 1 instance is running.

colinkeenan commented 9 years ago

Oh, and another change I made was so that if you try the run the python scripts outside of silentcast, instead of just crashing, they tell you what required arg is missing and if you run them again with -h they give help explaining what that arg is for.

Seth-Johnson commented 9 years ago

It's looking good. One thing though. I am attempting to package Silentcast for Ubuntu (at least a .deb file for easier installation), but to do it the proper way I need version numbers, it doesn't seem like you have any anywhere (besides PKGBUILD, which got removed from git).

How would you prefer I do this? Make up numbers, or you could add a number somewhere, or something else?

colinkeenan commented 9 years ago

So, did you see my push from today? I've been releasing versions on git and including version numbers in the silentcast bash script. So, if you type silentcast -v in a terminal, it will give you the version number. Also, if you look in the title bar of the first window, it will show the version number. I released v1.7 today which includes new icons and the ability to specify a working directory.

On Thursday, October 2, 2014, Seth-Johnson notifications@github.com wrote:

It's looking good. One thing though. I am attempting to package Silentcast for Ubuntu (at least a .deb file for easier installation), but to do it the proper way I need version numbers, it doesn't seem like you have any anywhere (besides PKGBUILD, which got removed from git).

How would you prefer I do this? Make up numbers, or you could add a number somewhere, or something else?

— Reply to this email directly or view it on GitHub https://github.com/colinkeenan/silentcast/pull/3#issuecomment-57690498.

colinkeenan commented 9 years ago

Also, for the packaging I'm doing for Arch (the PKGBUILD), I've starting pointing it to the relevant release instead of the master branch. So, It's like this:

source=("https://github.com/colinkeenan/silentcast/archive/v1.7.tar.gz")

On Thursday, October 2, 2014, Colin Keenan colinnkeenan@gmail.com wrote:

So, did you see my push from today? I've been releasing versions on git and including version numbers in the silentcast bash script. So, if you type silentcast -v in a terminal, it will give you the version number. Also, if you look in the title bar of the first window, it will show the version number. I released v1.7 today which includes new icons and the ability to specify a working directory.

On Thursday, October 2, 2014, Seth-Johnson <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

It's looking good. One thing though. I am attempting to package Silentcast for Ubuntu (at least a .deb file for easier installation), but to do it the proper way I need version numbers, it doesn't seem like you have any anywhere (besides PKGBUILD, which got removed from git).

How would you prefer I do this? Make up numbers, or you could add a number somewhere, or something else?

— Reply to this email directly or view it on GitHub https://github.com/colinkeenan/silentcast/pull/3#issuecomment-57690498.

Seth-Johnson commented 9 years ago

Oh, my bad. I had checked the silentcast bash script, but I either did it before the version numbers or missed them somehow. Again, sorry, my bad. Thanks!

colinkeenan commented 9 years ago

I just changed it to:

source=("https://github.com/colinkeenan/silentcast/archive/v

"$pkgver".tar.gz")

which is what I thought I was doing until I pasted it into my last email to you and realized I forgot to use the $pkgver variable defined in PKGBUILD.

On Thursday, October 2, 2014, Colin Keenan colinnkeenan@gmail.com wrote:

Also, for the packaging I'm doing for Arch (the PKGBUILD), I've starting pointing it to the relevant release instead of the master branch. So, It's like this:

source=("https://github.com/colinkeenan/silentcast/archive/v1.7.tar.gz")

On Thursday, October 2, 2014, Colin Keenan <colinnkeenan@gmail.com javascript:_e(%7B%7D,'cvml','colinnkeenan@gmail.com');> wrote:

So, did you see my push from today? I've been releasing versions on git and including version numbers in the silentcast bash script. So, if you type silentcast -v in a terminal, it will give you the version number. Also, if you look in the title bar of the first window, it will show the version number. I released v1.7 today which includes new icons and the ability to specify a working directory.

On Thursday, October 2, 2014, Seth-Johnson notifications@github.com wrote:

It's looking good. One thing though. I am attempting to package Silentcast for Ubuntu (at least a .deb file for easier installation), but to do it the proper way I need version numbers, it doesn't seem like you have any anywhere (besides PKGBUILD, which got removed from git).

How would you prefer I do this? Make up numbers, or you could add a number somewhere, or something else?

— Reply to this email directly or view it on GitHub https://github.com/colinkeenan/silentcast/pull/3#issuecomment-57690498 .

Seth-Johnson commented 9 years ago

Oh, and now I see the release tab at the top.. I'm really feeling stupid right now :stuck_out_tongue_winking_eye: