#
# Yamada Hayao
# Twitter: @Hayao0819
+# GitHub : @Hayao0819
# Email : hayao@fascode.net
#
# (c) 2019-2021 Fascode Network.
#
-# dmc
+# dmc - display manager config tool
+#
+# Tool to change display manager settings
+# It supports various display managers.
#
# LICENSE: THE SUSHI-WARE LICENSE
# https://github.com/MakeNowJust/sushi-ware
script_usage(){
echo "usage: dmc [options] [command]"
echo
- echo "A simple tool for switching LightDM Greeters"
+ echo "Tool to change display manager settings"
+ echo
+ echo " Example:"
+ echo " dmc lightdm greeter-list"
+ echo " dmc gdm root-login true"
echo
echo " General command:"
echo " dm [display manager] Set display manager"
echo " [mode] [command] You can specify the mode as a command"
+ echo " gtk-list Show a list of GTK theme"
+ echo " help Show this help document"
echo
echo " LightDM command:"
echo " autologin [username] [session] Set up automatic login (with blank username to disable)"
echo " theme Run theme selection wizard"
echo " theme-change [theme] Specify the theme"
echo " remove Removes all settings"
+ echo " debug [true or false] Toggle debug mode"
echo
echo " Qtquick command: (lightdm-qtquick-greeter)"
echo " back Specify the background image"
# 数値チェック
check_int(){
- set +e
- #if (( "$(expr "${1}" + 1 >/dev/null 2>&1; printf "${?}")" < 2 )); then
if printf "%s" "${1}" | grep -E "^[0-9]+$" 1>/dev/null 2>&1; then
- set -e
return 0
else
- set -e
return 1
fi
}
fi
}
-# コマンドラッパー
-wrapper(){
- local _command="${1}"
- shift 1
- if which "${_command}" >/dev/null 2>&1; then
- $(which "${_command}") "${@}"
- else
- msg_error "${_command} was not found"
- exit 1
- fi
-}
-
-# crudini ラッパー
-crudini(){
- wrapper crudini "${@}"
+# インストールされていないコマンドを確認
+check_tools(){
+ local _command
+ for _command in "${@}"; do
+ if ! which "${_command}" >/dev/null 2>&1; then
+ msg_error "${_command} was not found"
+ exit 1
+ fi
+ done
}
-# jq ラッパー
-jq(){
- wrapper jq "${@}"
-}
# 指定されたコマンドが現在のモードで実行可能かどうかを判定する
check_command_dm(){
if [[ -d "${_dir}" ]]; then
while read -r line; do
_cursor_theme_dir_list+=("${line}")
- done < <(find "${_dir}" -type d -name "cursors" -print0 | xargs -0 -i dirname {} | sort)
+ done < <(find "${_dir}" -type d -name "cursors" -print0 | xargs -0 -I{} dirname {} | sort)
fi
done
unset _dir _find_cursor_dir_list
if [[ -d "${_dir}" ]]; then
while read -r line; do
_gtk_theme_dir_list+=("${line}")
- done < <(find "${_dir}" -type d -name "gtk-*" -print0 | xargs -0 -i dirname {} | tr " " "\n" | sort | uniq)
+ done < <(find "${_dir}" -type d -name "gtk-*" -print0 | xargs -0 -I{} dirname {} | tr " " "\n" | sort | uniq)
fi
done
if [[ -d "${_dir}" ]]; then
while read -r line; do
_icon_theme_dir_list+=("${line}")
- done < <(find "${_dir}" -type f -name "index.theme" -print0 | xargs -0 -i dirname {} | tr " " "\n" | sort | uniq)
+ done < <(find "${_dir}" -type f -name "index.theme" -print0 | xargs -0 -I{} dirname {} | tr " " "\n" | sort | uniq)
fi
done
printf "%s\n" "${_gtk_theme_name_list[@]}" | sort | uniq
}
-get_xorg_session(){
- find "/usr/share/xsessions" -type f -print0 -name "*.desktop" | xargs -0 -I{} bash -c 'basename {} | sed "s|.desktop||g"'
+get_session(){
+ find "/usr/share/xsessions" "/usr/share/wayland-sessions" -type f -print0 -name "*.desktop" | xargs -0 -I{} bash -c 'basename {} | sed "s|.desktop||g"'
}
-get_wayland_session(){
- find "/usr/share/wayland-sessions" -type f -print0 -name "*.desktop" | xargs -0 -I{} bash -c 'basename {} | sed "s|.desktop||g"'
-}
# 質問を行う関数
# Returns only the selected result to standard output
# ask_question -d <デフォルト値> -p <質問文> <選択肢1> <選択肢2> ...
ask_question(){
- local arg OPTARG OPTIND
- local _default="" _choice_list _count _choice _question
+ local arg OPTARG OPTIND _default="" _choice_list _count _choice _question
while getopts "d:p:" arg; do
case "${arg}" in
d) _default="${OPTARG}" ;;
*) exit 1 ;;
esac
done
- shift $((OPTIND - 1))
+ shift "$((OPTIND - 1))"
_choice_list=("${@}")
_digit="${##}"
for (( _count=1; _count<=${#_choice_list[@]}; _count++)); do
_choice="${_choice_list[$(( _count - 1 ))]}"
if [[ ! "${_default}" = "" ]] && [[ "${_choice}" = "${_default}" ]]; then
- #echo " * ${_count}: ${_choice}" >&2
printf " * %${_digit}d: ${_choice}\n" "${_count}" >&2
else
- #echo " ${_count}: ${_choice}" >&2
printf " %${_digit}d: ${_choice}\n" "${_count}" >&2
fi
unset _choice
# デスクトップセッションを聞く
ask_session(){
local _session
- if (( $(get_xorg_session | wc -l) <= 1 )); then
- _session="$(get_xorg_session)"
+ if (( $(get_session | wc -l) <= 1 )); then
+ _session="$(get_session)"
elif [[ "${NON_INTERACTIVE}" = true ]]; then
# 非対話モード
# ~/.dmrcの値を設定します
exit 1
fi
else
- while read -r line; do
- _session_list+=("${line}")
- done < <(get_xorg_session)
- if ! session="$(ask_question -p "Select the desktop session to autologin" "${_session_list[@]}")"; then
- msg_error "Please enter the correct session name."
- exit 1
- fi
- if [[ -f "/usr/share/xsessions/${session}.desktop" ]]; then
- _session="${session}"
- else
+ readarray -t _session_list < <(get_session)
+ if ! _session="$(ask_question -p "Select the desktop session to autologin" "${_session_list[@]}")"; then
msg_error "Please enter the correct session name."
exit 1
fi
# GTKテーマを聞く
ask_gtk_theme(){
local gtk_themes _theme
- while read -r line; do gtk_themes+=("${line}"); done < <(get_gtk_theme)
+ readarray -t gtk_themes < <(get_gtk_theme)
# 質問する
if ! _theme="$(ask_question -p "Please select the theme to use" "${gtk_themes[@]}")"; then
# セッションが利用可能かどうか確認する
# check_session <session>
check_session(){
- if [[ ! -f "/usr/share/xsessions/${1}.desktop" ]]; then
- # 存在しないセッションが指定された場合
- msg_error "This is a session (${1}) that does not exist."
- exit 1
- fi
+ for _file in "/usr/share/wayland-sessions/${1}.desktop" "/usr/share/xsessions/${1}.desktop"; do
+ if [[ -f "${_file}" ]]; then
+ return 0
+ fi
+ done
+ # 存在しないセッションが指定された場合
+ msg_error "This is a session (${1}) that does not exist."
+ return 1
+}
+
+# セッションのフルパスを返す
+get_session_path(){
+ check_session "${1}"
+ for _file in "/usr/share/wayland-sessions/${1}.desktop" "/usr/share/xsessions/${1}.desktop"; do
+ if [[ -f "${_file}" ]]; then
+ echo "${_file}"
+ return 0
+ fi
+ done
}
# セッションのバイナリを取得する
# get_session <session name>
-get_session(){
+get_session_exec(){
check_session "${1}"
- local session_exec="$(crudini --get "/usr/share/xsessions/${1}.desktop" "Desktop Entry" "Exec")"
+ local session_exec="$(crudini --get "$(get_session_path "${1}")" "Desktop Entry" "Exec")"
if [[ ! -f "${session_exec}" ]]; then
session_exec="$(type -p "${session_exec}")"
fi
fi
# 現在のディスプレイマネージャを無効化
- systemctl disable "${CURRENT_DM}.service"
+ if [[ -n "${CURRENT_DM+SET}" ]]; then
+ systemctl disable "${CURRENT_DM}.service"
+ fi
# 指定されたディスプレイマネージャを有効化
if check_systemd_unit "${1}"; then
fi
local _mode="${1}" _command="${2}"
- local _dmc_args="-e ${USE_EDITOR} -m ${_mode}"
+ local _dmc_args=("-e" "${USE_EDITOR}" "-m" "${_mode}")
shift 2
# 基本的な変数を設定
- local _command_args="${*}"
- : "${_command_args-""}" # サブコマンドの引数が何も指定されなかった場合に空文字を代入
-
+ local _command_args=("${@}")
# オプション設定
if [[ "${NON_INTERACTIVE}" = true ]]; then
- _dmc_args+=" --non-interactive"
+ _dmc_args+=("--non-interactive")
fi
if [[ "${NOROOT}" = true ]]; then
- _dmc_args+=" --noroot"
+ _dmc_args+=("--noroot")
fi
if [[ "${NO_CHECK_TARGET}" = true ]]; then
- _dmc_args+=" --no-check-target"
+ _dmc_args+=("--no-check-target")
fi
if [[ "${WRITE_ALL_FILES}" = true ]]; then
- _dmc_args+=" --write-all-files"
+ _dmc_args+=("--write-all-files")
fi
- bash -c "${SCRIPT_PATH}/$(basename "${0}") ${_dmc_args} ${_command} ${_command_args}"
+ bash "${SCRIPT_PATH}/$(basename "${0}")" "${_dmc_args[@]}" "${_command}" "${_command_args[@]}"
}
lightdm_greeter_list(){
local greeter_list
- while read -r line; do
- greeter_list+=("${line}")
- 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 )
+ readarray -t greeter_list < <( (find "${LIGHTDM_GREETERS_DIR}" -print0 -type f | xargs -0 -I{} basename {} | grep -E ".desktop$" | sed "s|.desktop$||g" | grep -xv "xgreeters") 2> /dev/null )
printf "%s\n" "${greeter_list[@]}" | sort | uniq
}
exit 1
fi
local loaded_config_list
- while read -r line; do
- loaded_config_list+=("${line}")
- 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 " ")
+ readarray -t loaded_config_list < <(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 " ")
for _config in "${loaded_config_list[@]}"; do
echo -ne "Edit ${_config} ? (y or n)> "
read -r -n 1 _yes_or_no
if [[ -n "${autologin_user}" ]]; then
# autologinを無効化
for _autologin in "autologin-guest" "autologin-user" "autologin-user-timeout" "autologin-in-background" "autologin-session"; do
- remove_key "${_autologin}"
+ lightdm_remove_key "${_autologin}"
done
echo "Canceled automatic login of ${autologin_user}"
fi
# gdm_dconf_get_value <dconf path> <key>
gdm_dconf_get_value(){
- find "/etc/dconf/db/gdm.d/" -type f -print0 | xargs -0i cat {} | crudini --get - "${1}" "${2}" | sed "s|^[\"\']||g" | sed "s|[\"\']$||g"
+ find "/etc/dconf/db/gdm.d/" -type f -print0 | xargs -0 -I{} cat {} | crudini --get - "${1}" "${2}" | sed "s|^[\"\']||g" | sed "s|[\"\']$||g"
}
# gdm_custom_get_value <section> <key>
command_gdm_cursor_wizard(){
# カーソル一覧を取得
local cursor_themes _current_theme="$(gdm_dconf_get_value "org/gnome/desktop/interface" "cursor-theme")"
- while read -r line; do cursor_themes+=("${line}"); done < <(get_cursor_theme)
+ readarray -t cursor_themes < <(get_cursor_theme)
# 一覧を生成
if ! _cursor_theme="$(ask_question -d "${_current_theme}" -p "Please select the cursor theme to use." "${cursor_themes[@]}")"; then
exit 1
fi
local cursor_themes
- while read -r line; do cursor_themes+=("${line}"); done < <(get_cursor_theme)
+ readarray -t cursor_themes < <(get_cursor_theme)
if ! printf "%s\n" "${cursor_themes[@]}" | grep -x "${1}" 1>/dev/null 2>&1; then
msg_error "The cursor theme (${1}) was not found"
exit 1
#== webkit2用コマンド ==#
command_webkit2_theme_wizard(){
local _theme_list
- while read -r line; do
- _theme_list+=("${line}")
- done < <(ls /usr/share/lightdm-webkit/themes)
+ readarray -t _theme_list < <(ls /usr/share/lightdm-webkit/themes)
local _current_theme=$(webkit2_get_value greeter webkit_theme | sed "s|\"||g")
local _theme
common_remove_command "${MODE_CONFIG["webkit2"]}"
}
+command_webkit2_debug(){
+ local _arg="$(echo "${1-""}" | tr "[:upper:]" "[:lower:]")"
+ if ! check_bool "${_arg}"; then
+ msg_error "Please specify true or false"
+ exit 1
+ fi
+ webkit2_set_config "greeter" "debug_mode" "${_arg}"
+}
+
#== Qtquick用の汎用関数 ==#
qtquick_init_configs(){
check_root
command_slick_icon_wizard(){
local icons
- while read -r line; do icons+=("${line}"); done < <(get_icon_theme)
+ readarray -t icons < <(get_icon_theme)
local _icon
echo "Please select the icon theme to use."
command_sddm_cursor_wizard(){
# カーソル一覧を取得
local cursor_themes _current_theme="$(sddm_get_value "Theme" "CursorTheme")"
- while read -r line; do cursor_themes+=("${line}"); done < <(get_cursor_theme)
+ readarray -t cursor_themes < <(get_cursor_theme)
# 一覧を生成
if ! _cursor_theme="$(ask_question -d "${_current_theme}" -p "Please select the cursor theme to use." "${cursor_themes[@]}")"; then
exit 1
fi
local cursor_themes
- while read -r line; do cursor_themes+=("${line}"); done < <(get_cursor_theme)
+ readarray -t cursor_themes < <(get_cursor_theme)
if ! printf "%s\n" "${cursor_themes[@]}" | grep -x "${1}" 1>/dev/null 2>&1; then
msg_error "The cursor theme (${1}) was not found"
exit 1
command_sddm_theme_wizard(){
local _theme_list
- while read -r line; do
- _theme_list+=("${line}")
- done < <(find "/usr/share/sddm/themes/" -maxdepth 1 -mindepth 1 -type d -print0 | xargs -0 -I{} basename {})
+ readarray -t _theme_list < <(find "/usr/share/sddm/themes/" -maxdepth 1 -mindepth 1 -type d -print0 | xargs -0 -I{} basename {})
local _theme _current_theme=$(sddm_get_value "Theme" "Current")
if ! _theme="$(ask_question -d "${_current_theme}" -p "Please select the theme to use." "${_theme_list[@]}")"; then
fi
local session="${1}"
check_session "${session}"
- local session_exec="$(get_session "${session}")"
+ local session_exec="$(get_session_exec "${session}")"
lxdm_set_config "base" "session" "${session_exec}"
}
command_gtk_greeter_icon_wizard(){
local icons
- while read -r line; do icons+=("${line}"); done < <(get_icon_theme)
+ readarray -t icons < <(get_icon_theme)
local _icon
echo "Please select the icon theme to use."
BACKGROUND_DIR="/usr/share/backgrounds"
# Global - 現在のディスプレイマネージャ名
-CURRENT_DM="$(basename "$(readlink "/etc/systemd/system/display-manager.service")" | sed "s|.service$||g")"
+if [[ -f "/etc/systemd/system/display-manager.service" ]]; then
+ CURRENT_DM="$(basename "$(readlink "/etc/systemd/system/display-manager.service")" | sed "s|.service$||g")"
+else
+ CURRENT_DM=""
+fi
# モード
MODE="${CURRENT_DM}"
REMOVE_FILES=false
#== 引数解析 ==#
-ARGUMENT="${*}"
-OPTS="m:e:hG"
-OPTL="mode:,editor:,help,non-interactive,noroot,write-all-files,no-check-target,lightdm-greeter,remove"
-# shellcheck disable=SC2086
-if ! OPT="$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT})"; then
+ARGUMENT=("${@}")
+OPTS=("m:" "e:" "h" "G")
+OPTL=("mode:" "editor:" "help" "non-interactive" "noroot" "write-all-files" "no-check-target" "lightdm-greeter" "remove")
+if ! readarray -t OPT < <(getopt -o "$(printf "%s," "${OPTS[@]}")" -l "$(printf "%s," "${OPTL[@]}")" -- "${ARGUMENT[@]}"); then
exit 1
fi
-eval set -- "${OPT}"
+eval set -- "${OPT[@]}"
unset OPT OPTS OPTL
while true; do
if (( "${#}" >= 1 )); then
shift 1
fi
-COMMAND_ARGS="${*}"
-: "${COMMAND_ARGS-""}" # サブコマンドの引数が何も指定されなかった場合に空文字を代入
+COMMAND_ARGS=("${@}")
+: "${COMMAND_ARGS=""}" # サブコマンドの引数が何も指定されなかった場合に空文字を代入
if [[ "${COMMAND}" = "null" ]]; then
script_usage
check_main_binary
fi
+# 依存コマンドの確認
+ check_tools "jq" "crudini"
+
# コマンドとモードに応じて関数を実行する
case "${COMMAND}" in
+ "accessibility")
+ check_command_dm "gdm"
+ gdm_init_configs
+ command_gdm_accessibility "${COMMAND_ARGS[@]}"
+ ;;
"autologin")
check_command_dm "lightdm" "gdm" "sddm" "lxdm"
case "${MODE}" in
"lightdm")
lightdm_init_configs
- command_lightdm_auto_login "${COMMAND_ARGS}"
+ command_lightdm_auto_login "${COMMAND_ARGS[@]}"
;;
"gdm")
gdm_init_configs
- command_gdm_auto_login "${COMMAND_ARGS}"
+ command_gdm_auto_login "${COMMAND_ARGS[@]}"
;;
"sddm")
sddm_init_configs
- command_sddm_auto_login "${COMMAND_ARGS}"
+ command_sddm_auto_login "${COMMAND_ARGS[@]}"
;;
"lxdm")
lxdm_init_configs
- command_lxdm_auto_login "${COMMAND_ARGS}"
+ command_lxdm_auto_login "${COMMAND_ARGS[@]}"
;;
esac
;;
- "greeter")
- check_command_dm "lightdm"
- lightdm_init_configs
- command_lightdm_greeter_wizard
- ;;
- "greeter-change")
- check_command_dm "lightdm"
- lightdm_init_configs
- command_lightdm_greeter_change "${COMMAND_ARGS}"
- ;;
- "greeter-create")
- check_command_dm "lightdm"
- lightdm_init_configs
- command_lightdm_greeter_create "${COMMAND_ARGS}"
- ;;
- "greeter-list")
- check_command_dm "lightdm"
- command_lightdm_greeter_list
- ;;
- "greeter-edit")
- check_command_dm "lightdm"
- check_root
- command_lightdm_greeter_edit "${COMMAND_ARGS}"
- ;;
- "remove")
- check_command_dm "lightdm" "gdm" "webkit2" "qtquick"
- check_root
- eval "command_${MODE}_remove"
- ;;
- "edit")
- check_command_dm "lightdm" "gdm"
+ "back")
+ check_command_dm "qtquick" "slick" "lxdm"
case "${MODE}" in
- "lightdm")
- check_root
- command_lightdm_edit
+ "qtquick")
+ qtquick_init_configs
+ command_qtquick_back "${COMMAND_ARGS[@]}"
;;
- "gdm")
- gdm_init_configs
- command_gdm_edit
+ "slick")
+ slick_init_configs
+ command_slick_back "${COMMAND_ARGS[@]}"
+ ;;
+ "back")
+ lxdm_init_configs
+ command_lxdm_back "${COMMAND_ARGS[@]}"
;;
esac
;;
- "show-config")
- check_command_dm "lightdm"
- command_lightdm_show_config
- ;;
"cursor")
check_command_dm "gdm" "sddm"
case "${MODE}" in
case "${MODE}" in
"gdm")
gdm_init_configs
- command_gdm_cursor_change "${COMMAND_ARGS}"
+ command_gdm_cursor_change "${COMMAND_ARGS[@]}"
;;
"sddm")
sddm_init_configs
- command_sddm_cursor_change "${COMMAND_ARGS}"
- ;;
- esac
- ;;
- "sound")
- check_command_dm "gdm"
- gdm_init_configs
- command_gdm_sound "${COMMAND_ARGS}"
- ;;
- "logo")
- check_command_dm "gdm" "slick"
- case "${MODE}" in
- "gdm")
- gdm_init_configs
- command_gdm_logo "${COMMAND_ARGS}"
- ;;
- "slick")
- slick_init_configs
- command_slick_logo "${COMMAND_ARGS}"
+ command_sddm_cursor_change "${COMMAND_ARGS[@]}"
;;
esac
;;
- "tap")
- check_command_dm "gdm"
- gdm_init_configs
- command_gdm_tap "${COMMAND_ARGS}"
- ;;
- "accessibility")
- check_command_dm "gdm"
- gdm_init_configs
- command_gdm_accessibility "${COMMAND_ARGS}"
+ "debug")
+ check_comamnd_dm "webkit2"
+ command_webkit2_debug "${COMMAND_ARGS[@]}"
;;
- "root-login")
- check_command_dm "gdm"
- gdm_init_configs
- command_gdm_root_login "${COMMAND_ARGS}"
+ "dm")
+ command_general_dm "${COMMAND_ARGS[@]}"
;;
- "theme")
- check_command_dm "webkit2" "sddm"
+ "edit")
+ check_command_dm "lightdm" "gdm"
case "${MODE}" in
- "webkit2")
- webkit2_init_configs
- command_webkit2_theme_wizard
+ "lightdm")
+ check_root
+ command_lightdm_edit
;;
- "sddm")
- sddm_init_configs
- command_sddm_theme_wizard
+ "gdm")
+ gdm_init_configs
+ command_gdm_edit
;;
esac
;;
- "theme-change")
- check_command_dm "webkit2" "sddm"
- case "${MODE}" in
- "webkit2")
- webkit2_init_configs
- command_webkit2_theme_change "${COMMAND_ARGS}"
- ;;
- "sddm")
- sddm_init_configs
- command_sddm_theme_change
- ;;
- esac
+ "edit-script")
+ check_command_dm "lxdm"
+ lxdm_init_configs
+ comamnd_lxdm_edit_script
;;
"gtk")
check_command_dm "slick" "lxdm" "gtkg"
;;
esac
;;
+ "greeter")
+ check_command_dm "lightdm"
+ lightdm_init_configs
+ command_lightdm_greeter_wizard
+ ;;
+ "greeter-change")
+ check_command_dm "lightdm"
+ lightdm_init_configs
+ command_lightdm_greeter_change "${COMMAND_ARGS[@]}"
+ ;;
+ "greeter-create")
+ check_command_dm "lightdm"
+ lightdm_init_configs
+ command_lightdm_greeter_create "${COMMAND_ARGS[@]}"
+ ;;
+ "greeter-edit")
+ check_command_dm "lightdm"
+ check_root
+ command_lightdm_greeter_edit "${COMMAND_ARGS[@]}"
+ ;;
+ "greeter-list")
+ check_command_dm "lightdm"
+ command_lightdm_greeter_list
+ ;;
+
+ "grid")
+ check_command_dm "slick"
+ slick_init_configs
+ command_slick_grid "${COMMAND_ARGS[@]}"
+ ;;
"gtk-change")
check_command_dm "slick" "lxdm" "gtkg"
case "${MODE}" in
"slick")
slick_init_configs
- command_slick_gtk_change "${COMMAND_ARGS}"
+ command_slick_gtk_change "${COMMAND_ARGS[@]}"
;;
"lxdm")
- command_lxdm_gtk_change "${COMMAND_ARGS}"
+ command_lxdm_gtk_change "${COMMAND_ARGS[@]}"
;;
"gtkg")
- command_gtk_greeter_gtk_change "${COMMAND_ARGS}"
- ;;
- esac
- ;;
- "back")
- check_command_dm "qtquick" "slick" "lxdm"
- case "${MODE}" in
- "qtquick")
- qtquick_init_configs
- command_qtquick_back "${COMMAND_ARGS}"
- ;;
- "slick")
- slick_init_configs
- command_slick_back "${COMMAND_ARGS}"
- ;;
- "back")
- lxdm_init_configs
- command_lxdm_back "${COMMAND_ARGS}"
+ command_gtk_greeter_gtk_change "${COMMAND_ARGS[@]}"
;;
esac
;;
- "grid")
- check_command_dm "slick"
- slick_init_configs
- command_slick_grid "${COMMAND_ARGS}"
- ;;
"icon")
check_command_dm "slick" "gtkg"
case "${MODE}" in
case "${MODE}" in
"slick")
slick_init_configs
- command_slick_icon_chenge "${COMMAND_ARGS}"
+ command_slick_icon_chenge "${COMMAND_ARGS[@]}"
;;
"gtkg")
gtk_greeter_init_configs
- command_gtk_greeter_icon_chenge "${COMMAND_ARGS}"
+ command_gtk_greeter_icon_chenge "${COMMAND_ARGS[@]}"
;;
esac
;;
- "other-monitor")
- check_command_dm "slick"
- slick_init_configs
- command_slick_other_monitor "${COMMAND_ARGS}"
+ "logo")
+ check_command_dm "gdm" "slick"
+ case "${MODE}" in
+ "gdm")
+ gdm_init_configs
+ command_gdm_logo "${COMMAND_ARGS[@]}"
+ ;;
+ "slick")
+ slick_init_configs
+ command_slick_logo "${COMMAND_ARGS[@]}"
+ ;;
+ esac
;;
"numlock")
check_command_dm "sddm"
sddm_init_configs
- command_sddm_numlock "${COMMAND_ARGS}"
+ command_sddm_numlock "${COMMAND_ARGS[@]}"
;;
- "tty")
- check_command_dm "sddm"
- sddm_init_configs
- command_sddm_tty "${COMMAND_ARGS}"
+ "other-monitor")
+ check_command_dm "slick"
+ slick_init_configs
+ command_slick_other_monitor "${COMMAND_ARGS[@]}"
+ ;;
+ "remove")
+ check_command_dm "lightdm" "gdm" "webkit2" "qtquick"
+ check_root
+ eval "command_${MODE}_remove"
+ ;;
+ "remove-last")
+ check_command_dm "lxdm"
+ lxdm_init_configs
+ command_lxdm_remove_last
+ ;;
+ "root-login")
+ check_command_dm "gdm"
+ gdm_init_configs
+ command_gdm_root_login "${COMMAND_ARGS[@]}"
;;
"session")
check_command_dm "lxdm"
"session-change")
check_command_dm "lxdm"
lxdm_init_configs
- command_lxdm_session_change "${COMMAND_ARGS}"
+ command_lxdm_session_change "${COMMAND_ARGS[@]}"
;;
- "remove-last")
- check_command_dm "lxdm"
- lxdm_init_configs
- command_lxdm_remove_last
+ "show-config")
+ check_command_dm "lightdm"
+ command_lightdm_show_config
;;
- "edit-script")
- check_command_dm "lxdm"
- lxdm_init_configs
- comamnd_lxdm_edit_script
+
+ "sound")
+ check_command_dm "gdm"
+ gdm_init_configs
+ command_gdm_sound "${COMMAND_ARGS[@]}"
;;
- "dm")
- command_general_dm "${COMMAND_ARGS}"
+ "tap")
+ check_command_dm "gdm"
+ gdm_init_configs
+ command_gdm_tap "${COMMAND_ARGS[@]}"
+ ;;
+ "theme")
+ check_command_dm "webkit2" "sddm"
+ case "${MODE}" in
+ "webkit2")
+ webkit2_init_configs
+ command_webkit2_theme_wizard
+ ;;
+ "sddm")
+ sddm_init_configs
+ command_sddm_theme_wizard
+ ;;
+ esac
+ ;;
+ "theme-change")
+ check_command_dm "webkit2" "sddm"
+ case "${MODE}" in
+ "webkit2")
+ webkit2_init_configs
+ command_webkit2_theme_change "${COMMAND_ARGS[@]}"
+ ;;
+ "sddm")
+ sddm_init_configs
+ command_sddm_theme_change
+ ;;
+ esac
+ ;;
+ "tty")
+ check_command_dm "sddm"
+ sddm_init_configs
+ command_sddm_tty "${COMMAND_ARGS[@]}"
+ ;;
+ "gtk-list")
+ get_gtk_theme
+ exit 0
;;
"lightdm" | "gdm" | "sddm" | "lxdm" | "webkit2" | "qtquick" | "slick" | "gtkg")
- command_mode "${COMMAND}" "${COMMAND_ARGS}"
+ command_mode "${COMMAND}" "${COMMAND_ARGS[@]}"
+ ;;
+ "help")
+ script_usage
+ exit 0
;;
*)
msg_error "This command cannot be used in any mode"