completions: Add support for lightdm and dm-tool commands (#7624)

This commit is contained in:
Ben Woods 2021-01-13 21:37:42 +08:00 committed by GitHub
parent 1d1e8a54a0
commit 1890c848e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,16 @@
# Completions for the dm-tool command (part of the lightdm display manager)
set -l cmds 'add-local-x-seat add-nested-seat add-seat list-seats lock switch-to-greeter switch-to-guest switch-to-user'
complete -c dm-tool -f
complete -c dm-tool -n "not __fish_seen_subcommand_from $cmds" -s h -l help -x -d "Show help options"
complete -c dm-tool -n "not __fish_seen_subcommand_from $cmds" -s v -l version -x -d "Show release version"
complete -c dm-tool -n "not __fish_seen_subcommand_from $cmds" -l session-bus -d "Connect using the session bus"
complete -c dm-tool -n "not __fish_seen_subcommand_from $cmds" -xa "$cmds"
# switch-to-user
set -l session_users "(dm-tool list-seats | string replace -rf '.*UserName=' '' | string trim -c '\'')"
set -l has_user "__fish_seen_subcommand_from $session_users"
complete -c dm-tool -n "__fish_seen_subcommand_from switch-to-user; and not $has_user" -xa "$session_users"

View File

@ -0,0 +1,14 @@
# Completions for the lightdm command
complete -c lightdm -f
complete -c lightdm -s h -l help -x -d "Show help options"
complete -c lightdm -s c -l config -r -F -d "Use configuration file"
complete -c lightdm -s d -l debug -d "Print debugging messages"
complete -c lightdm -l test-mode -d "Skip things requiring root access"
complete -c lightdm -l pid-file -r -F -d "File to write PID into"
complete -c lightdm -l xsessions-dir -r -F -d "Directory to load X sessions from"
complete -c lightdm -l xgreeters-dir -r -F -d "Directory to load X greeters from"
complete -c lightdm -l log-dir -r -F -d "Directory to write logs to"
complete -c lightdm -l run-dir -r -F -d "Directory to store running state"
complete -c lightdm -l cache-dir -r -F -d "Directory to cache information"
complete -c lightdm -s v -l version -x -d "Show release version"