May 3, 2024 - 8:26 UTC

April 8, 2021 - 14:35 UTC

URxvt fullscreen keybinding

Found this on StackOverflow, turns out to be very useful. I'd been using xfce4-terminal for a long time. Then I installed Bunsenlabs linux on an old Dell Dimension 9200, which is a 32-bit Intel Core 2 Duo. It's default terminal is urxvt, so I started tweaking it. One thing I missed was the F11 keybinding which gave me full screen. It's worth posting here:

## Install wmctrl

$ sudo apt-get install wmctrl

## Create a directory for the extension

$ mkdir -p ~/.urxvt/ext

## Create a plugin for URxvt

$ 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` ;
    }
}

## Enable the plugin

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

## Reload .Xresources

$ xrdb -merge  ~/.Xresources

 

Credit: Chu-Siang Lai - https://tx0.org/cy