You are not logged in.

#1 2014-07-24 16:50:00

bitsdd
Member
Registered: 2014-06-26
Posts: 34

Unable to get a transparent xterm...

Hello Guys,
For some reason i'm unable to get a transparent xterm window (started through xinitrc) but when i starting xterm manually then it is behaving normally, may i ask the reason why??

my .xinitrc

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

# Statusbar loop
while true; do
   xsetroot -name "$( date +"%F %R" )"
   sleep 1m    # Update time every minute
done &

#Autostart Section
while true;do
        feh --randomize --bg-fill ~/img/*
        sleep 5s # Update every 5 second
done&
[ -n "$XTERM_VERSION" ] && transset-df -a >/dev/null
[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources
xcompmgr&
xterm -bg black -fg white -cr red  /bin/sh &

#WM/DE section
exec dwm

.Xresources

xterm*cursorColor: #ff0000
xterm*background: #1a1a1a
xterm*foreground: #d5d5d5

Last edited by bitsdd (2014-07-24 17:51:54)


Is there any cookies because i'm all about arch arch arch....

Offline

#2 2014-07-24 16:58:54

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,643
Website

Re: Unable to get a transparent xterm...

Where do you set transparency?  What exact command do you execute when it works as desired?  Does the xterm from your xinitrc launch at all?

You probably shouldn't background xrdb - it may not finish loading before the xterm on the next line is launched the way you've written it.  This would not cause the current issue - unless of course that is not your complete Xresource file (then if very likely could).

Last edited by Trilby (2014-07-24 17:06:14)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2014-07-24 17:50:56

bitsdd
Member
Registered: 2014-06-26
Posts: 34

Re: Unable to get a transparent xterm...

Trilby wrote:

Where do you set transparency?  What exact command do you execute when it works as desired?  Does the xterm from your xinitrc launch at all?

You probably shouldn't background xrdb - it may not finish loading before the xterm on the next line is launched the way you've written it.  This would not cause the current issue - unless of course that is not your complete Xresource file (then if very likely could).

I followed this
and installed xcompmgr and transset-df and (yes [ -n "$XTERM_VERSION" ] && transset-df -a >/dev/null it's in my xinitrc "now")
and then opened xterm via dmenu and it appears to be tranparent (that's what i wanted)
but the xterm executed from xinitrc (only that one) never get a transparent background.
I think i'm doing something wrong but don't know what?? (xrdb fixed smile)


Is there any cookies because i'm all about arch arch arch....

Offline

#4 2014-07-24 17:58:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,643
Website

Re: Unable to get a transparent xterm...

That line from the wiki should not be in your xinitrc, it should be in your shell rc file (e.g. ~/.bashrc).  But it sounds like it's already there.  The one you put in the xinitrc will never do anything, so it can be removed.

I suspect the problem is you are not executing the same command in the two cases.  What command are you running with dmenu?  Just "xterm"?  If so, put just "xterm &" in your xinitrc.

The actual cause of the problem is that you specify /bin/sh in the line in xinitrc (why?).  This prevents the ~/.bashrc file from being read, so the transset command is never executed.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2014-07-24 18:17:15

bitsdd
Member
Registered: 2014-06-26
Posts: 34

Re: Unable to get a transparent xterm...

Thanks Trilby smile it worked, /bin/sh came out to be the culprit.
But just for understanding, why did /bin/sh did'nt worked as /bin/bash even though i put

[ -n "$XTERM_VERSION" ] && transset-df -a >/dev/null

in .xinitrc it must execute transset-df.

if

[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources

is working
then why isn't

[ -n "$XTERM_VERSION" ] && transset-df -a >/dev/null

Last edited by bitsdd (2014-07-24 18:18:26)


Is there any cookies because i'm all about arch arch arch....

Offline

#6 2014-07-24 18:36:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,643
Website

Re: Unable to get a transparent xterm...

bitsdd wrote:

why did /bin/sh did'nt worked as /bin/bash even though i put

[ -n "$XTERM_VERSION" ] && transset-df -a >/dev/null

in .xinitrc it must execute transset-df.

Two reasons:

1) That conditional does not pass - xinitrc is not run from an xterm.  So the transset-df command never executes.

2) Even if the conditional passed, the transset-df command would fail.  That command sets the transparency of the window of the controlling terminal emulator.  There is no controlling terminal emulator, and there is no window, so transset-df has nothing to set.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB