12

マニュアルページで見つけることができません。
debian スクイーズ ミラーの rxvt-unicode-256color を使用しています。
Gnome 3 環境、xorg.conf で有効化されたコンポジット。

4

5 に答える 5

19
  1. wmctrlをインストール

    $ sudo apt-get install wmctrl
    
  2. 拡張ディレクトリを作成する

    $ mkdir -p ~/.urxvt/ext/
    
  3. 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. プラグインを有効にする

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

これで、F11 キーでフルスクリーンに切り替えることができます。


参照:

于 2013-05-23T07:15:49.667 に答える
2

urxvt をフルスクリーン モードで起動する単純な perl プラグインを次に示します (追加のキーを押す必要はありません)。

#!/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;
}

残念ながら、呼び出されたときにウィンドウが wmctrl に表示されないようですon_start。そのため、タイマーを使用して、ウィンドウが存在するまで wmctrl の呼び出しを遅らせる必要がありました。

于 2017-05-30T05:56:59.873 に答える
1

ログイン時にフルスクリーンに直接移動するには、これを my の最後に置きます~/.bashrc:

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

Chu-Siang Lai回答に従って、それがインストールされていることを確認する必要がありますwmctrl

于 2015-04-30T12:48:56.353 に答える
0

これが私が解決した方法です

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
### ======================================================

これで、zsh でurxvt を実行urxvtmaxedまたは起動して、ウィンドウのサイズを変更できます。urxvtfull

注: ウィンドウの制御は Wayland のセキュリティ ポリシーに反するため、wmctrl は Wayland セッションでは正しく機能しません。

If $WINDOWID is available

urxvt -e zsh -c "RUN='wmctrl -i -r \$WINDOWID -b add,fullscreen' zsh" &!
于 2018-10-25T13:25:24.613 に答える
-1

私が知る限り、あなたはできません。しかし、回避策を見つけました:

使用する

wmctrl -l

rxvtウィンドウの名前を調べるには。おそらく「rxvt」なので、

wmctrl -r rxvt -b toggle,fullscreen

そのウィンドウを最大化します。

これ (2 番目のコマンド) をスクリプトに入れる必要があります。このスクリプトは、ウィンドウ マネージャー (openbox、metacity など) が読み込まれた後に読み込まれます。おそらく、あなたの.xinitrcファイルに。

于 2012-11-10T00:52:06.833 に答える