imv icon indicating copy to clipboard operation
imv copied to clipboard

[Feature Request] Add command line option to set window class

Open ngortheone opened this issue 5 years ago • 2 comments

Hi, thanks for imv! I use swaywm and sometimes I want to run programs in floating mode.

For example when I make a screenshot I want to show a floating imv window with a screenshot. But it seems that there is no way to set windows class explicitly

Here is my sway config snippet that shows how I run my terminal in floating mode:

bindsym $mod+Shift+Return exec alacritty --class "floating-terminal"
for_window [app_id="floating-terminal"] floating enable

A similar feature in imv would be great!

ngortheone avatar Sep 09 '20 19:09 ngortheone

Sounds reasonable enough. I'll try to get around to this in the near-future but I've been putting little time towards imv this year

eXeC64 avatar Dec 02 '20 00:12 eXeC64

I found a way around in SwayWM for now.

imv ~/Pictures/wallpapers \
    -c 'bind <Return> exec setbg "$imv_current_file" ' \
    -c 'exec swaymsg for_window [pid="$imv_pid"] floating enable' 

setbg is my own script, so only the third line is important. imv offers environment variable imv_pid and swaymsg can change window state based on window pid. The hack works, but sometimes it breaks Sway's tilling system in the current workspace.

kotochor avatar Jun 22 '21 10:06 kotochor