RetroPie-Setup/scriptmodules/supplementary/xarcade2jstick.sh
Jools Wills 5010c5fd69 Use rp_module_repo for some packages that don't install to md_build by default
Mostly drivers and supplementary packages - most install to md_inst which should be handled better now,
but also adjusted sixaxis to use md_build rather than a subfolder in md_build as it didn't seem to require it.
2021-02-15 23:54:13 +00:00

73 lines
2 KiB
Bash

#!/usr/bin/env bash
# This file is part of The RetroPie Project
#
# The RetroPie Project is the legal property of its developers, whose names are
# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
#
# See the LICENSE.md file at the top-level directory of this distribution and
# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
#
rp_module_id="xarcade2jstick"
rp_module_desc="Xarcade2Jstick"
rp_module_licence="GPL3 https://raw.githubusercontent.com/petrockblog/Xarcade2Jstick/master/gpl3.txt"
rp_module_repo="git https://github.com/petrockblog/Xarcade2Joystick.git master"
rp_module_section="driver"
rp_module_flags="noinstclean"
function sources_xarcade2jstick() {
gitPullOrClone "$md_inst"
}
function build_xarcade2jstick() {
cd "$md_inst"
make
}
function install_xarcade2jstick() {
cd "$md_inst"
make install
}
function enable_xarcade2jstick() {
cd "$md_inst"
make installservice
}
function disable_xarcade2jstick() {
cd "$md_inst"
make uninstallservice
}
function remove_xarcade2jstick() {
[[ -f /lib/systemd/system/xarcade2jstick.service ]] && disable_xarcade2jstick
cd "$md_inst"
make uninstall
}
function gui_xarcade2jstick() {
local status
local options=(
1 "Enable Xarcade2Jstick service."
2 "Disable Xarcade2Jstick service."
)
while true; do
status="Disabled"
[[ -f /lib/systemd/system/xarcade2jstick.service ]] && status="Enabled"
local cmd=(dialog --backtitle "$__backtitle" --menu "Service is currently: $status" 22 86 16)
local choice=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
[[ -z "$choice" ]] && break
case "$choice" in
1)
enable_xarcade2jstick
printMsgs "dialog" "Enabled Xarcade2Jstick."
;;
2)
disable_xarcade2jstick
printMsgs "dialog" "Disabled Xarcade2Jstick service."
;;
esac
done
}