5 # Email : hayao@fascode.net
7 # (c) 2019-2021 Fascode Network.
11 # LICENSE: THE SUSHI-WARE LICENSE
12 # https://github.com/MakeNowJust/sushi-ware
16 # https://qiita.com/laikuaut/items/4bc07eabce56ee30812d
17 # https://qiita.com/t_nakayama0714/items/80b4c94de43643f4be51
20 echo "usage: dmc [options] [command]"
22 echo "A simple tool for switching LightDM Greeters"
24 echo " LightDM command:"
25 echo " autologin [username] [session] Set up automatic login (with blank username to disable)"
26 echo " greeter Run greeter setup wizard"
27 echo " greeter-create [file] Set the specified executable file as Greeter"
28 echo " greeter-change [greeter] Specify the greeter to use"
29 echo " greeter-edit [greeter] Edit the greeter configs"
30 echo " greeter-list Show a list of currently installed Greeters"
31 echo " remove Removes all changes made by this command"
32 echo " edit Edit lightdm config"
33 echo " show-config Show current settings"
36 echo " autologin [username] [session] Set up automatic login (with blank username to disable)"
37 echo " cursor Run cursor selection wizard"
38 echo " cursor-change [cursor] Specify the cursor theme"
39 echo " cursor-list Show a list of cursor theme"
40 echo " sound [true or false] Toggle the sound when an event occurs"
41 echo " logo [image] Specify the logo of the login screen"
42 echo " tap [true or false] Toggle whether to recognize the tap as a click"
43 echo " accessibility [true or false] Toggle whether to show accessibility menu"
44 echo " root-login [true or false] Toggle whether to enable root login"
46 echo " Webkit2 command:"
47 echo " theme Run theme selection wizard"
48 echo " theme-change [theme] Specify the theme"
50 echo " Qtquick command:"
51 echo " back Specify the background image"
53 echo " Slick command:"
54 echo " back [image] Specify the background image"
55 echo " grid [true or false] Toggle whether to show grid"
56 echo " icon Run icon theme selection wizard"
57 echo " gtk Run gtk theme selection wizard"
58 echo " gtk-change [theme] Specify gtk theme"
61 echo " autologin [username] [session] Set up automatic login (with blank username to disable)"
62 echo " cursor Run cursor selection wizard"
63 echo " cursor-change [cursor] Specify the cursor theme"
64 echo " numlock [true or false] Toggle whether to enable Numlock force"
65 echo " tty [int number] The lowest virtual terminal number that will be used"
66 echo " theme Run theme selection wizard"
67 echo " theme-change [theme] Specify the theme"
70 echo " autologin [username] [session] Set up automatic login (with blank username to disable)"
71 echo " back [image] Specify the background image"
72 echo " session Run default session selection wizard"
73 echo " session-change [session] Specify the default session"
74 echo " remove-last Remove last selected setting"
75 echo " edit-script Edit the script"
77 echo " General option:"
78 echo " -m | --mode [mode name] Specifiy the target you want to set"
79 echo " -e | --editer [editor path] Specifiy the editor to use for editing"
80 echo " -h | --help This help message and exit"
81 echo " --non-interactive Run in non-interactive mode"
82 echo " --no-check-target No check the target for the selected mode"
83 echo " --noroot No check root permission"
84 echo " --write-all-files Allows rewriting of all configuration files"
86 echo " Supported modes:"
87 echo " Display managers: lightdm, gdm, sddm, lxdm"
88 echo " LightDM greeters: webkit2, qtquick, slick"
90 echo " Default mode: ${DISPLAY_MANAGER}"
92 echo " This tool is incomplete and still under development."
93 echo " If you find a bug, please report it on GitHub."
94 echo " https://github.com/FascodeNet/dmc"
112 if [[ "${NOROOT}" = false ]] && (( "${UID}" != 0 )); then
113 msg_error "You have to run as root"
121 #if (( "$(expr "${1}" + 1 >/dev/null 2>&1; printf "${?}")" < 2 )); then
122 if printf "%s" "${1}" | grep -E "^[0-9]+$" 1>/dev/null 2>&1; then
132 if [[ -n "${1}" ]] && { [[ "${1}" = "true" ]] ||[[ "${1}" = "false" ]]; }; then
141 local _command="${1}"
143 if which "${_command}" >/dev/null 2>&1; then
144 $(which "${_command}") "${@}"
146 msg_error "${_command} was not found"
153 wrapper crudini "${@}"
161 # 指定されたコマンドが現在のモードで実行可能かどうかを判定する
163 if ! printf "%s\n" "${@}" | grep -xE "${DISPLAY_MANAGER}" >/dev/null 2>&1; then
164 msg_error "This command (${COMMAND}) is not available in the current mode (${DISPLAY_MANAGER})."
169 # 現在のモードのメインバイナリが存在しているかどうか確認する
171 if [[ -z "${MAIN_BINARY["${DISPLAY_MANAGER}"]+SET}" ]]; then
172 msg_warn "The main binary for the selected mode is not set."
173 elif [[ ! -f "${MAIN_BINARY["${DISPLAY_MANAGER}"]}" ]]; then
174 msg_error "The target for the selected mode is not installed."
182 # 参考: https://wiki.archlinux.jp/index.php/%E3%82%AB%E3%83%BC%E3%82%BD%E3%83%AB%E3%83%86%E3%83%BC%E3%83%9E
183 # 参考: https://wiki.archlinux.jp/index.php/GDM
184 #echo "Searching cursor themes..." 1>&2
185 local _dir _cursor_theme_dir_list _find_cursor_dir_list=("/usr/share/icons" "${HOME}/.local/share/icons" "${HOME}/.icons")
186 for _dir in "${_find_cursor_dir_list[@]}"; do
187 if [[ -d "${_dir}" ]]; then
188 while read -r line; do
189 _cursor_theme_dir_list+=("${line}")
190 done < <(find "${_dir}" -type d -name "cursors" -print0 | xargs -0 -i dirname {} | sort)
193 unset _dir _find_cursor_dir_list
195 local _cursor_theme _cursor_theme_name _name
196 for _cursor_theme in "${_cursor_theme_dir_list[@]}"; do
197 _name="$(grep -E "^Name=" "${_cursor_theme}/cursor.theme" 2> /dev/null | sed "s|^Name=||g")"
198 if [[ -z "${_name}" ]]; then
199 _name="$(basename "${_cursor_theme}")"
201 _cursor_theme_name+=("${_name}")
203 printf "%s\n" "${_cursor_theme_name[@]}"
208 echo "Loading GTK themes..." >&2
209 local _dir _find_theme_dir_list=("/usr/share/themes" "${HOME}/.local/share/themes" "${HOME}/.themes")
210 for _dir in "${_find_theme_dir_list[@]}"; do
211 if [[ -d "${_dir}" ]]; then
212 while read -r line; do
213 _gtk_theme_dir_list+=("${line}")
214 done < <(find "${_dir}" -type d -name "gtk-*" -print0 | xargs -0 -i dirname {} | tr " " "\n" | sort | uniq)
219 for _dir in "${_gtk_theme_dir_list[@]}"; do
220 _theme_name="$(crudini --get "${_dir}/index.theme" 'Desktop Entry' "Name" 2> /dev/null ;:)"
221 if [[ -z "${_theme_name}" ]]; then
224 _gtk_theme_name_list+=("${_theme_name}")
228 printf "%s\n" "${_gtk_theme_name_list[@]}" | sort | uniq
232 echo "Loading icons..." >&2
233 local _dir _find_theme_dir_list=("/usr/share/icons" "${HOME}/.local/share/icons" "${HOME}/.icons")
234 for _dir in "${_find_theme_dir_list[@]}"; do
235 if [[ -d "${_dir}" ]]; then
236 while read -r line; do
237 _icon_theme_dir_list+=("${line}")
238 done < <(find "${_dir}" -type f -name "index.theme" -print0 | xargs -0 -i dirname {} | tr " " "\n" | sort | uniq)
243 for _dir in "${_icon_theme_dir_list[@]}"; do
244 _theme_name="$(crudini --get "${_dir}/index.theme" 'Icon Theme' "Name" 2> /dev/null ;:)"
245 if [[ -z "${_theme_name}" ]]; then
248 _gtk_theme_name_list+=("${_theme_name}")
252 printf "%s\n" "${_gtk_theme_name_list[@]}" | sort | uniq
256 find "/usr/share/xsessions" -type f -print0 -name "*.desktop" | xargs -0 -I{} bash -c 'basename {} | sed "s|.desktop||g"'
259 get_wayland_session(){
260 find "/usr/share/wayland-sessions" -type f -print0 -name "*.desktop" | xargs -0 -I{} bash -c 'basename {} | sed "s|.desktop||g"'
264 # Returns only the selected result to standard output
265 # ask_question -d <デフォルト値> -p <質問文> <選択肢1> <選択肢2> ...
267 local arg OPTARG OPTIND
268 local _default="" _choice_list _count _choice _question
269 while getopts "d:p:" arg; do
271 d) _default="${OPTARG}" ;;
272 p) _question="${OPTARG}" ;;
276 shift $((OPTIND - 1))
277 _choice_list=("${@}")
280 if (( ${#_choice_list[@]} < 0 )); then
281 msg_error "An exception error has occurred."
285 # 選択肢が1つしか無いならばそのまま値を返す
286 if (( ${#_choice_list[@]} <= 1 )); then
287 echo "${_choice_list[*]}"
291 if [[ -v _question ]] && [[ ! "${_question}" = "" ]]; then
292 echo -e "${_question}" >&2
295 for (( _count=1; _count<=${#_choice_list[@]}; _count++)); do
296 _choice="${_choice_list[$(( _count - 1 ))]}"
297 if [[ ! "${_default}" = "" ]] && [[ "${_choice}" = "${_default}" ]]; then
298 echo " * ${_count}: ${_choice}" >&2
300 echo " ${_count}: ${_choice}" >&2
304 echo -n "(1 ~ ${#_choice_list[@]}) > " >&2
308 if check_int "${_input}"; then
310 if (( 1 <= _input)) && (( _input <= ${#_choice_list[@]} )); then
311 _choice="${_choice_list[$(( _input - 1 ))]}"
317 if printf "%s\n" "${_choice_list[@]}" | grep -x "${_input}" 1>/dev/null 2>&1; then
330 if (( $(get_xorg_session | wc -l) <= 1 )); then
331 _session="$(get_xorg_session)"
332 elif [[ "${NON_INTERACTIVE}" = true ]]; then
335 _session="$(grep -E '^Session=' "${HOME}/.dmrc" 2> /dev/null | cut -d '=' -f 2)"
336 if [[ -z "${autologin_session}" ]]; then
337 msg_error "Failed to set the session."
338 msg_error "Not specified and ~/.dmrc does not exist either."
342 while read -r line; do
343 _session_list+=("${line}")
344 done < <(get_xorg_session)
345 if ! session="$(ask_question -p "Select the desktop session to autologin" "${_session_list[@]}")"; then
346 msg_error "Please enter the correct session name."
349 if [[ -f "/usr/share/xsessions/${session}.desktop" ]]; then
350 _session="${session}"
352 msg_error "Please enter the correct session name."
360 # check_session <session>
362 if [[ ! -f "/usr/share/xsessions/${1}.desktop" ]]; then
364 msg_error "This is a session (${1}) that does not exist."
370 # get_session <session name>
373 local session_exec="$(crudini --get "/usr/share/xsessions/${1}.desktop" "Desktop Entry" "Exec")"
374 if [[ ! -f "${session_exec}" ]]; then
375 session_exec="$(type -p "${session_exec}")"
377 echo -n "${session_exec}"
382 # add_user_to_group <user> <group>
384 if ! getent passwd "${1}" 1> /dev/null 2>&1; then
385 echo "${1} is a non-existent user."
389 if ! getent group "${2}" 1> /dev/null 2>&1; then
390 LANG=C groupadd -r "${2}"
392 LANG=C gpasswd -a "${1}" "${2}"
396 # get_filetype <file>
398 file -inb "${1}" | cut -d ";" -f 1
403 # check_filetype <ファイルタイプ> <ファイルパス>
405 local _type="${1}" _path="${2}"
407 # ファイルタイプに/が含まれているかどうか
408 if echo "${_type}" | grep -E "^.+/.+$" >/dev/null 2<&1; then
409 # 含まれていたらファイルタイプを完全一致で判定する\
410 if [[ "${_type}" = "$(get_filetype "${_path}")" ]]; then
414 # 含まれていなかったらファイルタイプをメインタイプのみで判定する
415 if [[ "${_type}" = "$(get_filetype "${_path}" | cut -d "/" -f 1 )" ]]; then
424 #== LightDM用の汎用関数 ==#
426 lightdm_get_source_file(){
428 local source_name="$(lightdm --show-config 2>&1 | grep -E "^[A-Z] ${key}=" | cut -d ' ' -f 1)"
429 local source_path="$(lightdm --show-config 2>&1 | grep -x -A "$(lightdm --show-config 2>&1 | wc -l)" "Sources:" | grep -xv "Sources" | grep -E "^${source_name} " | sed "s|^${source_name} ||g")"
430 if [[ -n "${source_path}" ]]; then
431 echo -n "${source_path}"
439 lightdm_set_config(){
440 local key="${1}" value="${2}" file=${3-${DISPLAY_MANAGER_CONFIG["lightdm"]}}
441 if [[ "${WRITE_ALL_FILES}" = true ]] && [[ -n "$(lightdm_get_source_file "${1}")" ]]; then
442 crudini --set "$(lightdm_get_source_file "${1}")" 'Seat:*' "${key}" "${value}"
444 crudini --set "${file}" 'Seat:*' "${key}" "${value}"
447 if [[ ! "$(lightdm_get_value "${key}")" = "${value}" ]]; then
448 msg_error "Failed to change the setting value. A value has already been set for $(lightdm_get_source_file "${1}")"
449 msg_error "lightdm-config does not manipulate other configuration files for safety. Comment out the settings in that file."
454 lightdm_remove_key(){
455 local key="${1}" _config
456 if grep -E "^ ?${key}.+" "${DISPLAY_MANAGER_CONFIG["lightdm"]}" 1>/dev/null 2>&1; then
457 sed -i -r "s|^ ?${key} ?=.+||g" "${DISPLAY_MANAGER_CONFIG["lightdm"]}"
458 sed -i '/^$/d' "${DISPLAY_MANAGER_CONFIG["lightdm"]}"
463 lightdm_init_configs(){
465 if [[ ! -f "${DISPLAY_MANAGER_CONFIG["lightdm"]}" ]]; then
466 mkdir -p "$(dirname "${DISPLAY_MANAGER_CONFIG["lightdm"]}")"
467 touch "${DISPLAY_MANAGER_CONFIG["lightdm"]}"
468 echo "[Seat:*]" > "${DISPLAY_MANAGER_CONFIG["lightdm"]}"
474 local _current_value="$(lightdm --show-config 2>&1 | grep -E "^[A-Z] ${1}=" | sed "s|^[A-Z] ||g" | cut -d "=" -f "2")"
475 if [[ "${_current_value}" ]]; then
476 echo -n "${_current_value}"
486 command_lightdm_greeter_change() {
488 if [[ -z "${1}" ]] || [[ "${1}" = "" ]]; then
489 msg_error "Please specify Greeter."
493 # 指定されたGreeterが正しいか確認
494 if ! printf "%s\n" "${LIGHTDM_GREETERS[@]}" | grep -x "${1}" > /dev/null 2>&2; then
495 msg_error "The greeter (${1}) doesn't exist."
498 lightdm_set_config "greeter-session" "${1}"
503 command_lightdm_greeter_create(){
504 if [[ -z "${1}" ]] || [[ "${1}" = "" ]]; then
505 msg_error "Please specify Greeter."
508 if [[ ! -f "${1}" ]]; then
509 msg_error "${1} does not exist."
512 if [[ ! -x "${1}" ]]; then
513 msg_error "hoge is not an executable file."
518 local filename="$(basename "${1}")"
520 if [[ -f "/usr/share/xgreeters/${filename}.desktop" ]]; then
521 msg_error "Greeter with the same name already exists."
524 cat > "/usr/share/xgreeters/${filename}.desktop" <<EOF
526 Name=LightDM custom Greeter ${filename}
527 Comment=LightDM Greeter
534 command_lightdm_greeter_list() {
535 echo "Available Lightdm greeter list:"
537 for _greeter in "${LIGHTDM_GREETERS[@]}"; do
538 if [[ "${_greeter}" = "${LIGHTDM_CURRENT_GREETER}" ]]; then
539 echo " * ${_greeter}"
547 run_greeter_wizard(){
549 if (( ${#LIGHTDM_GREETERS[@]} < 1 )); then
550 msg_error "LightDM Greeter was not found."
556 if ! _greeter="$(ask_question -p "Please select the greeter to use." -d "${LIGHTDM_CURRENT_GREETER}" "${LIGHTDM_GREETERS[@]}")"; then
562 if [[ -n "${_greeter}" ]]; then
563 command_lightdm_greeter_change "${_greeter}"
569 if [[ ! "${LIGHTDM_CURRENT_GREETER}" = "${_greeter}" ]]; then
570 echo "Changed greeter to ${_greeter}"
575 command_lightdm_remove(){
576 if [[ ! -f "${DISPLAY_MANAGER_CONFIG["lightdm"]}" ]]; then
580 echo -ne "Are you sure you want to delete all settings?\nThis change is irreversible.\n (y or n) > "
581 read -r -n 1 _yes_or_no
582 if [[ "${_yes_or_no}" = "y" ]]; then
583 mv "${DISPLAY_MANAGER_CONFIG["lightdm"]}" "${DISPLAY_MANAGER_CONFIG["lightdm"]}.disabled"
589 command_lightdm_greeter_edit(){
590 if [[ "${NON_INTERACTIVE}" = true ]]; then
591 msg_error "You cannot use this command in non-interactive mode."
594 local _greeter="${1:-${LIGHTDM_CURRENT_GREETER}}"
595 if [[ -z "${GREETER_CONFIG["${_greeter}"]+SET}" ]]; then
596 msg_error "This Greeter is not currently supported."
597 msg_error "Please report the problem here."
598 msg_error "https://github.com/FascodeNet/lightdm-config/issues"
601 if [[ -z "${1}" ]] || [[ "${1}" = "" ]]; then
602 msg_warn "Greeter was not specified. Open the currently configured Greeter configuration file."
603 echo -n "(Enter to continue) > "
607 bash -c "${USE_EDITOR} ${GREETER_CONFIG["${_greeter}"]}"
613 command_lightdm_edit(){
614 if [[ "${NON_INTERACTIVE}" = true ]]; then
615 msg_error "You cannot use this command in non-interactive mode."
618 for _config in "${LIGHTDM_LOADED_CONFIG[@]}"; do
619 echo -ne "Edit ${_config} ? (y or n)> "
620 read -r -n 1 _yes_or_no
622 if [[ "${_yes_or_no}" = "y" ]]; then
623 bash -c "${USE_EDITOR} ${_config}"
629 command_lightdm_auto_login(){
630 if [[ -z "${1+SET}" ]] || [[ "${1}" = "" ]]; then
631 # 既に自動ログインが設定されているかを確認
632 local autologin_user="$(lightdm_get_value autologin-user)"
633 if [[ -n "${autologin_user}" ]]; then
635 for _autologin in "autologin-guest" "autologin-user" "autologin-user-timeout" "autologin-in-background" "autologin-session"; do
636 remove_key "${_autologin}"
638 echo "Canceled automatic login of ${autologin_user}"
641 local autologin_user="${1}" autologin_session
643 autologin_session="${2}"
646 # セッションを設定 (WayLandのセッションは現在サポートされていません)
647 if [[ -z "${autologin_session+SET}" ]]; then
648 autologin_session="$(ask_session)"
651 check_session "${autologin_session}"
655 add_user_to_group "${autologin_user}" "autologin"
658 lightdm_set_config "autologin-guest" "false"
659 lightdm_set_config "autologin-user" "${autologin_user}"
660 lightdm_set_config "autologin-user-timeout" "0"
661 lightdm_set_config "autologin-in-background" "false"
662 lightdm_set_config "autologin-session" "${autologin_session}"
664 echo "${autologin_user} will automatically log in with ${autologin_session}"
670 command_lightdm_show_config(){
671 lightdm --show-config 2>&1
677 if [[ ! -f "/etc/dconf/profile/gdm" ]]; then
678 mkdir -p "/etc/dconf/profile"
679 touch "/etc/dconf/profile/gdm"
680 echo -e "user-db:user\nsystem-db:gdm\nfile-db:/usr/share/gdm/greeter-dconf-defaults" > "/etc/dconf/profile/gdm"
684 for _file in "${DISPLAY_MANAGER_CONFIG["gdm-dconf"]}" "${DISPLAY_MANAGER_CONFIG["gdm-custom"]}"; do
685 if [[ ! -f "${_file}" ]]; then
686 mkdir -p "$(dirname "${_file}")"
692 # gdm_dconf_set_config <dconf path> <key> <value>
693 gdm_dconf_set_config(){
694 if check_int "${3}" || check_bool "${3}"; then
695 crudini --set "${DISPLAY_MANAGER_CONFIG["gdm-dconf"]}" "${1}" "${2}" "${3}"
697 crudini --set "${DISPLAY_MANAGER_CONFIG["gdm-dconf"]}" "${1}" "${2}" "\"${3}\""
702 # gdm_dconf_get_value <dconf path> <key>
703 gdm_dconf_get_value(){
704 find "/etc/dconf/db/gdm.d/" -type f -print0 | xargs -0i cat {} | crudini --get - "${1}" "${2}" | sed "s|^[\"\']||g" | sed "s|[\"\']$||g"
707 # gdm_custom_get_value <section> <key>
708 gdm_custom_get_value(){
709 crudini --get "${DISPLAY_MANAGER_CONFIG["gdm-custom"]}" "${1}" "${2}"
712 # gdm_custom_set_config <section> <key> <value>
713 gdm_custom_set_config(){
714 if check_int "${3}" || check_bool "${3}"; then
715 crudini --set "${DISPLAY_MANAGER_CONFIG["gdm-custom"]}" "${1}" "${2}" "${3}"
717 crudini --set "${DISPLAY_MANAGER_CONFIG["gdm-custom"]}" "${1}" "${2}" "\"${3}\""
729 if [[ -z "${1+SET}" ]] || [[ "${1}" = "" ]]; then
730 msg_error "Please specify the image of background"
733 if [[ ! -f "${1}" ]]; then
734 msg_error "${1} was not found."
738 local _backgrounf_file="/usr/share/backgrounds/gdm/background"
739 mkdir -p "$(dirname "${_backgrounf_file}")"
740 cp "${1}" "${_backgrounf_file}"
741 chmod 644 "${_backgrounf_file}"
743 gdm_dconf_set_config "org/gnome/login-screen" "logo" "${_backgrounf_file}"
746 command_gdm_cursor_wizard(){
748 local cursor_themes _current_theme="$(gdm_dconf_get_value "org/gnome/desktop/interface" "cursor-theme")"
749 while read -r line; do cursor_themes+=("${line}"); done < <(get_cursor_theme)
752 if ! _cursor_theme="$(ask_question -d "${_current_theme}" -p "Please select the cursor theme to use." "${cursor_themes[@]}")"; then
757 if [[ -n "${_cursor_theme}" ]]; then
758 command_gdm_cursor_change "${_cursor_theme}"
760 command_gdm_cursor_wizard
764 if [[ ! "${_current_theme}" = "${_cursor_theme}" ]]; then
765 echo "Changed cursor to ${_cursor_theme}"
769 command_gdm_cursor_change(){
770 if [[ -z "${1+SET}" ]] || [[ "${1}" = "" ]]; then
771 msg_error "Please specify the cursor theme"
775 while read -r line; do cursor_themes+=("${line}"); done < <(get_cursor_theme)
776 if ! printf "%s\n" "${cursor_themes[@]}" | grep -x "${1}" 1>/dev/null 2>&1; then
777 msg_error "The cursor theme (${1}) was not found"
780 gdm_dconf_set_config "org/gnome/desktop/interface" "cursor-theme" "${1}"
784 local _arg="$(echo "${1-""}" | tr "[:upper:]" "[:lower:]")"
785 if ! check_bool "${_arg}"; then
786 msg_error "Please specify true or false"
789 gdm_dconf_set_config "org/gnome/desktop/sound" "event-sounds" "${_arg}"
793 local _arg="$(echo "${1-""}" | tr "[:upper:]" "[:lower:]")"
794 if ! check_bool "${_arg}"; then
795 msg_error "Please specify true or false"
798 gdm_dconf_set_config "org/gnome/desktop/peripherals/touchpad" "tap-to-click" "${_arg}"
802 command_gdm_auto_login(){
803 if [[ -z "${1+SET}" ]] || [[ "${1}" = "" ]]; then
804 # 既に自動ログインが設定されているかを確認
805 local autologin="$(gdm_custom_get_value daemon AutomaticLoginEnable)"
806 if [[ "${autologin}" = "True" ]]; then
807 gdm_custom_set_config "daemon" "AutomaticLoginEnable" "False"
808 echo "Canceled automatic login of $(gdm_custom_get_value "daemon" "AutomaticLogin")"
811 local autologin_user="${1}" autologin_session
813 autologin_session="${2}"
816 # セッションを設定 (WayLandのセッションは現在サポートされていません)
817 if [[ -z "${autologin_session+SET}" ]]; then
818 autologin_session="$(ask_session)"
821 check_session "${autologin_session}"
825 add_user_to_group "${autologin_user}" "autologin"
828 gdm_custom_set_config "daemon" "AutomaticLoginEnable" "True"
829 gdm_custom_set_config "daemon" "AutomaticLogin" "${autologin_user}"
832 crudini --set "/var/lib/AccountsService/users/${autologin_user}" "User" "Session" "${autologin_session}"
833 crudini --set "/var/lib/AccountsService/users/${autologin_user}" "User" "XSession" "${autologin_session}"
835 echo "${autologin_user} will automatically log in with ${autologin_session}"
841 command_gdm_accessibility(){
842 local _arg="$(echo "${1-""}" | tr "[:upper:]" "[:lower:]")"
843 if ! check_bool "${_arg}"; then
844 msg_error "Please specify true or false"
847 gdm_dconf_set_config "org/gnome/desktop/interface" "toolkit-accessibility" "${_arg}"
851 command_gdm_root_login(){
852 local _arg="$(echo "${1-""}" | tr "[:upper:]" "[:lower:]")"
853 if ! check_bool "${_arg}"; then
854 msg_error "Please specify true or false"
857 gdm_custom_set_config "daemon" "AllowRoot" "${_arg}"
860 #== Webkit2用の汎用関数 ==#
861 webkit2_init_configs(){
863 if [[ ! -f "${GREETER_CONFIG["lightdm-webkit2-greeter"]}" ]]; then
864 mkdir -p "$(dirname "${GREETER_CONFIG["lightdm-webkit2-greeter"]}")"
865 touch "${GREETER_CONFIG["lightdm-webkit2-greeter"]}"
869 # webkit2_get_value <section> <key>
871 crudini --get "${GREETER_CONFIG["lightdm-webkit2-greeter"]}" "${1}" "${2}"
874 # webkit2_set_config <section> <key> <value>
875 webkit2_set_config(){
876 crudini --set "${GREETER_CONFIG["lightdm-webkit2-greeter"]}" "${1}" "${2}" "${3}"
880 command_webkit2_theme_wizard(){
882 while read -r line; do
883 _theme_list+=("${line}")
884 done < <(ls /usr/share/lightdm-webkit/themes)
886 local _current_theme=$(webkit2_get_value greeter webkit_theme | sed "s|\"||g")
888 if ! _theme="$(ask_question -d "${_current_theme}" -p "Please select the theme to use." "${_theme_list[@]}")"; then
892 if [[ -n "${_theme}" ]]; then
893 command_webkit2_theme_change "${_theme}"
894 echo "Changed the theme to ${_theme}"
896 command_webkit2_theme_wizard
902 command_webkit2_theme_change(){
903 if [[ -z "${1+SET}" ]] || [[ "${1}" = "" ]]; then
904 msg_error "Please specify the theme name"
907 if [[ ! -d "/usr/share/lightdm-webkit/themes/${1}" ]]; then
908 msg_error "The specified theme (${1}) does not exist"
912 webkit2_set_config "greeter" "webkit_theme" "${1}"
915 #== Qtquick用の汎用関数 ==#
916 qtquick_init_configs(){
918 if [[ ! -f "${GREETER_CONFIG["lightdm-qtquick-greeter"]}" ]] || [[ -z "$(cat "${GREETER_CONFIG["lightdm-qtquick-greeter"]}")" ]]; then
919 mkdir -p "$(dirname "${GREETER_CONFIG["lightdm-qtquick-greeter"]}")"
920 touch "${GREETER_CONFIG["lightdm-qtquick-greeter"]}"
921 #echo -e "{\n\n}\n" > "${GREETER_CONFIG["lightdm-qtquick-greeter"]}"
922 qtquick_set_config background_path "file:///hoge/fuga.png"
923 qtquick_set_config theme "qrc:/Login.qml"
927 #qtquick_get_value <key>
929 jq ".${1}" < "${GREETER_CONFIG["lightdm-qtquick-greeter"]}"
932 # command_qtquick_back <key> <value>
933 qtquick_set_config(){
934 local _tempfile="/tmp/$(basename "${GREETER_CONFIG["lightdm-qtquick-greeter"]}")-$(base64 < "/dev/urandom" | fold -w 10 | head -n 1)"
935 cp "${GREETER_CONFIG["lightdm-qtquick-greeter"]}" "${_tempfile}"
936 #cat "${_tempfile}" | jq -r ".${1}|=\"${2}\"" > "${GREETER_CONFIG["lightdm-qtquick-greeter"]}"
937 jq -r ".${1}|=\"${2}\"" < "${_tempfile}" > "${GREETER_CONFIG["lightdm-qtquick-greeter"]}"
938 chmod 644 "${GREETER_CONFIG["lightdm-qtquick-greeter"]}"
942 command_qtquick_back(){
943 if [[ -z "${1+SET}" ]] || [[ "${1}" = "" ]]; then
944 msg_error "Please specify the image of background"
947 if [[ ! -f "${1}" ]]; then
948 msg_error "${1} was not found."
952 local _backgrounf_file="/usr/share/backgrounds/lightdm/qtquick-greeter"
953 mkdir -p "$(dirname "${_backgrounf_file}")"
954 cp "${1}" "${_backgrounf_file}"
955 chmod 644 "${_backgrounf_file}"
957 qtquick_set_config "background_path" "file://${_backgrounf_file}"
962 crudini --get "${GREETER_CONFIG["lightdm-slick-greeter"]}" "Greeter" "${1}"
966 crudini --set "${GREETER_CONFIG["lightdm-slick-greeter"]}" "Greeter" "${1}" "${2}"
969 slick_init_configs(){
971 if [[ ! -f "${GREETER_CONFIG["lightdm-slick-greeter"]}" ]]; then
972 mkdir -p "$(dirname "${GREETER_CONFIG["lightdm-slick-greeter"]}")"
973 touch "${GREETER_CONFIG["lightdm-slick-greeter"]}"
974 echo "[Greeter]" > "${GREETER_CONFIG["lightdm-slick-greeter"]}"
979 command_slick_grid(){
980 local _arg="$(echo "${1-""}" | tr "[:upper:]" "[:lower:]")"
981 if ! check_bool "${_arg}"; then
982 msg_error "Please specify true or false"
985 slick_set_config "draw-grid" "${_arg}"
988 command_slick_back(){
989 if [[ -z "${1+SET}" ]] || [[ "${1}" = "" ]]; then
990 msg_error "Please specify the image of background"
993 if [[ ! -f "${1}" ]]; then
994 msg_error "${1} was not found."
998 local _backgrounf_file="/usr/share/backgrounds/lightdm/slick-greeter"
999 mkdir -p "$(dirname "${_backgrounf_file}")"
1000 cp "${1}" "${_backgrounf_file}"
1001 chmod 644 "${_backgrounf_file}"
1003 slick_set_config "background" "${_backgrounf_file}"
1007 command_slick_gtk_wizard(){
1009 while read -r line; do gtk_themes+=("${line}"); done < <(get_gtk_theme)
1013 echo "Please select the theme to use."
1014 if ! _theme="$(ask_question "${gtk_themes[@]}")"; then
1015 command_slick_gtk_wizard
1020 if [[ -n "${_theme}" ]]; then
1021 command_slick_gtk_change "${_theme}"
1023 command_slick_gtk_wizard
1026 echo "Changed theme to ${_theme}"
1030 command_slick_gtk_change(){
1031 if [[ -z "${1+SET}" ]] || [[ "${1}" = "" ]]; then
1032 msg_error "Please specify the theme"
1035 if [[ ! -d "/usr/share/themes/${1}" ]]; then
1036 msg_error "${1} was not found."
1039 slick_set_config "theme-name" "${1}"
1042 command_slick_icon_wizard(){
1044 while read -r line; do icons+=("${line}"); done < <(get_icon_theme)
1047 echo "Please select the icon theme to use."
1048 if ! _icon="$(ask_question "${icons[@]}")"; then
1049 command_slick_icon_wizard
1053 if [[ -n "${_icon}" ]]; then
1054 slick_set_config "icon-theme-name" "${_icon}"
1056 command_slick_icon_wizard
1059 echo "Changed icon theme to ${_icon}"
1064 # sddm_get_value <section> <key> <valye>
1066 crudini --set "${DISPLAY_MANAGER_CONFIG["sddm"]}" "${1}" "${2}"
1069 # sddm_set_config <section> <key> <value>
1071 crudini --set "${DISPLAY_MANAGER_CONFIG["sddm"]}" "${1}" "${2}" "${3}"
1074 # sddm_remove_key <section> <key>
1076 crudini --del "${DISPLAY_MANAGER_CONFIG["sddm"]}" "${1}" "${2}"
1080 sddm_init_configs(){
1082 if [[ ! -f "${DISPLAY_MANAGER_CONFIG["sddm"]}" ]]; then
1083 mkdir -p "$(dirname "${DISPLAY_MANAGER_CONFIG["sddm"]}")"
1084 sddm --example-config > "${DISPLAY_MANAGER_CONFIG["sddm"]}"
1089 command_sddm_auto_login(){
1090 if [[ -z "${1+SET}" ]] || [[ "${1}" = "" ]]; then
1091 # 既に自動ログインが設定されているかを確認
1092 local autologin_user="$(sddm_get_value Autologin User)"
1093 if [[ -n "${autologin_user}" ]]; then
1094 sddm_remove_key "Autologin" "User"
1095 echo "Canceled automatic login of ${autologin_user}"
1098 local autologin_user="${1}" autologin_session
1100 autologin_session="${2}"
1103 # セッションを設定 (WayLandのセッションは現在サポートされていません)
1104 if [[ -z "${autologin_session+SET}" ]]; then
1105 autologin_session="$(ask_session)"
1108 check_session "${autologin_session}"
1112 add_user_to_group "${autologin_user}" "autologin"
1115 sddm_set_config "Autologin" "User" "${autologin_user}"
1116 sddm_set_config "Autologin" "Session" "${autologin_session}"
1118 echo "${autologin_user} will automatically log in with ${autologin_session}"
1122 command_sddm_cursor_wizard(){
1124 local cursor_themes _current_theme="$(sddm_get_value "Theme" "CursorTheme")"
1125 while read -r line; do cursor_themes+=("${line}"); done < <(get_cursor_theme)
1128 if ! _cursor_theme="$(ask_question -d "${_current_theme}" -p "Please select the cursor theme to use." "${cursor_themes[@]}")"; then
1129 command_sddm_cursor_wizard
1133 if [[ -n "${_cursor_theme}" ]]; then
1134 command_sddm_cursor_change "${_cursor_theme}"
1136 command_sddm_cursor_change
1140 if [[ ! "${_current_theme}" = "${_cursor_theme}" ]]; then
1141 echo "Changed cursor to ${_cursor_theme}"
1145 command_sddm_cursor_change(){
1146 if [[ -z "${1+SET}" ]] || [[ "${1}" = "" ]]; then
1147 msg_error "Please specify the cursor theme"
1151 while read -r line; do cursor_themes+=("${line}"); done < <(get_cursor_theme)
1152 if ! printf "%s\n" "${cursor_themes[@]}" | grep -x "${1}" 1>/dev/null 2>&1; then
1153 msg_error "The cursor theme (${1}) was not found"
1156 sddm_set_config "Theme" "CursorTheme" "${1}"
1159 command_sddm_numlock(){
1160 local _arg="$(echo "${1-""}" | tr "[:upper:]" "[:lower:]")"
1161 if ! check_bool "${_arg}"; then
1162 msg_error "Please specify true or false"
1166 if [[ "${_arg}" = true ]]; then
1171 sddm_set_config "General" "Numlock" "${_value}"
1175 if ! check_int "${1}" || (( "${1}" < 1 )); then
1176 msg_error "Please enter an integer greater than 1"
1179 sddm_set_config "X11" "MinimumVT" "${1}"
1182 command_sddm_theme_wizard(){
1184 while read -r line; do
1185 _theme_list+=("${line}")
1186 done < <(find "/usr/share/sddm/themes/" -maxdepth 1 -mindepth 1 -type d -print0 | xargs -0 -I{} basename {})
1188 local _theme _current_theme=$(sddm_get_value "Theme" "Current")
1189 if ! _theme="$(ask_question -d "${_current_theme}" -p "Please select the theme to use." "${_theme_list[@]}")"; then
1190 command_sddm_theme_wizard
1193 if [[ -n "${_theme}" ]]; then
1194 command_sddm_theme_change "${_theme}"
1195 echo "Changed the theme to ${_theme}"
1197 command_sddm_theme_wizard
1203 command_sddm_theme_change(){
1204 if [[ -z "${1+SET}" ]] || [[ "${1}" = "" ]]; then
1205 msg_error "Please specify the theme name"
1208 if [[ ! -d "/usr/share/sddm/themes/${1}" ]]; then
1209 msg_error "The specified theme (${1}) does not exist"
1213 sddm_set_config "Theme" "Current" "${1}"
1217 # sddm_get_value <section> <key> <valye>
1219 crudini --set "${DISPLAY_MANAGER_CONFIG["lxdm"]}" "${1}" "${2}"
1222 # sddm_set_config <section> <key> <value>
1224 crudini --set "${DISPLAY_MANAGER_CONFIG["lxdm"]}" "${1}" "${2}" "${3}"
1227 # sddm_remove_key <section> <key>
1229 crudini --del "${DISPLAY_MANAGER_CONFIG["lxdm"]}" "${1}" "${2}"
1233 lxdm_init_configs(){
1235 if [[ ! -f "${DISPLAY_MANAGER_CONFIG["lxdm"]}" ]]; then
1236 mkdir -p "$(dirname "${DISPLAY_MANAGER_CONFIG["lxdm"]}")"
1237 touch "${DISPLAY_MANAGER_CONFIG["lxdm"]}"
1242 command_lxdm_auto_login(){
1243 if [[ -z "${1+SET}" ]] || [[ "${1}" = "" ]]; then
1244 # 既に自動ログインが設定されているかを確認
1245 local autologin_user="$(lxdm_get_value "base" "autologin")"
1246 if [[ -n "${autologin_user}" ]]; then
1247 sddm_remove_key "base" "autologin"
1248 echo "Canceled automatic login of ${autologin_user}"
1251 local autologin_user="${1}" autologin_session
1253 autologin_session="${2}"
1256 # セッションを設定 (WayLandのセッションは現在サポートされていません)
1257 if [[ -z "${autologin_session+SET}" ]]; then
1258 autologin_session="$(ask_session)"
1261 check_session "${autologin_session}"
1265 add_user_to_group "${autologin_user}" "autologin"
1268 sddm_set_config "base" "autologin" "${autologin_user}"
1271 command_lxdm_session_change "${autologin_session}"
1273 echo "${autologin_user} will automatically log in with ${autologin_session}"
1277 command_lxdm_session_wizard(){
1278 command_lxdm_session_change "$(ask_session)"
1281 command_lxdm_session_change(){
1282 if [[ -z "${1+SET}" ]] || [[ "${1}" = "" ]]; then
1283 msg_error "Please specify the session name"
1286 local session="${1}"
1287 check_session "${session}"
1288 local session_exec="$(get_session "${session}")"
1289 lxdm_set_config "base" "session" "${session_exec}"
1292 command_lxdm_remove_last(){
1293 rm -rf "/var/lib/lxdm/lxdm.conf"
1294 echo "Removed last configs"
1297 comamnd_lxdm_edit_script(){
1299 "LoginReady : executed with root privileges when LXDM is ready to show the login window"
1300 "PreLogin : run as root before logging a user in"
1301 "PostLogin : run as the logged-in user right after they have logged in"
1302 "PostLogout : run as the logged-in user right after they have logged out"
1303 "PreReboot : run as root before rebooting with LXDM"
1304 "PreShutdown: run as root before poweroff with LXDM"
1306 if ! file=$(ask_question -p "Select the script you want to edit" "${_filelist[@]}" | cut -d ":" -f 1 | tr -d " "); then
1307 comamnd_lxdm_edit_script
1310 bash -c "${USE_EDITOR} ${file}"
1313 command_lxdm_back(){
1314 if [[ -z "${1+SET}" ]] || [[ "${1}" = "" ]]; then
1315 msg_error "Please specify the image of background"
1318 if [[ ! -f "${1}" ]]; then
1319 msg_error "${1} was not found."
1323 local _backgrounf_file="/usr/share/backgrounds/lxdm/background"
1324 mkdir -p "$(dirname "${_backgrounf_file}")"
1325 cp "${1}" "${_backgrounf_file}"
1326 chmod 644 "${_backgrounf_file}"
1328 lxdm_set_config "display" "bg" "file://${_backgrounf_file}"
1332 declare -A GREETER_CONFIG=(
1333 ["lightdm-webkit2-greeter"]="/etc/lightdm/lightdm-webkit2-greeter.conf"
1334 ["lightdm-slick-greeter"]="/etc/lightdm/slick-greeter.conf"
1335 ["lightdm-gtk-greeter"]="/etc/lightdm/lightdm-gtk-greeter.conf"
1336 ["io.elementary.greeter"]="/etc/lightdm/io.elementary.greeter.conf"
1337 ["lightdm-mini-greeter"]="/etc/lightdm/lightdm-mini-greeter.conf"
1338 ["lightdm-qtquick-greeter"]="/etc/lightdm/lightdm-qtquick-greeter.json"
1341 declare -A DISPLAY_MANAGER_CONFIG=(
1342 ["lightdm"]="/etc/lightdm/lightdm.conf.d/00-dmc-lightdm.conf"
1343 ["gdm-dconf"]="/etc/dconf/db/gdm.d/00-dmc-gdm"
1344 ["gdm-custom"]="/etc/gdm/custom.conf"
1345 ["sddm"]="/etc/sddm.conf.d/sddm.conf"
1346 ["lxdm"]="/etc/lxdm/lxdm.conf"
1349 declare -A MAIN_BINARY=(
1350 ["lightdm"]="/usr/bin/lightdm"
1351 ["gdm"]="/usr/bin/gdm"
1352 ["sddm"]="/usr/bin/sddm"
1353 ["webkit2"]="/usr/bin/lightdm-webkit2-greeter"
1354 ["slick"]="/usr/bin/slick-greeter"
1355 ["gtk"]="/usr/bin/lightdm-gtk-greeter"
1356 ["elementary"]="/usr/bin/io.elementary.greeter"
1357 ["mini"]="/usr/bin/lightdm-mini-greeter"
1358 ["qtquick"]="/usr/bin/lightdm-qtquick-greeter"
1359 ["lxdm"]="/usr/bin/lxdm"
1365 # LightDM - Greeterのディレクトリ
1366 LIGHTDM_GREETERS_DIR="$(lightdm_get_value "greeters-directory")"
1367 : "${LIGHTDM_GREETERS_DIR:="/usr/share/xgreeters"}"
1369 # LightDM - Greeter一覧
1370 #LIGHTDM_GREETERS=( $( )
1371 while read -r line; do
1372 LIGHTDM_GREETERS+=("${line}")
1373 done < <( (find "${LIGHTDM_GREETERS_DIR}" -print0 -type f | xargs -0 -i basename {} | grep -E ".desktop$" | sed "s|.desktop$||g" | grep -xv "xgreeters") 2> /dev/null )
1375 # LightDM - 現在設定されているGreeter
1376 LIGHTDM_CURRENT_GREETER="$(lightdm --show-config 2>&1 | grep "greeter-session" | cut -d "=" -f 2)"
1377 : "${LIGHTDM_CURRENT_GREETER:="lightdm-gtk-greeter"}"
1379 # LightDM - 読み込まれた設定ファイルの一覧
1380 while read -r line; do
1381 LIGHTDM_LOADED_CONFIG+=("${line}")
1382 done < <(printf "%s\n" "$(lightdm --show-config 2>&1 | grep -x -A "$(lightdm --show-config 2>&1 | wc -l)" "Sources:" | grep -v "Sources" | sed 's|^[A-Z] ||g')" | tr -d " ")
1385 USE_EDITOR="${EDITOR:-vi}"
1387 # Global - 現在のディスプレイマネージャ名
1388 CURRENT_DM="$(basename "$(readlink "/etc/systemd/system/display-manager.service")" | sed "s|.service$||g")"
1391 DISPLAY_MANAGER="${CURRENT_DM}"
1392 : "${DISPLAY_MANAGER:="lightdm"}"
1395 NON_INTERACTIVE=false
1396 WRITE_ALL_FILES=false
1398 NO_CHECK_TARGET=false
1403 OPTL="mode:,editor:,help,non-interactive,noroot,write-all-files,no-check-target"
1404 # shellcheck disable=SC2086
1405 if ! OPT="$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT})"; then
1409 eval set -- "${OPT}"
1415 DISPLAY_MANAGER="${2}"
1427 NON_INTERACTIVE=true
1435 NO_CHECK_TARGET=true
1439 WRITE_ALL_FILES=true
1450 COMMAND="${1:-null}"
1451 if (( "${#}" >= 1 )); then
1455 : "${COMMAND_ARGS-""}" # サブコマンドの引数が何も指定されなかった場合に空文字を代入
1457 if [[ "${COMMAND}" = "null" ]]; then
1463 if [[ "${NO_CHECK_TARGET}" = false ]]; then
1467 # コマンドとモードに応じて関数を実行する
1468 case "${COMMAND}" in
1470 check_command_dm "lightdm" "gdm" "sddm" "lxdm"
1471 case "${DISPLAY_MANAGER}" in
1473 lightdm_init_configs
1474 command_lightdm_auto_login "${COMMAND_ARGS}"
1478 command_gdm_auto_login "${COMMAND_ARGS}"
1482 command_sddm_auto_login "${COMMAND_ARGS}"
1486 command_lxdm_auto_login "${COMMAND_ARGS}"
1491 check_command_dm "lightdm"
1492 lightdm_init_configs
1496 check_command_dm "lightdm"
1497 lightdm_init_configs
1498 command_lightdm_greeter_change "${COMMAND_ARGS}"
1501 check_command_dm "lightdm"
1502 lightdm_init_configs
1503 command_lightdm_greeter_create "${COMMAND_ARGS}"
1506 check_command_dm "lightdm"
1507 command_lightdm_greeter_list
1510 check_command_dm "lightdm"
1512 command_lightdm_greeter_edit "${COMMAND_ARGS}"
1515 check_command_dm "lightdm"
1517 command_lightdm_remove
1520 check_command_dm "lightdm"
1522 command_lightdm_edit
1525 check_command_dm "lightdm"
1526 command_lightdm_show_config
1529 check_command_dm "gdm" "sddm"
1530 case "${DISPLAY_MANAGER}" in
1533 command_gdm_cursor_wizard
1537 command_sddm_cursor_wizard
1542 check_command_dm "gdm" "sddm"
1543 case "${DISPLAY_MANAGER}" in
1546 command_gdm_cursor_change "${COMMAND_ARGS}"
1550 command_sddm_cursor_change "${COMMAND_ARGS}"
1555 check_command_dm "gdm"
1557 command_gdm_sound "${COMMAND_ARGS}"
1560 check_command_dm "gdm" "slick"
1561 case "${DISPLAY_MANAGER}" in
1564 command_gdm_logo "${COMMAND_ARGS}"
1568 command_slick_logo "${COMMAND_ARGS}"
1573 check_command_dm "gdm"
1575 command_gdm_tap "${COMMAND_ARGS}"
1578 check_command_dm "gdm"
1580 command_gdm_accessibility "${COMMAND_ARGS}"
1583 check_command_dm "gdm"
1585 command_gdm_root_login "${COMMAND_ARGS}"
1588 check_command_dm "webkit2" "sddm"
1589 case "${DISPLAY_MANAGER}" in
1591 webkit2_init_configs
1592 command_webkit2_theme_wizard
1596 command_sddm_theme_wizard
1601 check_command_dm "webkit2" "sddm"
1602 case "${DISPLAY_MANAGER}" in
1604 webkit2_init_configs
1605 command_webkit2_theme_change "${COMMAND_ARGS}"
1609 command_sddm_theme_change
1614 check_command_dm "slick"
1616 command_slick_gtk_wizard
1619 check_command_dm "slick"
1621 command_slick_gtk_change
1622 msg_error "Not yet implemented."
1625 check_command_dm "qtquick" "slick" "lxdm"
1626 case "${DISPLAY_MANAGER}" in
1628 qtquick_init_configs
1629 command_qtquick_back "${COMMAND_ARGS}"
1633 command_slick_back "${COMMAND_ARGS}"
1637 command_lxdm_back "${COMMAND_ARGS}"
1642 check_command_dm "slick"
1644 command_slick_grid "${COMMAND_ARGS}"
1647 check_command_dm "slick"
1649 command_slick_icon_wizard
1652 check_command_dm "slick"
1654 command_slick_other_monitor "${COMMAND_ARGS}"
1657 check_command_dm "sddm"
1659 command_sddm_numlock "${COMMAND_ARGS}"
1662 check_command_dm "sddm"
1664 command_sddm_tty "${COMMAND_ARGS}"
1667 check_command_dm "lxdm"
1669 command_lxdm_session_wizard
1672 check_command_dm "lxdm"
1674 command_lxdm_session_change "${COMMAND_ARGS}"
1677 check_command_dm "lxdm"
1679 command_lxdm_remove_last
1682 check_command_dm "lxdm"
1684 comamnd_lxdm_edit_script
1687 msg_error "This command cannot be used in any mode"