Window Thumbnail: Difference between revisions

From Fvwm Extensions (configs) Archive
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[File:win-thumb.png|right|150px|link=Window Thumbnail|Image]] '''[[Window Thumbnail]]''' <small>''(functions)''</small> take a screenshot of an application window when it’s iconified, resize it, and use it as the application’s icon.
[[File:Win-thumb.png|right|150px|link=Window Thumbnail|Image]] '''[[Window Thumbnail]]''' <small>''(functions)''</small> take a screenshot of an application window when it’s iconified, resize it, and use it as the application’s icon.
Needs imagemagick and x11-apps for this function to work. It takes a snapshot of the window before it is iconified, and then assigns the icon to the iconified window.
Needs ImageMagick and X11-apps for this function to work. It takes a snapshot of the window before it is iconified, and then assigns the icon to the iconified window.
<pre>
<pre>
## FILE 1
## FILE 1: thumbnails.txt
## Functions: thumbnails.txt
## Functions
 
SetEnv HOME_DIR $[HOME]/.fvwm


## Set Thumbnail cache folder
## Set Thumbnail cache folder


SetEnv cacheth $[HOME_DIR]/cache
SetEnv cacheth $[HOME]/.fvwm/cache


## Thumbnail fuction
## Thumbnail function


DestroyFunc Thumbnail
DestroyFunc Thumbnail
Line 41: Line 39:
Create folder ''.fvwm/cache''.<br>
Create folder ''.fvwm/cache''.<br>
Copy the code and paste it into your config. Or create FILE 1 and run the below line:<br>
Copy the code and paste it into your config. Or create FILE 1 and run the below line:<br>
''Read thumbnail.txt''
''Read $[HOME]/.fvwm/thumbnail.txt''


READ MORE</br>
READ MORE</br>
Line 48: Line 46:
[[Category:functions]]
[[Category:functions]]
[[Category:action]]
[[Category:action]]
[[Category:codes]]

Latest revision as of 11:46, 12 July 2025

Image

Window Thumbnail (functions) take a screenshot of an application window when it’s iconified, resize it, and use it as the application’s icon.

Needs ImageMagick and X11-apps for this function to work. It takes a snapshot of the window before it is iconified, and then assigns the icon to the iconified window.

## FILE 1: thumbnails.txt
## Functions

## Set Thumbnail cache folder

SetEnv cacheth $[HOME]/.fvwm/cache

## Thumbnail function

DestroyFunc Thumbnail
AddToFunc Thumbnail
+ I Raise
+ I ThisWindow (!Shaded, Iconifiable, !Iconic) PipeRead \
       "xwd -silent -id $[w.id] | convert -scale 156 -frame 1x1 \
       -mattecolor black -quality 0 xwd:- \
       png:$[cacheth]/icon.tmp.$[w.id].png \
       && echo WindowStyle IconOverride, \
       Icon $[cacheth]/icon.tmp.$[w.id].png \
       || echo Nop"
+ I Iconify

DestroyFunc DeThumbnail
AddToFunc DeThumbnail
+ I Exec rm -f $[cacheth]/icon.tmp.$[w.id].png
+ I DestroyWindowStyle
*FvwmEvent: deiconify DeThumbnail
AddToFunc StartFunction I Module FvwmEvent

## Iconfy (minimize) to Thumbnail Placeholder

Style * IconBox 400x600-10+340, IconGrid 1 4, \
IconFill top right, !IconTitle, IconBackgroundRelief 0

HOW TO: Create folder .fvwm/cache.
Copy the code and paste it into your config. Or create FILE 1 and run the below line:
Read $[HOME]/.fvwm/thumbnail.txt

READ MORE
https://www.fvwm.org/Archive/Faq/#using-application-screenshots-as-icon-or-mini-icon-thumbnails