Skip to content

Commit 03b7224

Browse files
dbar4gun: new Wii remote userspace driver
1 parent 514828e commit 03b7224

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed
+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/usr/bin/env bash
2+
3+
# This file is part of The RetroPie Project
4+
#
5+
# The RetroPie Project is the legal property of its developers, whose names are
6+
# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
7+
#
8+
# See the LICENSE.md file at the top-level directory of this distribution and
9+
# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
10+
#
11+
12+
rp_module_id="dbar4gun"
13+
rp_module_desc="dbar4gun is a Linux userspace driver for the wiimote with DolphinBar support."
14+
rp_module_help="dbar4gun dvr from https://github.com/lowlevel-1989/dbar4gun"
15+
rp_module_licence="MIT https://raw.githubusercontent.com/lowlevel-1989/dbar4gun/master/LICENSE"
16+
rp_module_repo="git https://github.com/lowlevel-1989/dbar4gun master"
17+
rp_module_section="driver"
18+
19+
function depends_dbar4gun() {
20+
getDepends python3 python3-dev python3-setuptools python3-virtualenv
21+
}
22+
23+
function sources_dbar4gun() {
24+
gitPullOrClone
25+
}
26+
27+
function install_dbar4gun() {
28+
virtualenv -p python3 "$md_inst"
29+
source "$md_inst/bin/activate"
30+
pip3 install .
31+
deactivate
32+
}
33+
34+
function enable_dbar4gun() {
35+
local config="/etc/systemd/system/dbar4gun.service"
36+
37+
disable_dbar4gun
38+
cat > "$config" << _EOF_
39+
[Unit]
40+
Description=dbar4gun
41+
42+
[Service]
43+
Type=simple
44+
ExecStart=$md_inst/bin/dbar4gun --width $1 --height $2
45+
46+
[Install]
47+
WantedBy=multi-user.target
48+
_EOF_
49+
systemctl daemon-reload
50+
51+
systemctl enable dbar4gun --now
52+
printMsgs "dialog" "dbar4gun enabled."
53+
}
54+
55+
function disable_dbar4gun() {
56+
systemctl disable dbar4gun --now
57+
}
58+
59+
function remove_dbar4gun() {
60+
disable_dbar4gun
61+
rm -rf "/etc/systemd/system/dbar4gun.service"
62+
systemctl daemon-reload
63+
}
64+
65+
function gui_dbar4gun() {
66+
local cmd=(dialog --backtitle "$__backtitle" --menu "Choose an option." 22 86 16)
67+
local options=(
68+
1 "Enable/Restart dbar4gun (1080p)"
69+
2 "Enable/Restart dbar4gun (720p)"
70+
3 "Disable dbar4gun"
71+
)
72+
while true; do
73+
local choice=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
74+
if [[ -n "$choice" ]]; then
75+
case "$choice" in
76+
1)
77+
enable_dbar4gun "1920" "1080"
78+
;;
79+
2)
80+
enable_dbar4gun "1280" "720"
81+
;;
82+
3)
83+
disable_dbar4gun
84+
;;
85+
esac
86+
else
87+
break
88+
fi
89+
done
90+
}

0 commit comments

Comments
 (0)