12

I can't find it within man page.
I am using rxvt-unicode-256color from debian squeeze mirror.
Gnome 3 environment, composite enabled in xorg.conf.

hero2008
  • 611
  • 6
  • 16

5 Answers5

19
  1. Install wmctrl

    $ sudo apt-get install wmctrl
    
  2. Create the extension directory

    $ mkdir -p ~/.urxvt/ext/
    
  3. Create a plugin for Rxvt

    $ vi ~/.urxvt/ext/fullscreen
    #!perl
    sub on_user_command {
        my ($self, $cmd) = @_;
        if ($cmd eq "fullscreen:switch") {
            my $dummy = `wmctrl -r :ACTIVE: -b toggle,fullscreen` ;
        }
    }
    
  4. Enable the plugin

    $ vi ~/.Xdefaults
    ...
    " Fullscreen switch
    URxvt.perl-ext-common:  fullscreen
    URxvt.keysym.F11:       perl:fullscreen:switch
    

Now, you can toggle fullscreen with the F11 key.


Reference:

Chu-Siang Lai
  • 2,658
  • 1
  • 24
  • 21
  • 1
    This doesn't start rxvt as fullscreen. It just adss a hotkey to make it fullscreen, which is also possible using most window managers. I tried a similar approach but with on_start instead of on_user_command, with no luck. – Thayne May 30 '17 at 04:50
2

to go straight to fullscreen at login i put this at the end of my ~/.bashrc:

[[ $TERM == *"rxvt"* ]] && wmctrl -r :ACTIVE: -b add,fullscreen

as per Chu-Siang Lai's answer you need to make sure that wmctrl is installed.

Community
  • 1
  • 1
mulllhausen
  • 4,225
  • 7
  • 49
  • 71
2

Here is a simple perl plugin that will start urxvt in fullscreen mode (without requiring you to press an additional key):

#!/usr/bin/perl

sub on_start {
  my ($self) = @_;
  # This is hacky, but there doesn't seem to be an event after 
  # window creation
  $self->{timer} = urxvt::timer->new->after(0.1)->cb(sub {
      fullscreen $self
    });
  return;
}

sub fullscreen {
  my ($self) = @_;
  my $wid = $self->parent;
  my $err = `wmctrl -i -r $wid -b add,fullscreen`;
  warn "Error maximizing: $err\n" unless $? == 0;
  $self->{timer}->stop;
  delete $self->{timer};
  return;
}

Unfortunately, it seems that the window isn't visible to wmctrl when on_start is called, so I had to use a timer to delay the call to wmctrl until the window exists.

Thayne
  • 6,619
  • 2
  • 42
  • 67
0

This is how I solved

running window settings after invoking urxvt.

Shell: zsh
Windowmanager: wmctrl

.zsrch

function urxvtmaxed () {
    # &! is a zsh-specific shortcut to both background and disown the process
    urxvt -e zsh -c "RUN='wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz' zsh" &!
}

function urxvtfull () {
    # &! is a zsh-specific shortcut to both background and disown the process
    urxvt -e zsh -c "RUN='wmctrl -r :ACTIVE: -b add,fullscreen' zsh" &!
}

### ======================================================
### Run Commands After zsh invoked

eval "$RUN"

# Example
# RUN='my_prog opt1 opt2' zsh

### Run Commands After zsh invoked END
### ======================================================

Now in zsh you can run urxvtmaxed or urxvtfull to launch urxvt and then resizing the window.

Note: wmctrl doesn't work properly in a Wayland session as controlling windows is against Wayland's security policy.

If $WINDOWID is available

urxvt -e zsh -c "RUN='wmctrl -i -r \$WINDOWID -b add,fullscreen' zsh" &!
The Demz
  • 7,066
  • 5
  • 39
  • 43
-1

You can't, as far as I know. But, I found a workaround:

Use

wmctrl -l

to find out what your rxvt window is named. Probably, its "rxvt", so

wmctrl -r rxvt -b toggle,fullscreen

will maximize that window.

You'll have to put this (the second command) in a script, that is read after your window manager (e.g., openbox, metacity) is loaded. Possibly, in your .xinitrc file.

Emanuel Berg
  • 499
  • 4
  • 14
  • Thank you. Now i'm using tiling window manager, i think it makes life easier. – hero2008 Nov 11 '12 at 01:54
  • @Yannbane: They can be, but are they for `rxvt`? I used this for `urxvt` and it worked. If the title does change for `rxvt`, you could write a script that greps the line, and feeds the `wmctrl` function with the correct title. – Emanuel Berg Jul 04 '13 at 19:18
  • Sure, grep would work. And I'm not sure about `rxvt`. It doesn't have consistent titles on my system either, so maybe you could update your answer? I'd gladly remove the -1... – corazza Jul 04 '13 at 19:28
  • the current window name is `:ACTIVE:` – mulllhausen Apr 30 '15 at 12:51