XPLUGD(1)
π XPLUGD(1) β the plug-in/plug-out bestie π
ok so this is the manual page for xplugd, from the User's Reference Manual, and honestly? she's a little icon. let's get into it π«Ά
β¨ NAME β¨
xplugd β an X input/output plug in/out helper π
like, literally a helper for when stuff gets plugged in and unplugged.
πΈ SYNOPSIS πΈ
xplugd [-hnpsv] [-l LEVEL] [FILE]
π¦ DESCRIPTION π¦
okay so xplugd is a daemon that runs a script whenever your X input and RandR stuff changes β i.e. when a keyboard, mouse, or monitor gets plugged in or unplugged. no cap, that's the whole vibe check. π
it's useful if you wanna run xrandr(1), xinput(1), or setxkbmap(1) when you're docking or undocking a laptop. the way that just works?? obsessed.
by default, xplugd forks to the background and exits when the X server exits. periodt. β¨
π OPTIONS π
-hβ print help and exit. short and sweet, she ate π-lLVL β set the log level for syslog messages, where LVL is one of:none,err,info,notice,debug. use-l debugto enable debug messages. default:noticeπ-nβ run in foreground, do not detach from the calling terminal and fork to background. main character energy, staying right there π-pβ probe currently connected outputs and output EDID info πβ¨-sβ use syslog, even if running in foreground, default without-nπ-vβ show version information and exit π
so the optional FILE argument defaults to $XDG_CONFIG_HOME/xplugrc, with fallbacks to ~/.config/xplugrc and ~/.xplugrc. the file gets called as a script on plug events with these arguments, and yes bestie, every single one matters:
$1= TYPE β one ofdisplay|keyboard|pointer$2= DEVICE β usuallyHDMI3,LVDS1,VGA1, or anxinput(1)device number$3= STATUS β one ofconnected|disconnected|unknown$4= DESCRIPTION β an optional description enclosed in double quotes, e.g., keyboard (manufacturer and) model name, or if EDID data is available from a connected display, the monitor model
π EXAMPLE π
here's an example of how to use xplugd β lowkey the cutest part of the whole page:
xplugd
when xplugd starts it looks for the file ~/.config/xplugrc, which may look something like this:
#!/bin/sh
type=$1
device=$2
status=$3
desc=$4
case "$type,$device,$status,$desc" in
display,DVI-0,connected,*)
xrandr --output DVI-0 --auto --right-of LVDS
;;
display,VGA-0,connected,*)
xrandr --output VGA-0 --auto --left-of LVDS
;;
pointer,*,connected,"SynPS/2 Synaptics TouchPad")
xinput set-prop $device 'Synaptics Off' 1
;;
keyboard,*connected,*)
setxkbmap -option ctrl:nocaps
;;
esac
iykyk π₯
π§ FILES π§
$XDG_CONFIG_HOME/xplugrcβ Primary path π~/.config/xplugrcβ Secondary path β¨~/.xplugrcβ Fallback path, for compat with earlier releases π«Ά
β SEE ALSO β
- β¨http://bitbucket.org/portix/srandrdβ©
- β¨https://bitbucket.org/andrew_shadura/inputplugβ©
- β¨https://github.com/troglobit/xplugdβ©
πΈ AUTHORS πΈ
xplugd was created by Joachim Nilsson in 2016 for use with window managers like awesome(1) and i3(1). it would however not exist if not for the hard work of Stefan Bolte with srandrd and Andrew Shadura with inputplug. legends only, fr fr π
and that's the whole thing bestie, no notes π
signing off from the Debian edition, dated Jul 8, 2020 β mwah, slay, see u in the group chat ππβ¨
π¦ where this page comes from
- nixos 26.05: xplugd 1.4
- nixpkgs unstable: xplugd 1.4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms