xrandr, alternative Linux à nircmd
Mis à jour le
Notre avis
xrandr is a strong replacement for the display management aspects of nircmd, but it does not cover the full scope. If your primary use case is scripting monitor resolution, rotation, or layout changes, xrandr is the standard, lightweight tool for X11 environments. However, it lacks capabilities for window manipulation, volume control, or input simulation. For users who only need display configuration automation, it is an excellent fit. For those relying on nircmd for system-wide automation involving windows or audio, you will need to combine xrandr with other tools like wmctrl, amixer, or xdotool to achieve full parity.
- Licence
- MIT
- Prix
- Gratuit
- Dernière version
- 1.5.4
- Note
- —
Ce qui fonctionne pareil
- Both are lightweight command-line tools designed for scripting and automation.
- Both allow dynamic changes to display settings like resolution and orientation.
- Both support querying the current state of the system configuration.
- Both are suitable for use in bash or sh scripts.
Ce qui change
- xrandr only manages display outputs and does not handle window management (move, resize, focus).
- xrandr lacks any functionality for system volume control or audio settings.
- xrandr cannot simulate keyboard or mouse input events.
- xrandr is specific to X11, whereas nircmd works across various Windows versions without such protocol constraints.
- xrandr does not set wallpaper or background images.
Ouvrir vos fichiers nircmd
There is no file compatibility between nircmd and xrandr. nircmd is a single executable that accepts arguments, while xrandr is a separate binary with its own syntax. Any scripts written for nircmd must be manually rewritten to use xrandr commands for display tasks and other Linux tools for non-display tasks. There are no import or export files to migrate.
Passer de nircmd à xrandr, étape par étape
- Install xrandr using your package manager, e.g., sudo apt install xrandr or sudo dnf install xrandr.
- Replace nircmd display commands with xrandr equivalents, such as using xrandr --output HDMI-1 --mode 1920x1080.
- Identify alternative tools for missing features, such as wmctrl for windows and amixer for volume.
- Rewrite your shell scripts to call these specific Linux utilities instead of the single nircmd binary.
- Test your scripts in a non-critical environment to ensure display changes apply correctly.
Fonctionnalités clés de xrandr
- Modifier dynamiquement la résolution d'écran
- Activer ou désactiver les sorties d'affichage
- Pivoter les écrans (normal, inversé, gauche, droite)
- Définir des positions personnalisées d'écran (à gauche de, à droite de, etc.)
- Répliquer ou étendre les affichages
- Prise en charge de plusieurs moniteurs
- Scripting et automatisation en ligne de commande
- Interroger la configuration d'affichage actuelle
Installer xrandr sous Linux
sudo dnf install xrandrsudo pacman -S xorg-xrandrsudo zypper install xrandrQuestions fréquentes
Can xrandr control which monitor is primary?
Yes, you can use the --primary flag with the output name to designate a specific monitor as the primary display.
Does xrandr work on Wayland?
No, xrandr is an X11 tool. It generally does not function on pure Wayland sessions. You would need to use the wlr-randr tool on wlroots-based compositors or other Wayland-specific utilities.
How do I find my monitor names for xrandr?
Run xrandr without any arguments. The output will list all connected outputs, such as VGA-1, HDMI-1, or DP-2, along with their current status and available resolutions.