Skip to content

Commit

Permalink
Replace HandyGCCS with InputPlumber
Browse files Browse the repository at this point in the history
  • Loading branch information
pastaq authored and Derek J. Clark committed Apr 11, 2024
1 parent 14d9899 commit edf600f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
4 changes: 2 additions & 2 deletions manifest
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ export AUR_PACKAGES="\
frzr \
gamescope-session-steam-git \
gamescope-session-steam-plus-git \
handygccs-git \
hhfc-git \
inputplumber-bin \
legendary \
lib32-gamescope-plus \
lib32-gperftools \
Expand Down Expand Up @@ -238,9 +238,9 @@ export SERVICES="\
bluetooth \
bluetooth-workaround \
fstrim.timer \
handycon \
haveged \
home-swapfile.swap \
inputplumber \
lightdm \
powerstation \
sshd \
Expand Down
26 changes: 11 additions & 15 deletions rootfs/usr/bin/chimera-session
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,31 @@ SESSION_LIGHTDM_CONFIG="/etc/lightdm/lightdm.conf.d/10-chimeraos-session.conf"
SESSION_LIST=('desktop' 'desktop-xorg' 'steam' 'steam-plus' 'opengamepadui')
SELECTED_SESSION="$1"


mkdir -p "${CONFIG_HOME}/environment.d"

function print_session_list() {
# detect active session
CURRENT_SESSION="unknown"
if grep "gnome" ${SESSION_LIGHTDM_CONFIG} &> /dev/null; then
if grep "gnome" ${SESSION_LIGHTDM_CONFIG} &>/dev/null; then
CURRENT_SESSION="desktop"
fi

if grep "gnome-xorg" ${SESSION_LIGHTDM_CONFIG} &> /dev/null; then
if grep "gnome-xorg" ${SESSION_LIGHTDM_CONFIG} &>/dev/null; then
CURRENT_SESSION="desktop-xorg"
fi

if grep "gamescope-session-steam" ${SESSION_LIGHTDM_CONFIG} &> /dev/null; then
if grep "gamescope-session-steam" ${SESSION_LIGHTDM_CONFIG} &>/dev/null; then
CURRENT_SESSION="steam"
fi

if grep "gamescope-session-steam-plus" ${SESSION_LIGHTDM_CONFIG} &> /dev/null; then
if grep "gamescope-session-steam-plus" ${SESSION_LIGHTDM_CONFIG} &>/dev/null; then
CURRENT_SESSION="steam-plus"
fi

if grep "gamescope-session-opengamepadui" ${SESSION_LIGHTDM_CONFIG} &> /dev/null; then
if grep "gamescope-session-opengamepadui" ${SESSION_LIGHTDM_CONFIG} &>/dev/null; then
CURRENT_SESSION="opengamepadui"
fi


# print active and available sessions
for t in ${SESSION_LIST[@]}; do
if [ "${CURRENT_SESSION}" = "${t}" ]; then
Expand Down Expand Up @@ -65,23 +63,23 @@ function desktop_xorg() {

function gamescope_steam() {
# switch to Steam Big Picture UI (Gamescope/Wayland)
echo '' > ${SESSION_CONFIG}
echo '' >${SESSION_CONFIG}
sudo chimera-session-use-lightdm gamescope-session-steam
sudo systemctl enable --now handycon
sudo systemctl enable --now inputplumber # remove when fully integrated into opengamepadui
}

function gamescope_opengamepadui() {
# switch to OpengamepadUI (Gamescope/Wayland)
echo '' > ${SESSION_CONFIG}
echo '' >${SESSION_CONFIG}
sudo chimera-session-use-lightdm gamescope-session-opengamepadui
sudo systemctl disable --now handycon
sudo systemctl disable --now inputplumber
}

function gamescope_steam_plus() {
# switch to Steam plus OpengamepadUI overlay (Gamescope/Wayland)
echo '' > ${SESSION_CONFIG}
echo '' >${SESSION_CONFIG}
sudo chimera-session-use-lightdm gamescope-session-steam-plus
sudo systemctl disable --now handycon
sudo systemctl disable --now inputplumber
}

function print_invalid_session() {
Expand All @@ -91,8 +89,6 @@ function print_invalid_session() {
print_session_list
}



# print current and available sessions when no argument specified
if [ -z "${SELECTED_SESSION}" ]; then
print_session_list
Expand Down

0 comments on commit edf600f

Please sign in to comment.