taffybar / taffybar

A gtk based status bar for tiling window managers such as XMonad
BSD 3-Clause "New" or "Revised" License
696 stars 136 forks source link

Support Ubunutu's new application indicators (appindicators) #109

Closed bcat closed 6 years ago

bcat commented 9 years ago

Increasingly many programs on Ubuntu seem to want to use appindicators (https://unity.ubuntu.com/projects/appindicators/) instead of tray icons. It'd be sweet in Taffybar supported appindicators, either in the existing tray widget or in the new indicator widget. Consider this a feature request. :) I wish I had the time and Haskell know-how to implement it myself.... Perhaps one day I will....

colonelpanic8 commented 6 years ago

@bcat Yeah this would be pretty awesome. Were you ever able to find any resources on how to implement this sort of thing?

colonelpanic8 commented 6 years ago

I have a very rudimentary version of this working (but very badly) at https://github.com/IvanMalison/taffybar/tree/statusNotifierItemTray

if anyone wants to try it.

You'll need to install with stack because you need custom versions of haskell-dbus and a new package that lives here. https://github.com/IvanMalison/status-notifier-item

That package also builds a process, status-notifier-watcher, which you will need to run separately from taffybar. You can then run another command xembedsniproxy (lives at https://github.com/KDE/plasma-workspace/tree/master/xembed-sni-proxy) so that even legacy tray icons will be available!

A decent amount of work remains, but this approach should solve most of our tray issues including

219 #177 #162 , and it will make taffybar support a whole new class of indicators!

I'd love to get some help testing this, but I realize that its a lot of work at the moment.

colonelpanic8 commented 6 years ago

I've gotten a basic haskell sni tray working here: https://github.com/IvanMalison/gtk-sni-tray, but because it depends on libdbusmenu bindings, it had to be written using gi-gtk instead of gtk2hs. I'm trying to figure out how to get the two libraries to interact so that the widget that that libarary offers can be used in taffybar but I haven't had any luck yet.

colonelpanic8 commented 6 years ago

Here is a minimal taffybar featuring sni tray support: https://github.com/IvanMalison/taffybar-sni-example

@kpbochenek Does this tray work any better for you?

kpbochenek commented 6 years ago

@IvanMalison Tried stack install .

Preprocessing executable 'taffybar-sni' for taffybar-sni-0.1.0.0..
Building executable 'taffybar-sni' for taffybar-sni-0.1.0.0..
[1 of 1] Compiling Main             ( taffybar.hs, .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/taffybar-sni/taffybar-sni-tmp/Main.o )

/home/kpbochenek/haskell_packages/taffybar-sni-example/taffybar.hs:3:1: error:
    Could not find module ‘Data.GI.Base.ManagedPtr’
    Use -v to see a list of the files searched for.
  |          
3 | import           Data.GI.Base.ManagedPtr
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Completed 9 action(s).

--  While building custom Setup.hs for package taffybar-sni-0.1.0.0 using:
      /home/kpbochenek/.stack/setup-exe-cache/x86_64-linux-tinfo6-nopie/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0 build exe:taffybar-sni --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
kpbochenek commented 6 years ago

Needed to install in system: dbusmenu-gtk3 Needed to add to , haskell-gi-base to taffybar-sni.cabal Then after finally starting:

MethodError {methodErrorName = ErrorName "org.freedesktop.DBus.Error.ServiceUnknown", methodErrorSerial = Serial 6, methodErrorSender = Just (BusName "org.freedesktop.DBus"), methodErrorDestination = Just (BusName ":1.130"), methodErrorBody = [Variant "The name org.kde.StatusNotifierWatcher was not provided by any .service files"]}
Shutting down StatusNotifierHost
colonelpanic8 commented 6 years ago

@kpbochenek Right I forgot to mention that you need to run status-notifier-watcher from https://github.com/IvanMalison/status-notifier-item

I might decided to integrate the watcher into the host eventually, but the spec for SNI stipulates that they shoudl be separate.

kpbochenek commented 6 years ago

@IvanMalison

stack install .

Building library for status-notifier-item-0.1.0.0..
[ 1 of 12] Compiling Paths_status_notifier_item ( .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/autogen/Paths_status_notifier_item.hs, .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/Paths_status_notifier_item.o )
[ 2 of 12] Compiling StatusNotifier.Util ( src/StatusNotifier/Util.hs, .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/StatusNotifier/Util.o )
[ 3 of 12] Compiling StatusNotifier.Menu.Constants ( src/StatusNotifier/Menu/Constants.hs, .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/StatusNotifier/Menu/Constants.o )
[ 4 of 12] Compiling StatusNotifier.Menu.Client ( src/StatusNotifier/Menu/Client.hs, .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/StatusNotifier/Menu/Client.o )
[ 5 of 12] Compiling StatusNotifier.Menu.Service ( src/StatusNotifier/Menu/Service.hs, .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/StatusNotifier/Menu/Service.o )
[ 6 of 12] Compiling StatusNotifier.Item.Constants ( src/StatusNotifier/Item/Constants.hs, .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-2.0.1.0/build/StatusNotifier/Item/Constants.o )

/home/kpbochenek/haskell_packages/status-notifier-item/src/StatusNotifier/Item/Constants.hs:26:5: error:
    Not in scope: ‘genTakeSignalErrorHandler’
   |           
26 |   { genTakeSignalErrorHandler = True }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^

Completed 39 action(s).
colonelpanic8 commented 6 years ago

It looks like the version of haskell-dbus linked there is too old. Pushed an update that has a newer version

kpbochenek commented 6 years ago

Still same error, can we try adding travis to see if it builds on independant machine?

colonelpanic8 commented 6 years ago

Sure.