@ -1,4 +1,4 @@
|
|||||||
[Seat:*]
|
[Seat:*]
|
||||||
#autologin-user=
|
|
||||||
#autologin-user-timeout=
|
|
||||||
#autologin-session=
|
#autologin-session=
|
||||||
|
#autologin-user=
|
||||||
|
autologin-user-timeout=
|
||||||
|
@ -17,7 +17,7 @@ mkdir -p "${config_dir}/environment.d"
|
|||||||
|
|
||||||
[[ -f "$config_dir/$SENTINEL_FILE" ]] && source "$config_dir/$SENTINEL_FILE"
|
[[ -f "$config_dir/$SENTINEL_FILE" ]] && source "$config_dir/$SENTINEL_FILE"
|
||||||
|
|
||||||
session="${1:-gamescope}"
|
session="${1:-portprotonqt}"
|
||||||
session_launcher=""
|
session_launcher=""
|
||||||
create_sentinel=""
|
create_sentinel=""
|
||||||
|
|
||||||
@ -45,9 +45,9 @@ update_config_sentinel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configure_lightdm() {
|
configure_lightdm() {
|
||||||
sed -i "s/^.*autologin-user=.*/autologin-user=${USER}/" /etc/lightdm/lightdm.conf.d/10-gamescope-session.conf
|
|
||||||
sed -i "s/^.*autologin-user-timeout=.*/autologin-user-timeout=0/" /etc/lightdm/lightdm.conf.d/10-gamescope-session.conf
|
|
||||||
sed -i "s/^.*autologin-session=.*/autologin-session=$session_launcher/" /etc/lightdm/lightdm.conf.d/10-gamescope-session.conf
|
sed -i "s/^.*autologin-session=.*/autologin-session=$session_launcher/" /etc/lightdm/lightdm.conf.d/10-gamescope-session.conf
|
||||||
|
sed -i "s/^.*autologin-user=.*/autologin-user=${USER}/" /etc/lightdm/lightdm.conf.d/10-gamescope-session.conf
|
||||||
|
systemctl reset-failed lightdm
|
||||||
systemctl restart lightdm
|
systemctl restart lightdm
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,11 +55,12 @@ configure_sddm() {
|
|||||||
sed -i "s/^.*Relogin=.*/Relogin=true/" /etc/sddm.conf.d/10-gamescope-session.conf
|
sed -i "s/^.*Relogin=.*/Relogin=true/" /etc/sddm.conf.d/10-gamescope-session.conf
|
||||||
sed -i "s/^.*Session=.*/Session=$session_launcher/" /etc/sddm.conf.d/10-gamescope-session.conf
|
sed -i "s/^.*Session=.*/Session=$session_launcher/" /etc/sddm.conf.d/10-gamescope-session.conf
|
||||||
sed -i "s/^.*User=.*/User=${USER}/" /etc/sddm.conf.d/10-gamescope-session.conf
|
sed -i "s/^.*User=.*/User=${USER}/" /etc/sddm.conf.d/10-gamescope-session.conf
|
||||||
|
systemctl reset-failed sddm
|
||||||
systemctl restart sddm
|
systemctl restart sddm
|
||||||
}
|
}
|
||||||
|
|
||||||
yad_question() {
|
yad_question() {
|
||||||
yad --window-icon="/usr/share/icons/hicolor/scalable/actions/steamdeck-gaming-return.svg" --image="/usr/share/icons/hicolor/scalable/actions/steamdeck-gaming-return.svg" --question --title="$1" --text="$2" --width=300 --text-align=center
|
yad --window-icon="/usr/share/icons/hicolor/scalable/actions/portprotonqt-gaming-return.svg" --image="/usr/share/icons/hicolor/scalable/actions/portprotonqt-gaming-return.svg" --question --title="$1" --text="$2" --width=300 --text-align=center
|
||||||
[[ "$?" != 0 ]] && return 1 || return 0
|
[[ "$?" != 0 ]] && return 1 || return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,7 +133,7 @@ if [[ ! -z $4 ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if systemctl is-active --quiet gdm; then
|
if systemctl is-active --quiet gdm; then
|
||||||
yad --window-icon="/usr/share/icons/hicolor/scalable/actions/steamdeck-gaming-return.svg" --image="/usr/share/icons/hicolor/scalable/actions/steamdeck-gaming-return.svg" --title="Требуется подтверждение" --text="Для работы данной функции требуется LIGHTDM или SDDM, GDM не поддерживается" --width=290 --text-align=center --button="OK"
|
yad --window-icon="/usr/share/icons/hicolor/scalable/actions/portprotonqt-gaming-return.svg" --image="/usr/share/icons/hicolor/scalable/actions/portprotonqt-gaming-return.svg" --title="Требуется подтверждение" --text="Для работы данной функции требуется LIGHTDM или SDDM, GDM не поддерживается" --width=290 --text-align=center --button="OK"
|
||||||
if [[ -f "$config_dir/$SENTINEL_FILE" ]]; then
|
if [[ -f "$config_dir/$SENTINEL_FILE" ]]; then
|
||||||
if grep -iq "autologin" "$config_dir/$SENTINEL_FILE"; then
|
if grep -iq "autologin" "$config_dir/$SENTINEL_FILE"; then
|
||||||
if ! grep -q "autologin=false" "$config_dir/$SENTINEL_FILE"; then
|
if ! grep -q "autologin=false" "$config_dir/$SENTINEL_FILE"; then
|
||||||
@ -149,7 +150,7 @@ if systemctl is-active --quiet gdm; then
|
|||||||
die "Autologin configuration aborted due to GDM."
|
die "Autologin configuration aborted due to GDM."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! grep -iq "autologin" "$config_dir/$SENTINEL_FILE" && [[ "$2" == "desktop" ]]; then
|
if ! grep -iq "autologin" "$config_dir/$SENTINEL_FILE"; then
|
||||||
if yad_question "Требуется подтверждение" "Для работы данной функции требуется настроить автологин. Хотите ли вы, чтобы это было настроено автоматически?" ; then
|
if yad_question "Требуется подтверждение" "Для работы данной функции требуется настроить автологин. Хотите ли вы, чтобы это было настроено автоматически?" ; then
|
||||||
echo "autologin=true" >> "$config_dir/$SENTINEL_FILE"
|
echo "autologin=true" >> "$config_dir/$SENTINEL_FILE"
|
||||||
echo "autologin enabled"
|
echo "autologin enabled"
|
||||||
|
Reference in New Issue
Block a user