SOLVED: Open App Icon to App Desktop

Basic FVWM questions can be asked here.
eusanpe
Kitten
Kitten
Posts: 5
Joined: Sun Mar 19, 2017 9:12 am

SOLVED: Open App Icon to App Desktop

Postby eusanpe » Sun Mar 19, 2017 9:24 am

Hello All,

I am new to FVWM and I really have enjoyed working on a configuration. Very challenging though. Here is what I am trying to do and I hope that it can be done.

I have thumbnails created for minimized apps. Terminator opens in Desk1 and Firefox opens in Desk2 using StartsOnPage. I created a Style of StickyIcon so the minimized thumbnails can follow me to other desktops. This works great. What I would like it to do is when I am on Desk3 for instance and Terminator and Firefox are opened and minimized, if I click the Firefox thumbnail, that it will maximize on Desk2. The same with Terminator except that it will maximize on Desk1. The current way is that it will maximize on the current Desk which in the example is Desk3.

Is there a way to accomplish this?

Thank you,
Tony
Last edited by eusanpe on Mon Mar 20, 2017 5:18 am, edited 1 time in total.

somiaj
Administrator
Administrator
Posts: 45
Joined: Mon Nov 08, 2004 9:54 pm
Location: Idaho (USA)
Contact:

Re: Open App Icon to App Desktop

Postby somiaj » Sun Mar 19, 2017 8:21 pm

My understanding is when you apply StickIcon style it makes the window Stick when Iconified so it will move desks/pages with you. To restore it back on the original page you will have to use a custom deiconfiy function or FvwmEvent to trigger a function when windows are DeIconified that will test windows and move them to their correct Page.

Another option would be to use FvwmIconMan to give you a list of windows in a taskbar like fashion. This can be sticky and move between DesksPages, but the windows stay on their original page. You can then access the window via FvwmIconMan. The default-config has an example of doing this with a function that will move to the desk/page a window is on when deiconifying it.

If you only care about iconfieid windows, you can configure FvwmIconMan to show only iconified windows and be a place for them to be listed. Then just make that sticky and you can access it from any desk/page and not have to move the windows with you using StickyIcon.
-jaimos

eusanpe
Kitten
Kitten
Posts: 5
Joined: Sun Mar 19, 2017 9:12 am

Re: Open App Icon to App Desktop

Postby eusanpe » Sun Mar 19, 2017 9:25 pm

I will play around with this and post my solution once I figure it out.

Thank you for your insight.

Tony

Update: 03/19/2017

I figured out a solution to make things work. Here is what I did...

First off for this example I have the following Style for Firefox...

Code: Select all

#Firefox
Style Navigator     EWMHMiniIconOverride, \
                            Icon $[fvwm_app_icons]/firefox-icon.png, \
                            MiniIcon $[fvwm_app_icons]/firefox-icon.png

Style "Navigator" StartsOnDesk 1


# Iconify

Code: Select all

###### Thumbnail function
# 1920x1200
SetEnv fvwm_icon_size   128
DestroyFunc Thumbnail
AddToFunc   Thumbnail
+ I Raise
+ I SetEnv Icon-$[w.id] $[w.IconFile]
+ I PipeRead "echo $[w.desk] >> $[fvwm_home]/windows/$[w.class]-$[w.id]"
+ I ThisWindow (!Shaded, Iconifiable, !Iconic) PipeRead \
    "$[fvwm_script]/thumb $[w.id] $[fvwm_icon_size] /dev/shm/icon.tmp.$[w.id].png $[w.IconFile]"
+ I Iconify


I added the following below when an icon is iconified (minimized). This will create a file labeled WindowClass-WindowID (firefox-0x2000003) and write the current desk number (1) to the file. The values can be found with FVWMIdent.

Code: Select all

+ I PipeRead "echo $[w.desk] >> $[fvwm_home]/windows/$[w.class]-$[w.id]"


# Deiconify

Code: Select all

DestroyFunc DeThumbnail
AddToFunc DeThumbnail
+ I PipeRead "echo WindowStyle IconOverride, Icon \\$\\[Icon-$[w.id]\\]"
+ I UnsetEnv Icon-$[w.id]
+ I Exec exec "rm -f /dev/shm/icon.tmp.$[w.id].png"
+ I PipeRead 'echo SetEnv desknumber `cat ~/.fvwm/windows/$[w.class]-$[w.id]`'
+ I MoveToDesk 0 $[desknumber]
+ I UnsetEnv desknumber
+ I PipeRead "rm -rf $[fvwm_home]/windows/$[w.class]-$[w.id]"


I added the following below when the icon is deiconified (maximized). This will read the value in the WindowClass-WindowID file, set an environment variable DeskNumber, assign the value to MoveToDesk, unset the variable and remove the earlier created file.

Code: Select all

+ I PipeRead 'echo SetEnv desknumber `cat ~/.fvwm/windows/$[w.class]-$[w.id]`'
+ I MoveToDesk 0 $[desknumber]
+ I UnsetEnv desknumber
+ I PipeRead "rm -rf $[fvwm_home]/windows/$[w.class]-$[w.id]"


I hope this helps someone and I am open to improvements and/or suggestions!

Thanks,
Tony


Return to “Basic questions”

Who is online

Users browsing this forum: No registered users and 1 guest