--ignore-screen (-i) flag added.

This commit is contained in:
Storm Dragon 2025-06-06 22:58:08 -04:00
parent a742c12cd8
commit 0930a86ce7
6 changed files with 27 additions and 0 deletions

View File

@ -511,6 +511,7 @@ fenrir [OPTIONS]
- `-e, --emulated-pty` - Use PTY emulation with escape sequences for input (enables desktop/X/Wayland usage) - `-e, --emulated-pty` - Use PTY emulation with escape sequences for input (enables desktop/X/Wayland usage)
- `-E, --emulated-evdev` - Use PTY emulation with evdev for input (single instance) - `-E, --emulated-evdev` - Use PTY emulation with evdev for input (single instance)
- `-F, --force-all-screens` - Force Fenrir to respond on all screens, ignoring ignoreScreen setting - `-F, --force-all-screens` - Force Fenrir to respond on all screens, ignoring ignoreScreen setting
- `-i, -I, --ignore-screen SCREEN` - Ignore specific screen(s). Can be used multiple times. Combines with existing ignore settings.
### Examples: ### Examples:
```bash ```bash
@ -525,6 +526,10 @@ sudo fenrir -o "speech#rate=0.8;sound#volume=0.5"
# Force Fenrir to work on all screens (ignore ignoreScreen setting) # Force Fenrir to work on all screens (ignore ignoreScreen setting)
sudo fenrir -F sudo fenrir -F
# Ignore specific screens
sudo fenrir --ignore-screen 1
sudo fenrir -i 1 -i 2 # Ignore screens 1 and 2
``` ```
## Localization ## Localization

View File

@ -65,6 +65,10 @@ Use PTY emulation with evdev for input (single instance mode).
.BR \-F ", " \-\-force-all-screens .BR \-F ", " \-\-force-all-screens
Force Fenrir to respond on all screens, ignoring the ignoreScreen setting. This temporarily overrides screen filtering for the current session. Force Fenrir to respond on all screens, ignoring the ignoreScreen setting. This temporarily overrides screen filtering for the current session.
.TP
.BR \-i ", " \-I ", " \-\-ignore-screen " \fISCREEN\fR"
Ignore specific screen(s). Can be used multiple times to ignore multiple screens. This is equivalent to setting ignoreScreen in the configuration file and will be combined with any existing ignore settings.
.SH KEY CONCEPTS .SH KEY CONCEPTS
.SS Fenrir Key .SS Fenrir Key

View File

@ -1240,6 +1240,9 @@ Use PTY emulation with evdev for input (single instance mode).
`+-F, --force-all-screens+`:: `+-F, --force-all-screens+`::
Force Fenrir to respond on all screens, ignoring the ignoreScreen setting. This temporarily overrides screen filtering for the current session. Force Fenrir to respond on all screens, ignoring the ignoreScreen setting. This temporarily overrides screen filtering for the current session.
`+-i, -I, --ignore-screen <SCREEN>+`::
Ignore specific screen(s). Can be used multiple times to ignore multiple screens. This is equivalent to setting ignoreScreen in the configuration file and will be combined with any existing ignore settings.
==== Set settings options ==== Set settings options
You can specify options that overwrite the setting.conf. This is done You can specify options that overwrite the setting.conf. This is done

View File

@ -297,6 +297,7 @@ fenrir [OPTIONS]
- `-e, --emulated-pty` - PTY emulation for desktop use - `-e, --emulated-pty` - PTY emulation for desktop use
- `-E, --emulated-evdev` - PTY + evdev emulation - `-E, --emulated-evdev` - PTY + evdev emulation
- `-F, --force-all-screens` - Ignore ignoreScreen setting - `-F, --force-all-screens` - Ignore ignoreScreen setting
- `-i, -I, --ignore-screen SCREEN` - Ignore specific screen(s), can be used multiple times
## Troubleshooting ## Troubleshooting

View File

@ -72,6 +72,12 @@ def create_argument_parser():
action='store_true', action='store_true',
help='Force Fenrir to respond on all screens, ignoring ignoreScreen setting' help='Force Fenrir to respond on all screens, ignoring ignoreScreen setting'
) )
argumentParser.add_argument(
'-i', '-I', '--ignore-screen',
metavar='SCREEN',
action='append',
help='Ignore specific screen(s). Can be used multiple times. Same as ignoreScreen setting.'
)
return argumentParser return argumentParser
def validate_arguments(cliArgs): def validate_arguments(cliArgs):

View File

@ -321,6 +321,14 @@ class settingsManager():
if cliArgs.force_all_screens: if cliArgs.force_all_screens:
environment['runtime']['force_all_screens'] = True environment['runtime']['force_all_screens'] = True
if cliArgs.ignore_screen:
currentIgnoreScreen = self.getSetting('screen', 'ignoreScreen')
if currentIgnoreScreen:
ignoreScreens = currentIgnoreScreen.split(',') + cliArgs.ignore_screen
else:
ignoreScreens = cliArgs.ignore_screen
self.setSetting('screen', 'ignoreScreen', ','.join(ignoreScreens))
if not os.path.exists(self.getSetting('sound','theme') + '/soundicons.conf'): if not os.path.exists(self.getSetting('sound','theme') + '/soundicons.conf'):
if os.path.exists(soundRoot + self.getSetting('sound','theme')): if os.path.exists(soundRoot + self.getSetting('sound','theme')):
self.setSetting('sound', 'theme', soundRoot + self.getSetting('sound','theme')) self.setSetting('sound', 'theme', soundRoot + self.getSetting('sound','theme'))