You are not logged in.

#1 2021-04-23 07:11:28

CoderChris
Member
From: Mid-Western United States
Registered: 2021-04-23
Posts: 8

[SOLVED] Issue with DWM and Getting Transparent Windows ...

Hello,

I am running dwm under xorg and I have been trying to get automatically transparent windows to work correctly for a few days, but I have had no luck.

I have been following the wiki entry at: Arch Wiki Per-application transparency



xcompmgr window manager is running with:
$xcompmgr &



I created the directory .devilspie in my home user directory. And inturn created a S-expression file name opacity.ds that looks like:

( if
( is ( application_name ) "st" )
( begin
( spawn_async (str "transet-df -i " (window_xid) " 0.45" ))
)
)

^I have also tried a variant where I remove the if statement in case the conditon was faulty. (IDK if that is valid S-expression)



Running devilspie with -da options yields:

Loading /etc/devilspie
Loading /etc/devilspie/example.ds
Loading /home/chris/.devilspie
Loading /home/chris/.devilspie/opacity.ds
2 s-expressions loaded

^Also removing the example.ds s-expression file did not yield any results.



Lastly I have positively confirmed that I can infact make transparent windows by using:

$transset-df .80

And I can click on a window and the transparency is set correctly.



In case it helps anyone here is also the output of xprop for a given window (st in this case):

_NET_WM_WINDOW_OPACITY(CARDINAL) = 3435973836
WM_STATE(WM_STATE):
                window state: Normal
                icon window: 0x0
WM_LOCALE_NAME(STRING) = "C"
WM_CLASS(STRING) = "st-256color", "st-256color"
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: True
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                program specified size: 804 by 460
                program specified minimum size: 14 by 23
                program specified resize increment: 10 by 19
                program specified base size: 4 by 4
WM_CLIENT_MACHINE(STRING) = "arch"
_NET_WM_NAME(UTF8_STRING) = "st"
WM_NAME(UTF8_STRING) = "st"
_NET_WM_PID(CARDINAL) = 83205
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW


If anyone can offer any help or if a solution with devilspie cannot be discovered another solution for automatic transparent windows that works with dwm would be appreciated. (Even if it is patching the code)

Thank You,
Chris C.

Last edited by CoderChris (2021-06-28 04:05:47)


“And who better understands the Unix-nature?” Master Foo asked. “Is it he who writes the ten thousand lines, or he who, perceiving the emptiness of the task, gains merit by not coding?”

Upon hearing this, the programmer was enlightened.
Originally by Eric S. Raymond

Offline

#2 2021-04-23 07:41:58

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Issue with DWM and Getting Transparent Windows ...

Does matching class work?

( is ( window_class ) "st-256color" )

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2021-04-23 07:55:18

CoderChris
Member
From: Mid-Western United States
Registered: 2021-04-23
Posts: 8

Re: [SOLVED] Issue with DWM and Getting Transparent Windows ...

jasonwryan wrote:

Does matching class work

That did not work.

opacity.ds:

( if
( is ( window_class ) "st-256color" )
( begin
        ( spawn_async (str "transset-df -i " (window_xid) " 0.45" ))
)
)

“And who better understands the Unix-nature?” Master Foo asked. “Is it he who writes the ten thousand lines, or he who, perceiving the emptiness of the task, gains merit by not coding?”

Upon hearing this, the programmer was enlightened.
Originally by Eric S. Raymond

Offline

#4 2021-04-23 08:02:12

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Issue with DWM and Getting Transparent Windows ...

Looking at the xprop output, I don't see a window_xid printed, and I see a broken locale. If you fix your locale, do you get an xid to work with?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2021-04-23 08:47:58

CoderChris
Member
From: Mid-Western United States
Registered: 2021-04-23
Posts: 8

Re: [SOLVED] Issue with DWM and Getting Transparent Windows ...

jasonwryan wrote:

Looking at the xprop output, I don't see a window_xid printed, and I see a broken locale. If you fix your locale, do you get an xid to work with?

First off thank you for clueing me in. I was unaware and it forced me to quickly read up on locales.

So my orignal locale was (output from $locale):

LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=

And I amended it to:

LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=

^Wasn't sure if LC_ALL= should have an entry. I need to do some more reasearch on that one to figure out why it didn't get set or if it should even be set.

By following the instructions at Arch Linux Wiki Locale under the "Setting the Locale" subsection and then using the "Make Locale Changes Immediate" to push it through. Then when that didn't work I did a full reboot, just to make sure my bases were covered.

But then attempting to run devilspie with both a conditon for window_class and for application_name still does not work.
     (EDIT: For clarrification I mean here that I ran devilspie once with the window_class condition and once with the application_name condition, both these are specified in earlier posts. Since you can use AND conditional logic with s-expressions my original statement could have been confusing)

xprop output:

WM_STATE(WM_STATE):
                window state: Normal
                icon window: 0x0
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLASS(STRING) = "st-256color", "st-256color"
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: True
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                program specified size: 804 by 460
                program specified minimum size: 14 by 23
                program specified resize increment: 10 by 19
                program specified base size: 4 by 4
WM_CLIENT_MACHINE(STRING) = "arch"
_NET_WM_NAME(UTF8_STRING) = "st"
WM_NAME(UTF8_STRING) = "st"
_NET_WM_PID(CARDINAL) = 762
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW

As one can see, though the locale is reported correctly, still no xid is being reported.

Last edited by CoderChris (2021-04-23 09:00:13)


“And who better understands the Unix-nature?” Master Foo asked. “Is it he who writes the ten thousand lines, or he who, perceiving the emptiness of the task, gains merit by not coding?”

Upon hearing this, the programmer was enlightened.
Originally by Eric S. Raymond

Offline

#6 2021-04-23 18:24:32

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Issue with DWM and Getting Transparent Windows ...

How do you start dwm? Please paste your .xinitrc. And check you have a valid sesssion: https://wiki.archlinux.org/index.php/Ge … ermissions


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2021-04-24 03:12:29

CoderChris
Member
From: Mid-Western United States
Registered: 2021-04-23
Posts: 8

Re: [SOLVED] Issue with DWM and Getting Transparent Windows ...

jasonwryan wrote:

How do you start dwm? Please paste your .xinitrc.


From my /etc/X11/xinit/xinitrc (I don't currently use .xinitrc in my home directory):

#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps
if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm -geometry 80x20+494-0 &
feh --bg-fill -z ~/media/pics/wallpaper/*
~/.status.sh &
xcompmgr &
devilspie -a &
exec dwm
exec xterm -geometry 80x66+0+0 -name login

^I have also tried removing xcompmgr and devilspie from it and starting them manually after xorg session is started with no luck.



jasonwryan wrote:

And check you have a valid sesssion:


As described the output from $loginctl show-session $XDG_SESSION_ID:

Id=1
User=1000
Name=chris
Timestamp=Fri 2021-04-23 03:23:34 EDT
TimestampMonotonic=11521731
VTNr=1
Seat=seat0
TTY=tty1
Remote=no
Service=login
Scope=session-1.scope
Leader=523
Audit=1
Type=tty
Class=user
Active=yes
State=active
IdleHint=no
IdleSinceHint=1619233224124417
IdleSinceHintMonotonic=24428333321
LockedHint=no

As I understand the wiki, this is a valid local session since "This should contain Remote=no and Active=yes in the output" which are both true in my case.


“And who better understands the Unix-nature?” Master Foo asked. “Is it he who writes the ten thousand lines, or he who, perceiving the emptiness of the task, gains merit by not coding?”

Upon hearing this, the programmer was enlightened.
Originally by Eric S. Raymond

Offline

#8 2021-04-24 04:06:43

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Issue with DWM and Getting Transparent Windows ...

You have another window manager running (twm) abnd a bunch of other stuff that you should comment out/remove from xinitrc. And only the first exec is read.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2021-04-24 04:38:00

CoderChris
Member
From: Mid-Western United States
Registered: 2021-04-23
Posts: 8

Re: [SOLVED] Issue with DWM and Getting Transparent Windows ...

jasonwryan wrote:

You have another window manager running (twm) abnd a bunch of other stuff that you should comment out/remove from xinitrc. And only the first exec is read.

My apologies, that would have been obvious if I done better research.

Anyway new xinitrc:

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps
if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

feh --bg-fill -z ~/media/pics/wallpaper/*
~/.status.sh &
xcompmgr &
devilspie -ad &
exec dwm

^I think I got all the extanous junk. the for loops seem to be worth keeping.

Still no dice though on the transparent windows though.

Can confirm that both are started by the session with an old $ps -e |grep -E "devilspie|xcompmgr"

xprop seems to be outputting the same as before as far as I can tell:

WM_STATE(WM_STATE):
                window state: Normal
                icon window: 0x0
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLASS(STRING) = "st-256color", "st-256color"
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: True
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                program specified size: 804 by 460
                program specified minimum size: 14 by 23
                program specified resize increment: 10 by 19
                program specified base size: 4 by 4
WM_CLIENT_MACHINE(STRING) = "arch"
_NET_WM_NAME(UTF8_STRING) = "st"
WM_NAME(UTF8_STRING) = "st"
_NET_WM_PID(CARDINAL) = 48164
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW

And $loginctl show-session $XDG_SESSION_ID  still shows a valid session.


“And who better understands the Unix-nature?” Master Foo asked. “Is it he who writes the ten thousand lines, or he who, perceiving the emptiness of the task, gains merit by not coding?”

Upon hearing this, the programmer was enlightened.
Originally by Eric S. Raymond

Offline

#10 2021-04-24 04:52:57

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Issue with DWM and Getting Transparent Windows ...

That's pretty much all I got. The one other thing I would try is to see if it works in another terminal (xterm or urxvt, for example). Oh, and make sure you aren't forcing $TERM anywhere, that will tend to fuck things up.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2021-04-24 05:29:33

CoderChris
Member
From: Mid-Western United States
Registered: 2021-04-23
Posts: 8

Re: [SOLVED] Issue with DWM and Getting Transparent Windows ...

Ah damn, C'est la vive, as they say though. Farting around real quick with xterm doesn't seem to do much and doing a quick $grep "\$TERM" / -R isn't providing many good insights.

At the very least you helped me clean up my xinitrc and locale so I apperciate that! I will keep hacking on it and see if I can figure it out and then report back.

If anyone else has any good insights feel free to jump in.

Anyway, till next time,
peace.


“And who better understands the Unix-nature?” Master Foo asked. “Is it he who writes the ten thousand lines, or he who, perceiving the emptiness of the task, gains merit by not coding?”

Upon hearing this, the programmer was enlightened.
Originally by Eric S. Raymond

Offline

#12 2021-04-24 08:01:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,523

Re: [SOLVED] Issue with DWM and Getting Transparent Windows ...

On a sidenote: there's an alpha patch for st (and urxvt does that ootb) that allows you to have a translucent background w/o making the fonts near-invisible.
At least for urxvt you can alter the background (alpha) w/ some escape sequences, never tried w/ st, though.

Offline

#13 2021-06-28 04:05:11

CoderChris
Member
From: Mid-Western United States
Registered: 2021-04-23
Posts: 8

Re: [SOLVED] Issue with DWM and Getting Transparent Windows ...

Following up either Seth's solution will work, or I personally just found a fork of ST posted by papa LukeSmith that solved my issue.

His fork can be found at: https://github.com/LukeSmithXYZ/st

and I had to setup my .xinitrc with:

xcompmgr &
exec dwm

and I loaded my .Xdefaults with:

!! Transparency (0-1):
st.alpha: 0.92
st.alphaOffset: 0.3

While it is not the general solution with Devilspie I am quite satisfied with this solution.


“And who better understands the Unix-nature?” Master Foo asked. “Is it he who writes the ten thousand lines, or he who, perceiving the emptiness of the task, gains merit by not coding?”

Upon hearing this, the programmer was enlightened.
Originally by Eric S. Raymond

Offline

Board footer

Powered by FluxBB