Add --list-profiles and --list-layouts options

This commit is contained in:
Vulcalien 2021-09-09 11:48:19 +02:00
parent 40a2bb3843
commit 8f41308cb2
1 changed files with 13 additions and 0 deletions

View File

@ -18,7 +18,9 @@
import sys import sys
import os import os
# FIXME optparse is deprecated - argparse be used instead
from optparse import OptionParser, SUPPRESS_HELP from optparse import OptionParser, SUPPRESS_HELP
from terminatorlib.terminator import Terminator
from .util import dbg, err from .util import dbg, err
from . import util from . import util
from . import config from . import config
@ -104,6 +106,10 @@ icon for the window (by file or name)'))
help=_('If Terminator is already running, just open a new tab')) help=_('If Terminator is already running, just open a new tab'))
parser.add_option('--unhide', action='store_true', dest='unhide', parser.add_option('--unhide', action='store_true', dest='unhide',
help=_('If Terminator is already running, just unhide all hidden windows')) help=_('If Terminator is already running, just unhide all hidden windows'))
parser.add_option('--list-profiles', action='store_true', dest='list_profiles',
help=_('List all profiles'))
parser.add_option('--list-layouts', action='store_true', dest='list_layouts',
help=_('List all layouts'))
for item in ['--sm-client-id', '--sm-config-prefix', '--screen', '-n', for item in ['--sm-client-id', '--sm-config-prefix', '--screen', '-n',
'--no-gconf' ]: '--no-gconf' ]:
@ -119,6 +125,13 @@ icon for the window (by file or name)'))
print('%s %s' % (version.APP_NAME, version.APP_VERSION)) print('%s %s' % (version.APP_NAME, version.APP_VERSION))
sys.exit(0) sys.exit(0)
if options.list_profiles:
print(Terminator().config.list_profiles())
sys.exit(0)
if options.list_layouts:
print(Terminator().config.list_layouts())
sys.exit(0)
if options.debug_classes or options.debug_methods: if options.debug_classes or options.debug_methods:
if not options.debug > 0: if not options.debug > 0:
options.debug = 1 options.debug = 1