You are not logged in.

#1 2008-03-13 02:22:49

sunv
Member
Registered: 2008-02-25
Posts: 20

urxvt as background desktop

Hello I want to make my terminal as part of my desktop background.  I followed the directions from the ubuntu how-to but i dont know how to apply it for urxvt.
Here's ubuntu how-to: http://www.ubuntugeek.com/how-to-create … round.html

So I can get urxvt to have no borders with "-borderLess"
However how do I stick urxvt to the background, so that alt-tab doesn't focus on it?
Also how do I take the process out of my panel.
Also I use xcompmgr, how do I make it so xcompmgr's shading is not under it.

basically I want it to run like my conky which is stuck to the background, doesn't appear on my pypanel, and i can't alt-tab to it so that it doesn't suddenly appear a floating window above my other windows.

Thank you so much if you can figure this out

Last edited by sunv (2008-03-13 02:23:05)

Offline

#2 2008-03-13 02:40:07

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: urxvt as background desktop

That depends mostly on your window manager. Which one are you using?

Offline

#3 2008-03-13 02:47:05

sunv
Member
Registered: 2008-02-25
Posts: 20

Re: urxvt as background desktop

openbox

Offline

#4 2008-03-13 12:12:58

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: urxvt as background desktop

try it with

$ urxvt -borderLess -override-redirect +sb

and let me know if it works... i want to do this as well, but cant test at the moment wink

Last edited by klixon (2008-03-13 12:14:29)


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#5 2008-03-13 16:38:45

sunv
Member
Registered: 2008-02-25
Posts: 20

Re: urxvt as background desktop

Using

$ urxvt -borderLess -override-redirect +sb

does not work.  It gives a terminal window at the upper left side, but you cannot focus or type in the terminal, and the cursor in it is not blinking.
It does work in the sense that it doesn't show on my pypanel, but since I can't even focus on it when I click it, I can't use it.

Also is there a way to set the geometry of my urxvt window, it always comes out the same size.  I tried omitting the geometry line in .Xdefaults and having devilspie set the geometry, but it doesn't work.  Devilspie commands to set the geometry of window and position on screen dont work at all.

Last edited by sunv (2008-03-13 16:43:19)

Offline

#6 2008-03-13 17:28:55

burk
Member
From: Norway
Registered: 2007-06-17
Posts: 46

Re: urxvt as background desktop

Try man urxvt, it should say something about geometry. I also think you can make key shortcuts for turning window decoration on and off in openbox, so maybe you can make a window start without it as well..

Offline

#7 2008-03-13 17:42:14

purete
Member
Registered: 2007-03-02
Posts: 19

Re: urxvt as background desktop

Devilspie can remove the decoration.

Offline

#8 2008-03-13 17:53:49

3nd3r
Member
From: /dev/null
Registered: 2002-12-08
Posts: 301
Website

Re: urxvt as background desktop

here is another trick

In openbox, move your terminal to how you want it, maximized in your case then hit alt and the space bar, there will be a "un"decorate option that will pop up. Click it and it will remove the borders. If you need the borders again to move the terminal, alt + space bar will open the same menu and just re click the undecorate button again and the borders will come back.

Offline

#9 2008-03-13 17:58:29

sunv
Member
Registered: 2008-02-25
Posts: 20

Re: urxvt as background desktop

All of your comments are well appreciated.  Yes the alt+space worked to undecorate.  But what I want is a terminal that sits in the desktop background, like it is part of background, and does not move or change.  It is always there like conky and you can't alt-tab to it AND it doesn't appear on your panel or pager.

the undecorate trick works to remove the borders, but it doesn't make the terminal seem part of the background.  Alt tab still goes to it, and sometimes the maximized, transparent terminal window is above everything else and I dont realize it.

Last edited by sunv (2008-03-13 18:08:02)

Offline

#10 2008-03-13 18:48:01

purete
Member
Registered: 2007-03-02
Posts: 19

Re: urxvt as background desktop

You can use devilspie to undercorate, put at the bottom and hide (taskbar & pager) your terminal.
http://live.gnome.org/DevilsPie
Here are all necessary tips. Good luck;)

Offline

#11 2008-03-14 19:42:42

axion419
Member
Registered: 2007-04-12
Posts: 185

Re: urxvt as background desktop

Offline

#12 2008-03-14 21:07:38

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: urxvt as background desktop

The openbox way:
Add this to ~/.Xdefaults

; for me this is 140x58. Adjust to your liking
RootTerm.geometry: 140x58

Add this to ~/.config/openbox/autostart.sh:

urxvt -name RootTerm &

Add this to the <applications> section of ~/.config/openbox/rc.xml:

    <application name="RootTerm">
      <decor>no</decor>
      <skip_taskbar>yes</skip_taskbar>
      <skip_pager>yes</skip_pager>
      <layer>below</layer>
      <position>
        <x>center</x>
        <y>0</y>
      </position>
      <focus>no</focus>
      <desktop>all</desktop>
    </application>

restart X and "Hey, presto" wink This assumes you know how to make your term transparent...

Last edited by klixon (2008-03-14 21:07:58)


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#13 2008-06-08 02:37:41

zhiwen
Member
Registered: 2007-11-10
Posts: 12

Re: urxvt as background desktop

klixon wrote:

The openbox way:
Add this to ~/.Xdefaults

; for me this is 140x58. Adjust to your liking
RootTerm.geometry: 140x58

Add this to ~/.config/openbox/autostart.sh:

urxvt -name RootTerm &

Add this to the <applications> section of ~/.config/openbox/rc.xml:

    <application name="RootTerm">
      <decor>no</decor>
      <skip_taskbar>yes</skip_taskbar>
      <skip_pager>yes</skip_pager>
      <layer>below</layer>
      <position>
        <x>center</x>
        <y>0</y>
      </position>
      <focus>no</focus>
      <desktop>all</desktop>
    </application>

restart X and "Hey, presto" wink This assumes you know how to make your term transparent...

I can get the effect by using this configure, but when I toggle show desktop, the urxvt
window disappears, is there a way to make the urxvt window stick to desktop when toggling show desktop?

Offline

#14 2008-06-08 09:02:02

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: urxvt as background desktop

maybe you could use devilspie to tell openbox that urxvt is of type "dock" ?


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#15 2008-06-08 15:09:46

zhiwen
Member
Registered: 2007-11-10
Posts: 12

Re: urxvt as background desktop

moljac024 wrote:

maybe you could use devilspie to tell openbox that urxvt is of type "dock" ?

hi, I tried that, it does not work.

Offline

#16 2008-06-08 15:16:37

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: urxvt as background desktop

What about type "desktop" ?

(my apologies, desktop stays on bottom, dock stays on top)


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#17 2008-06-08 15:24:21

zhiwen
Member
Registered: 2007-11-10
Posts: 12

Re: urxvt as background desktop

that does not work either.

Offline

#18 2008-06-09 04:00:26

zhiwen
Member
Registered: 2007-11-10
Posts: 12

Re: urxvt as background desktop

I done that by using wmctrl finnially.

Offline

#19 2008-06-09 13:04:11

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: urxvt as background desktop

Would you mind telling everybody how ?


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#20 2008-07-23 03:47:51

mildred
Member
From: france
Registered: 2006-12-23
Posts: 43
Website

Re: urxvt as background desktop

I did that using nautilus, gnome-terminal (or roxterm) and devilspie. The devilspie configuration is as follows:

(if
    (or
       (is (window_name) "desktop-terminal")
       (is (window_class) "desktop-terminal")
       (is (window_property "WM_NAME") "desktop-terminal"))
    (begin
        (undecorate)
        (pin) ;; all workspaces ?
        (skip_pager)
        (skip_tasklist)
        (maximize)
        (wintype "desktop")
    ))

it works with urxvt as well, but if you use the tabbed extension, the decoration appears again when I create a new tab sad

Don't forget to add -name desktop-terminal for urxvt, or --class=desktop-terminal for others

edit: well, it doesn't really work with urxvt, the terminal doesn't stays below the other windows sad

Last edited by mildred (2008-07-23 03:49:41)

Offline

#21 2008-07-23 07:13:22

mildred
Member
From: france
Registered: 2006-12-23
Posts: 43
Website

Re: urxvt as background desktop

The solution is to use the following perl script. I quickly hacked it from the urxvt sources (in doc/embed). You will need Perl and Gtk2 for Perl.

#!/usr/bin/perl

# sample script to illustrate the -embed option

# embed a rxvt inside another X app

use Gtk2;
use Glib qw/TRUE FALSE/;

init Gtk2;

my $pid;

sub delete_event
{
    kill 9, $pid;
    # SIGCHLD handler exits
    return TRUE;
}

sub catch_sigchld {
    exit(0);
}

my $window = new Gtk2::Window 'toplevel';
$window->signal_connect(delete_event => \&delete_event);
$window->set_decorated(FALSE);
$window->set_skip_taskbar_hint(TRUE);
$window->set_skip_pager_hint(TRUE);
$window->set_type_hint(desktop);
$window->maximize();

my $frame = new Gtk2::Frame;

$window->add ($frame);

my $rxvt = new Gtk2::Socket;
$frame->add ($rxvt);
$frame->set_size_request (700, 400);
$window->show_all;
my $xid = $rxvt->window->get_xid;



$pid = fork();
if ($pid==0) {

    exec 'urxvt', '-embed', $xid;

} else {

    $SIG{CHLD} = \&catch_sigchld;

    $window->show_all;

    main Gtk2;

}

It embeds urxvt in a GTK frame so when tabs gets created, the frame window may change a lit, but the toplevel window will still stay on the desktop.

one drawback, it draws a little boder around the terminal. But that should be removable.

Last edited by mildred (2008-07-23 07:16:27)

Offline

#22 2008-08-26 15:07:55

mildred
Member
From: france
Registered: 2006-12-23
Posts: 43
Website

Re: urxvt as background desktop

After some time, it stopped working (well, when I used the tabbed extension at least).
So now, I created an urxvt plugin: http://pastebin.com/fe414cd6

You can load it for example by setting the resources:

URxvt.perl-lib:         /home/mildred/.local/share/urxvt/perl/
URxvtDesktop.perl-ext:  tabbed,desktop

and start using:

urxvt -name URxvtDesktop

The perl source is here (file /home/mildred/.local/share/urxvt/perl/desktop):
http://pastebin.com/fe414cd6

#! /usr/bin/env perl

use X11::Protocol;

my $ewmh_NET_WM_STATE_REMOVE      = 0;    # remove/unset property
my $ewmh_NET_WM_STATE_ADD         = 1;    # add/set property
my $ewmh_NET_WM_STATE_TOGGLE      = 2;    # toggle property



sub send_client_message {
  my ($x, $win, $msg, $data) = @_;
  my %event = (
    'name'      => 'ClientMessage',
    'format'    => 32,
    'window'    => $win,
    'type'      => $msg,
    'data'      => $data);
  $x->SendEvent($x->root, 0,
    $x->pack_event_mask('SubstructureRedirect', 'SubstructureNotifyMask'),
    $x->pack_event(%event));
}

sub set_sticky {
  my ($self, $bool) = @_;
  my $x = $self->{x};

  my $act = $ewmh_NET_WM_STATE_REMOVE;
  $act = $ewmh_NET_WM_STATE_ADD if $bool;

#   $self->exec_async ("wmctrl", "-i", "-r", $self->parent, "-b", "add,sticky");

  send_client_message($x, $self->parent, $x->atom("_NET_WM_STATE"),
    pack("LLLLL", $act,
      $x->atom('_NET_WM_STATE_STICKY'), 0, 0, 0));

  $x->ChangeProperty($self->parent,
    $x->atom("DESKTOP_TERMINAL"), $x->atom("STRING"),
    8, "Replace", "true");
    # If this call isn't present, it may not work
}

sub set_desktop_mode {
  my ($self, $bool) = @_;
  my $x = $self->{x};

  my $act;
  my $window_type;
  if ($bool) {
    $act = $ewmh_NET_WM_STATE_ADD;
    $window_type = "_NET_WM_WINDOW_TYPE_DESKTOP";
  } else {
    $act = $ewmh_NET_WM_STATE_REMOVE;
    $window_type = "_NET_WM_WINDOW_TYPE_NORMAL";
  }

#   $self->exec_async ("wmctrl", "-i", "-r", $self->parent,
#     "-b", "add,skip_pager,skip_taskbar");
#   $self->exec_async ("wmctrl", "-i", "-r", $self->parent,
#     "-b", "add,maximized_horz,maximized_vert");

#   if($bool){
#     my %geom = $x->GetGeometry($x->root);
#     $x->MoveWindow($self->parent, 0, 0);
#     $x->ResizeWindow($self->parent, $geom{width}, $geom{height});
#   }

  send_client_message($x, $self->parent, $x->atom("_NET_WM_STATE"),
    pack("LLLLL", $act,
      $x->atom('_NET_WM_STATE_MAXIMIZED_HORZ'),
      $x->atom('_NET_WM_STATE_MAXIMIZED_VERT'), 0, 0));
  $x->ChangeProperty($self->parent,
    $x->atom("_NET_WM_WINDOW_TYPE"), $x->atom("ATOM"),
    32, "Replace", pack("L", $x->atom($window_type)));
  send_client_message($x, $self->parent, $x->atom("_NET_WM_STATE"),
    pack("LLLLL", $act,
      $x->atom('_NET_WM_STATE_BELOW'), 0, 0, 0));
  send_client_message($x, $self->parent, $x->atom("_NET_WM_STATE"),
    pack("LLLLL", $act,
      $x->atom('_NET_WM_STATE_SKIP_PAGER'),
      $x->atom('_NET_WM_STATE_SKIP_TASKBAR'), 0, 0));

  $x->ChangeProperty($self->parent,
    $x->atom("DESKTOP_TERMINAL"), $x->atom("STRING"),
    8, "Replace", "true");
    # If this call isn't present, it may not work
}


sub on_init {
  my ($self) = @_;
  print "initialize desktop plugin\n";

  $self->{x} = X11::Protocol->new($self->display_id);
  $self->{desktopmode} = 1;
  $self->{sticky} = 1;

  $self->resource (perl_ext_2 => $self->resource ("perl_ext_2") . ",-desktop");

  ()
}

sub on_start {
  my ($self) = @_;
  my $x = $self->{x};

  push @{ $self->{term}{option_popup_hook} }, sub {
    ("desktop mode" => $self->{desktopmode}, sub {
      $self->{desktopmode} = $_[0];
      $self->set_desktop_mode($self->{desktopmode});
      $self->{desktopmode}
    })
  };
  push @{ $self->{term}{option_popup_hook} }, sub {
    ("sticky" => $self->{sticky}, sub {
      $self->{sticky} = $_[0];
      $self->set_sticky($self->{sticky});
      $self->{sticky}
    })
  };

#   my %geom = $x->GetGeometry($x->root);
#   $x->MoveWindow($self->parent, 0, 0);
#   $x->ResizeWindow($self->parent, $geom{width}, $geom{height});
#   $self->XMoveResizeWindow($self->parent, 0, 24, $geom{width}, $geom{height}-48);

  ()
}

sub on_map_notify {
  my ($self) = @_;
  my $x = $self->{x};

  $self->set_desktop_mode($self->{desktopmode});
  $self->set_sticky($self->{sticky});

  ()
}

sub on_configure_notify {
  my ($self, $event) = @_;

  #$self->set_desktop_mode($self->{desktopmode});
  #$self->set_sticky($self->{sticky});

  ()
}

There is a known bug, the window is not sticky (in my case, the source code should make it sticky). The option in te menus doesn't work either. For the stickyness, I think a solution would be devilspie but I think I'll prefer for some time to have a different terminal on each desktop.

The documentation I used was the source code of wmctrl, koders.com and the EWMH specification.

Mildred

Last edited by mildred (2008-08-26 15:12:00)

Offline

#23 2009-04-06 19:16:18

heyuxiang
Member
Registered: 2008-10-09
Posts: 14

Re: urxvt as background desktop

klixon wrote:

The openbox way:
Add this to ~/.Xdefaults

; for me this is 140x58. Adjust to your liking
RootTerm.geometry: 140x58

Add this to ~/.config/openbox/autostart.sh:

urxvt -name RootTerm &

Add this to the <applications> section of ~/.config/openbox/rc.xml:

    <application name="RootTerm">
      <decor>no</decor>
      <skip_taskbar>yes</skip_taskbar>
      <skip_pager>yes</skip_pager>
      <layer>below</layer>
      <position>
        <x>center</x>
        <y>0</y>
      </position>
      <focus>no</focus>
      <desktop>all</desktop>
    </application>

restart X and "Hey, presto" wink This assumes you know how to make your term transparent...

if you use class="urxvt" instead of name="xxxx"
then u don't have to specify a name for urxvt
this just can make all urxvt no decoration

Offline

#24 2009-04-06 19:50:04

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: urxvt as background desktop

um... http://wiki.archlinux.org/index.php/Ope … background

it took 23 posts for that link to come up?

Offline

#25 2009-05-10 07:09:48

zephyrus17
Member
Registered: 2008-06-15
Posts: 323

Re: urxvt as background desktop

That archwiki link doesn't work for me. I tried it. And it shows the same symptoms sunv describes in post 5. Can't type in it, font is pink, can't move it, it stays on top, and can't be Alt-F4ed.

I haven't tried the devilspie method. Do I need xcompmgr for this?

Offline

Board footer

Powered by FluxBB