<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.archlinux.jp/index.php?action=history&amp;feed=atom&amp;title=Kanshi</id>
	<title>Kanshi - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.archlinux.jp/index.php?action=history&amp;feed=atom&amp;title=Kanshi"/>
	<link rel="alternate" type="text/html" href="https://wiki.archlinux.jp/index.php?title=Kanshi&amp;action=history"/>
	<updated>2026-04-11T20:09:46Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.44.3</generator>
	<entry>
		<id>https://wiki.archlinux.jp/index.php?title=Kanshi&amp;diff=41350&amp;oldid=prev</id>
		<title>Kgx: 翻訳</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.jp/index.php?title=Kanshi&amp;diff=41350&amp;oldid=prev"/>
		<updated>2026-02-20T05:51:17Z</updated>

		<summary type="html">&lt;p&gt;翻訳&lt;/p&gt;
&lt;a href=&quot;https://wiki.archlinux.jp/index.php?title=Kanshi&amp;amp;diff=41350&amp;amp;oldid=41345&quot;&gt;差分を表示&lt;/a&gt;</summary>
		<author><name>Kgx</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.jp/index.php?title=Kanshi&amp;diff=41345&amp;oldid=prev</id>
		<title>2026年2月17日 (火) 07:22にKgxによる</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.jp/index.php?title=Kanshi&amp;diff=41345&amp;oldid=prev"/>
		<updated>2026-02-17T07:22:03Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年2月17日 (火) 16:22時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;1行目:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;1行目:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Lowercase title}}&lt;/div&gt;&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-added&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Wayland]]&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Wayland]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[en:Kanshi]]&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[en:Kanshi]]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Kgx</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.jp/index.php?title=Kanshi&amp;diff=41343&amp;oldid=prev</id>
		<title>Kgx: 英語版から転載</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.jp/index.php?title=Kanshi&amp;diff=41343&amp;oldid=prev"/>
		<updated>2026-02-17T07:18:47Z</updated>

		<summary type="html">&lt;p&gt;英語版から転載&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Lowercase title}}&lt;br /&gt;
[[Category:Wayland]]&lt;br /&gt;
[[en:Kanshi]]&lt;br /&gt;
[[zh-hans:Kanshi]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|Sway}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
[https://gitlab.freedesktop.org/emersion/kanshi kanshi] allows you to define output profiles that are automatically enabled and disabled on hotplug. For instance, this can be used to turn a laptop&amp;#039;s internal screen off when docked.&lt;br /&gt;
&lt;br /&gt;
This is a Wayland equivalent for tools like [https://github.com/phillipberndt/autorandr autorandr]. kanshi can be used on Wayland compositors supporting the wlr-output-management protocol.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
[[Install]] {{Pkg|kanshi}} or {{AUR|kanshi-git}}.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Basic ===&lt;br /&gt;
&lt;br /&gt;
Create kanshi configuration file:&lt;br /&gt;
&lt;br /&gt;
{{hc|1=~/.config/kanshi/config|2=&lt;br /&gt;
profile {&lt;br /&gt;
	output LVDS-1 disable&lt;br /&gt;
	output &amp;quot;Some Company ASDF 4242&amp;quot; mode 1600x900 position 0,0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
profile {&lt;br /&gt;
	output LVDS-1 enable scale 2&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Each output profile is delimited by brackets. It contains several output directives (whose syntax is similar to {{man|5|sway-output}}). A profile will be enabled if all of the listed outputs are connected.&lt;br /&gt;
&lt;br /&gt;
{{Tip|You can get a list of output names and additional information using commands like {{ic|wlr-randr}}, {{ic|swaymsg -t get_outputs}} or use the GUI applications {{AUR|wdisplays-git}} or {{AUR|wdisplays-persistent}} which will write also directly to kanshi&amp;#039;s configuration file.}}&lt;br /&gt;
&lt;br /&gt;
=== Advanced ===&lt;br /&gt;
&lt;br /&gt;
For easier management of multiple setups &amp;#039;&amp;#039;(e.g. Internal laptop monitor only, Docked to one monitor at home, Docked to two work monitors, ...)&amp;#039;&amp;#039; you can define defaults for the outputs used inside profiles and assign them aliases. The defaults will apply to all profiles where the respective output is mentioned. For more see {{man|5|kanshi}}).&lt;br /&gt;
&lt;br /&gt;
{{hc|1=~/.config/kanshi/config|2=&lt;br /&gt;
output &amp;quot;Dell Inc. DELL S2721DGF G52TR83&amp;quot; {&lt;br /&gt;
  mode 2560x1440@165.08&lt;br /&gt;
  position 1280,0&lt;br /&gt;
  scale 2&lt;br /&gt;
  alias $HOME_1&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
output &amp;quot;LG Display 0x058B Unknown&amp;quot; {&lt;br /&gt;
  mode 2560x1440@59.99800&lt;br /&gt;
  position 0,0&lt;br /&gt;
  scale 2&lt;br /&gt;
  alias $INTERNAL&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
profile home_1 {&lt;br /&gt;
  output $INTERNAL disable&lt;br /&gt;
  output $HOME_1 enable&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
You can find out these values with a command like [https://wiki.hyprland.org/Configuring/Using-hyprctl/ hyprctl monitors] which will display all three of those in its output.&lt;br /&gt;
&lt;br /&gt;
{{hc|1=hyprctl monitors|2=&lt;br /&gt;
make: LG Display&lt;br /&gt;
model: 0x058B&lt;br /&gt;
serial:&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
It is also possible to further integrate kanshi with your workflow by using the &amp;#039;&amp;#039;exec&amp;#039;&amp;#039; directive to execute a command once the profile was successfully applied.&lt;br /&gt;
&lt;br /&gt;
{{hc|1=~/.config/kanshi/config|2=&lt;br /&gt;
profile home_1 {&lt;br /&gt;
  output $INTERNAL disable&lt;br /&gt;
  output $HOME_1 enable&lt;br /&gt;
  exec uwsm app -- $HOME/.config/hypr/scripts/move-workspaces.sh &amp;quot;LG Display 0x058B&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Run the command:&lt;br /&gt;
&lt;br /&gt;
 $ kanshi&lt;br /&gt;
&lt;br /&gt;
See [[#Manage kanshi with systemd]] for an automated usage.&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Manage kanshi with systemd ===&lt;br /&gt;
&lt;br /&gt;
Create and start {{ic|~/.config/systemd/user/sway-session.target}} (if you don&amp;#039;t have created yet) by following [[Sway#Manage Sway-specific daemons with systemd]].&lt;br /&gt;
&lt;br /&gt;
Create the {{ic|kanshi.service}} file:&lt;br /&gt;
&lt;br /&gt;
{{hc|1=~/.config/systemd/user/kanshi.service|2=&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Dynamic output configuration for Wayland compositors&lt;br /&gt;
Documentation=man:kanshi(1)&lt;br /&gt;
BindsTo=sway-session.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/bin/kanshi&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=sway-session.target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Enable]] this [[user unit]]. It is only activated when Sway is running and deactivated when Sway stops.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Workspace number starts from 2 in external monitor after wake up ===&lt;br /&gt;
&lt;br /&gt;
If you have a configuration like [[#Configuration|above]], when you connected a second display to your computer, the workspace in the second display should start from 1 since the first display is disabled. This should be the case when you plugged your monitor in the first time or after starting the system. But after sleep, this number might be 2. In this case just move the first workspace to this monitor by adding a directive to the kanshi configuration file:&lt;br /&gt;
&lt;br /&gt;
{{hc|1=~/.config/kanshi/config|2=&lt;br /&gt;
profile {&lt;br /&gt;
	output LVDS-1 disable&lt;br /&gt;
	output &amp;quot;Some Company ASDF 4242&amp;quot; mode 1600x900 position 0,0&lt;br /&gt;
	# We&amp;#039;ve added this directive here (do not forget to update the output name):&lt;br /&gt;
	exec swaymsg workspace 1, move workspace to HDMI-A-1&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
profile {&lt;br /&gt;
	output LVDS-1 enable scale 2&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://gitlab.freedesktop.org/emersion/kanshi Source code and documentation]&lt;/div&gt;</summary>
		<author><name>Kgx</name></author>
	</entry>
</feed>