0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

debian trixieで、2in1(タブレットモード/ノートPC)のモニタ回転を手動で切り替える

Posted at

■debian trixieで、2in1(タブレットモード/ノートPC)のモニタ回転を手動で切り替える
 ディスプレイと呼ぶかモニタと呼ぶかは置いといて

$ lsb_release -d
Description:	Debian GNU/Linux 13 (trixie)

■ジャイロもなく自動回転はしないので、コマンド化
 yokoは右90度回転のメインのPCモード
 tateはデフォルトの読書モード
 gyakuは左90度回転のタブレットモード

$ ls {yoko,tate,gyaku} | awk '{print "echo \042["$0"]\042;cat "$0}' | sh
[gyaku]
#!/bin/bash

xrandr -o left
xinput set-prop '9' 'Coordinate Transformation Matrix'  0 -1 1 1 0 0 0 0 1
[tate]
#!/bin/bash

xrandr -o normal
xinput set-prop '9' 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
[yoko]
#!/bin/bash

xrandr -o right
xinput set-prop '9' 'Coordinate Transformation Matrix'  0 1 0 -1 0 1 0 0 1

■パネルに追加でモニタを360度回転させたときのために、
 キーボードを無効化・再有効化をタップで切り替えるショートカットを作成する

$ xinput list | grep keyboard.*id=
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=13	[slave  keyboard (3)]

$ xinput disable 13
$ xinput enable 13
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?