FreePIE icon indicating copy to clipboard operation
FreePIE copied to clipboard

start minimized in notification icon

Open B4st13n opened this issue 10 years ago • 11 comments

Is it possible to start a script in background ? Right now it is possible to start a acript with the command line

freepie.exe myscript.py /r

but this open a new windows of freepie. Is it possible to avoid this and start freepie minimized in the notification icon

B4st13n avatar Jul 14 '15 09:07 B4st13n

No, there is nothing built it for this sorry. But might soimething that can be fixed in future.

AndersMalmgren avatar Jul 14 '15 10:07 AndersMalmgren

I will see if I can do something. I noticed you command line parser is executed after the first appearance of the main window.

I tried your freepie.console.exe without success. What is the purpose of this console project ?

FYI GlovePIE had the same issue. It was possible to start GlovePIE with commands /run and /tray but these commands were executed after the first appearance of the main windows. The issue is that when you want to start a script in background when playing a game you lost the focus of your game. Sometime you are ejected of your game.

B4st13n avatar Jul 15 '15 00:07 B4st13n

Problem is the commands uses features in the WPF windows, would be a huge rewrite to change that. But it could be done.

The console project should compile as far as I know, what does the compiler say?

AndersMalmgren avatar Jul 21 '15 07:07 AndersMalmgren

I have been thinking some more abut this. The best solution I think would be to introduce two new commands. DefaultStartupCommand that executes this code https://github.com/AndersMalmgren/FreePIE/blob/master/FreePIE.GUI/Bootstrap/BootStrapper.cs#L51

Which will load FreePIE like normal. And then another command TrayStartupCommand that loads FreePIE into tray mode

AndersMalmgren avatar Aug 03 '15 13:08 AndersMalmgren

For the tray mode you need to add a tray icon. This mean adding System.Windows.Form as reference to be able to use NotifyIcon. What do you think about this?

B4st13n avatar Aug 27 '15 06:08 B4st13n

There seems to be libraries for WPF like http://www.hardcodet.net/wpf-notifyicon

AndersMalmgren avatar Aug 27 '15 07:08 AndersMalmgren

I have changed in the Bootstrapper so my link above does not point to the right line its this code that loads the app in Window mode

DisplayRootViewFor<MainShellViewModel>()

AndersMalmgren avatar Aug 27 '15 07:08 AndersMalmgren

By now I'm using a warkround with ahk script

Run, "C:\Program Files (x86)\FreePIE\FreePIE.exe" "C:\Program Files (x86)\FreePIE\scripts\DolphinExit.py" /r,,,AutoHidePieDolphinPID
WinWait ahk_pid %AutoHidePieDolphinPID%
WinHide

edipoReboucas avatar Nov 29 '15 16:11 edipoReboucas

I could offcourse fix a /h or /hide feature that simply minimizes FreePIE after start, but I do not think that is what @B4st13n wants?

AndersMalmgren avatar Nov 30 '15 08:11 AndersMalmgren

This script really "hide" de window, don't appear on taskbar, only on task manager. If is easy make the "hide" I belive thats good enough.

edipoReboucas avatar Dec 02 '15 03:12 edipoReboucas

I'm also looking for this feature. A System tray icon would be great, but it would be helpful to at least have it minimize to the main task bar.

Jellybit avatar Apr 06 '16 11:04 Jellybit