マニュアルページで見つけることができません。
debian スクイーズ ミラーの rxvt-unicode-256color を使用しています。
Gnome 3 環境、xorg.conf で有効化されたコンポジット。
5 に答える
wmctrlをインストール
$ sudo apt-get install wmctrl
拡張ディレクトリを作成する
$ mkdir -p ~/.urxvt/ext/
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` ; } }
プラグインを有効にする
$ vi ~/.Xdefaults ... " Fullscreen switch URxvt.perl-ext-common: fullscreen URxvt.keysym.F11: perl:fullscreen:switch
これで、F11 キーでフルスクリーンに切り替えることができます。
参照:
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 の呼び出しを遅らせる必要がありました。
ログイン時にフルスクリーンに直接移動するには、これを my の最後に置きます~/.bashrc
:
[[ $TERM == *"rxvt"* ]] && wmctrl -r :ACTIVE: -b add,fullscreen
Chu-Siang Laiの回答に従って、それがインストールされていることを確認する必要がありますwmctrl
。
これが私が解決した方法です
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" &!
私が知る限り、あなたはできません。しかし、回避策を見つけました:
使用する
wmctrl -l
rxvt
ウィンドウの名前を調べるには。おそらく「rxvt」なので、
wmctrl -r rxvt -b toggle,fullscreen
そのウィンドウを最大化します。
これ (2 番目のコマンド) をスクリプトに入れる必要があります。このスクリプトは、ウィンドウ マネージャー (openbox、metacity など) が読み込まれた後に読み込まれます。おそらく、あなたの.xinitrc
ファイルに。