How to use the command mons (with examples)
- Linux
- December 25, 2023
Mons is a tool that allows users to easily manage two displays. It provides several command line options to enable, disable, duplicate, or mirror displays.
Use case 1: Enable only the primary monitor
Code:
mons -o
Motivation: This use case is useful when you want to work on your primary monitor only and disable the secondary monitor. It helps to avoid distractions and focus on tasks that require your full attention.
Explanation: The -o
option stands for “only” and tells the mons command to enable only the primary monitor.
Example output: The primary monitor is enabled, and the secondary monitor is disabled.
Use case 2: Enable only the secondary monitor
Code:
mons -s
Motivation: This use case is helpful when you want to switch your attention to the secondary monitor and work exclusively on it. It can be useful for various tasks such as presentations, monitoring systems, or using extended workspace.
Explanation: The -s
option stands for “secondary” and instructs the mons command to enable only the secondary monitor.
Example output: The primary monitor is disabled, and the secondary monitor is enabled.
Use case 3: Duplicate the primary monitor onto the secondary monitor, using the resolution of the primary monitor
Code:
mons -d
Motivation: This use case is suitable when you want to display the same content on both monitors, precisely duplicating the primary monitor onto the secondary monitor. It can be useful for presentations or situations where you need to show the same information on multiple screens.
Explanation: The -d
option stands for “duplicate,” and it commands the mons tool to duplicate the primary monitor onto the secondary monitor, using the resolution of the primary monitor.
Example output: The content of the primary monitor is replicated on the secondary monitor.
Use case 4: Mirror the primary monitor onto the secondary monitor, using the resolution of the secondary monitor
Code:
mons -m
Motivation: This use case is valuable when you need to mirror the contents of the primary monitor onto the secondary monitor. It can be helpful in situations where you want to monitor the same content on multiple screens, such as monitoring systems or presentations.
Explanation: The -m
option stands for “mirror,” and it instructs the mons command to mirror the primary monitor onto the secondary monitor, using the resolution of the secondary monitor.
Example output: The content of the primary monitor is mirrored on the secondary monitor, using the resolution of the secondary monitor.
Conclusion
The mons command provides simple and efficient control over your displays. It allows you to enable or disable monitors, duplicate or mirror the content, offering flexibility and versatility. Whether you need to focus on one monitor, utilize extended workspace, or present information on multiple screens, the mons tool is a valuable addition to your workflow.