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

Add badge to os icon and profilist icon per profile #18

Open
Noitidart opened this issue Jun 3, 2014 · 18 comments
Open

Add badge to os icon and profilist icon per profile #18

Noitidart opened this issue Jun 3, 2014 · 18 comments
Assignees
Milestone

Comments

@Noitidart
Copy link
Owner

Credits to evacchi for the beautiful idea: evacchi/firefox-custom-badge#1

profilist badging mockup

@Noitidart Noitidart self-assigned this Jun 3, 2014
@Noitidart
Copy link
Owner Author

WinXP

Last Updated June 22, 2014
Progress 83%
  • Badge overlays activity icon in toolbarbutton of Profilist menu
  • Toolbarbutton activity icon is filled black if profile is running, if it is not it is just a thick outline
  • Badge in Alt + Tab menu
  • Badge on icon of all popup windows
  • Badge on icons in taskbar
  • Windows of each profile should group into their own separate group on taskbar
    • Appropriate badge on group icon

@Noitidart
Copy link
Owner Author

Win7

Last Updated Jan 30, 2015
Progress 100%
  • Badge overlays activity icon in toolbarbutton of Profilist menu
  • Toolbarbutton activity icon is filled black if profile is running, if it is not it is just a thick outline
  • Badge in Alt + Tab menu
  • Badge on icon of all popup windows
  • Badge on icons in taskbar
  • Windows of each profile should group into their own separate group on taskbar
  • Appropriate badge on group icon
    • When unpinned
    • When pinned
  • If pin a launched profile, it should re-launch that profile next time

@Noitidart
Copy link
Owner Author

Notes on setting icon in Mac:

notes from irc:
becuase of RedrawIcon: http://mxr.mozilla.org/mozilla-release/source/widget/cocoa/nsMacDockSupport.mm#156

mstange well, the code there doesn't make it easy
12:01 mstange if you just overwrite the dock icon with your own one, your replacement is going to be overwritten as soon as nsMacDockSupport::RedrawIcon() is called again
12:01 noida yea
12:02 noida and it does that on downloads or something
12:02 noida so i have to replace the icon that RedrawIcon uses
12:02 noida like nightly uses the nightly background
12:02 noida aurora uses aurora
12:02 noida so when RedrawIcon calls it will use my modified icon as bg
12:03 mstange how did you do that?
12:03 noida didnt yet just brainstorming
12:03 mstange ah ok
12:03 mstange but I don't see how you can get access to mAppIcon or mProgressBackground
12:04 noida oh shoot thx for that note, thx for brainstorming with me
12:04 mstange I suppose you could swizzle -[NSApplication setApplicationIconImage:]
12:04 noida hahaha
12:04 noida swizzle means hijak?
12:05 mstange yes, but this method is actually called swizzling
12:05 mstange see for example http://dxr.mozilla.org/mozilla-central/source/widget/cocoa/nsAppShell.mm#301

noida no problem thx man for the help. btw do you know what it means to " swizzle -[NSApplication setApplicationIconImage:]"
12:08 Yoric I mean, a ChromeWorker can't call into xpcom.
12:08 Yoric Sorry about that.
12:08 Yoric It's a funky Objective C function call
12:08 noida o ok thx!
12:08 noida haha
12:09 Yoric If I recall correctly, [NSApplication setApplicationIconImage:] calls method setApplicationIconImage of NSApplication, without arguments.
12:09 Yoric (well, it's called a message in objective C, instead of a method call, but it's the same
thing)

Noitidart added a commit that referenced this issue Feb 24, 2015
### bootstrap.js
* setup badging (for profilist menu items, not on OS icon yet) (Address
Issue #18)
* Profilist.badge is written to ini and dom is updated based on it
* fixed some [i] errors on ppRemoved and ppAdded
* also some ppRemoved and ppAdded were at ppChanged which was a bug

### main.css
* styling for when click on badge to change it
@Noitidart
Copy link
Owner Author

Mac

Last Updated Mar 1, 2015
Progress 90%

Remaining

  • Update desktop shortcut on profile rename or badge or build tie change
  • Update dock icon programtically to on rename/badge/build tie change
  • Double dock icon on restart issue while "kept in dock"
  • OS X 10.6 IconFamily to ICNS conversion

@Noitidart
Copy link
Owner Author

Linux

Last Updated Apr 17, 2015
Progress 67%
  • Icon creation and install as recognized icon
  • Icon application
  • Create launchers
  • Symlink to launchers on desktop
  • Figure out a way to update icons while its running on Ubuntu (seeming not possible right now)
  • Ubuntu

Check out Bugzilla :: Bug 595462 - patch v1, load window icons from everywhere/from all supported formats which uses GDK to change icons. From Bugzilla :: Bug 595462 - Support loading window icons from zips, thanks to @nmaier telling me about it here: GitHubGIST :: Noitidart / _ff-addon-snippet-ChangeWindowIcon.js - Comment 4

Noitidart added a commit that referenced this issue Mar 22, 2015
* Addressing issue #18
* On startup now applying the proper icon (if not pinned there is a
couple seconds of lag for the icon to kick in as startup of browser
takes place)
* Previous rev implemented applying icon from badge selection process
(by clicking on activity icon in Profilist menu) but it did not set it
on the right profile, it would set on current profile, still working on
targetting profile thats running but not itself
Noitidart added a commit that referenced this issue Mar 25, 2015
* Working on making icon change affect right profile in WINNT for Issue
#18
* Right profile is getting targeted but something is up with
jscGetDeepest when it writes to file it its weird
Noitidart added a commit that referenced this issue Mar 26, 2015
* More work for Issue #18 for Windows
* It works on setting icon foreign pid
* Added test for if WinXP and it it does LoadImage properly
* Need to make it not update profile if Profilist is not installed on it
though
* Need to give the pinned icon change support for Win7+
Noitidart added a commit that referenced this issue Mar 28, 2015
* Continuing on issues for #18 on WINNT
* SystemAppUserModelId on shortcuts now works, i found out that if it
already exists you cannot update it, it will throw access denied. so
that id can only be set if it the file doesnt exist
Noitidart added a commit that referenced this issue May 23, 2015
Now updating pinned shortcuts for Win7+ for Issue #18
@Noitidart Noitidart modified the milestones: v2.0, v1.3 May 23, 2015
Noitidart added a commit that referenced this issue May 26, 2015
Commits 1.2.rev175-177 focused on landing desktop shortcut creation
(with proper icon) for Windows but they were just commits to save. This
one lands it, tested it a little, should test more. So related to Issue
#18.
Noitidart added a commit that referenced this issue May 27, 2015
For Issue #18 for WINNT made sure to set RelaunchIcon Resource Command
after picker set. Change so getPtrStrToWinOfProf now takes 3rd argument
of visWin and it only collects window is visible. I think this is
feesbile because im assuming overhead to check style of window is
minimal compared to getting all windows and doing IPropertyStore on each
and even just setting icon on each window (there are like 5 non-vis win
for each vis win, so thats 5 extra bogus overhead)
@evacchi
Copy link

evacchi commented Sep 28, 2015

Any way I can play with this? I see a 2.0 branch, but I don't know how to package properly :)

@Noitidart
Copy link
Owner Author

Hey @evacchi sorry about that I got hung up with some other stuff. Let me get you the mac version its on my VM somewhere. v2.0 doesnt have the mac part merged in yet but your question motivates me to do it.

@Noitidart
Copy link
Owner Author

@evacchi you can grab the xpi from: https://github.com/Noitidart/Profilist/tree/mac-iconing-alpha

the one named " Porfilist 2 alpha mac iconing.xpi". To make the icon, click on main menu, then hover over profilist stack, it expands, then mouse over the imaf of the "user" (black/transparent) to the left of the profile name. Then click it, then select image or images (multi sizes of same image) to use as badge. then its badged. you can now go the options page, and then click "create shortcut" and choose the profile name. however an issue i havent figure out yet is that when running in the badged version, firefox updates seem to fail.

@evacchi
Copy link

evacchi commented Sep 29, 2015

uhm, which version of FFox should I be using? The file picker is shown, but when I pick a picture (png, jpg) no icon is shown -- and the generated files seems to be 0 bytes

@Noitidart
Copy link
Owner Author

Oh crap I just tested it you're right. Ok let me see whats going on Ill update you.

@Noitidart
Copy link
Owner Author

Fixed it @evacchi thanks for that note. It was due to a chance in Firefox 37 where array buffers were neutered: https://github.com/Noitidart/Profilist/tree/mac-iconing-alpha same xpi

so after you badge the icon from the menu, then go to preferences, and create desktop shortcut, then launch the profile from there. if you change the badge multiple times i have an issue where the desktop alias icon is not updating visually, but if you do get get info on it, you will see the icon is updated. the issue i brought up here: http://apple.stackexchange.com/questions/174761/make-alias-take-icon-of-the-app-it-points-to?noredirect=1#comment205991_174761 To work around it you can rename the alias to something new i dont know why this fixes it.

So anyways, you don't have to force the icon to take, you can drag that icon to dock, or just launch it, keep in dock on restart etc etc, it will show the updated icon everywhere except the dang desktop. :)

@Noitidart
Copy link
Owner Author

If icons dont update, you have to open terminal and do killall Dock and killall Finder, Im trying to figure out whats going on here: http://stackoverflow.com/questions/32848607/icon-not-taking-on-desktop-but-taking-everywhere-else

Or you dont have to killall just right click and "Show in Finder" to update the dock item, and on desktop rename the alias to have like a space at the end, watch this vid for demo: https://www.youtube.com/watch?v=yZtmJVanmbw

@Noitidart
Copy link
Owner Author

@evacchi how did it work out for you?

@Noitidart
Copy link
Owner Author

@evacchi I created and released an addon that allows you to provide png(s) for base and png(s) for badge and it will create a ICNS for you check it out: https://addons.mozilla.org/en-US/firefox/addon/icon-container-generator/

@evacchi
Copy link

evacchi commented Oct 14, 2015

ha! that's neat. so if I got it right:

  • I'm supposed to pick an icon by clicking the small profile icon in the drop down
  • then I should create a stand-alone OS X alias/app launcher and start the profile from there
    (in fact, that's the only way I can start a separate profile, apparently, since clicking the profile name does not start it; at least for me)

This approach does work, but I though you had found a way to avoid creating the launcher in the first place, by badging the firefox icon "on the fly"; this can be easily done with a text label (as I did with my small addon), but I'm not sure about an arbitrary icon. The point of my addon was to avoid creating the desktop alias :)

BTW, still props for the effort!

@Noitidart
Copy link
Owner Author

@evacchi :)

The on fly thing works but it has major quirks. You cannot right click on the icon and keep in dock. It will think it is the main profile. If you have it running, and shutdown your computer, and told it to restart with last open programs, it will open with main profile.

So I had to make the alias :(

But you can use this addon to set it on the fly: https://github.com/Noitidart/Firefox-on-OS-X-Icon

And correct, I didn't hook up the buttons in the toolbar to launch the profile yet in that version. Launching from that alias is the only way. :( I have a hidden one, so in the non-alpha, it launches that hidden one, so a desktop alias is not required, but in this alpha version this parts not setup.

@Noitidart
Copy link
Owner Author

@evacchi updated in a huge way, this is true beta version - https://addons.mozilla.org/en-US/firefox/addon/profilist/versions/beta

Its in beta until I can get a patch in on Firefox. As on Mac the update mechansim is broken on profiles launched from Profilist menu, or by desktop launchers created by Profilist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants