Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
funkeymonkey-pyrainput
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
packages
funkeymonkey-pyrainput
Commits
13f84553
Commit
13f84553
authored
Sep 30, 2017
by
sebt3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addded sudoers
parent
a9e3b426
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
20 deletions
+17
-20
CMakeLists.txt
CMakeLists.txt
+1
-0
pyrainputctl
pyrainputctl
+15
-20
sudoers
sudoers
+1
-0
No files found.
CMakeLists.txt
View file @
13f84553
...
...
@@ -28,3 +28,4 @@ if (SYSTEMD_FOUND)
DESTINATION
"
${
SYSTEMD_SERVICES_INSTALL_DIR
}
"
)
endif
(
SYSTEMD_FOUND
)
install
(
FILES
"
${
PROJECT_SOURCE_DIR
}
/pyrainputctl"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ DESTINATION sbin
)
install
(
FILES
"
${
PROJECT_SOURCE_DIR
}
/sudoers"
PERMISSIONS OWNER_READ OWNER_WRITE DESTINATION /etc/sudoers.d RENAME pyrainput
)
pyrainputctl
View file @
13f84553
...
...
@@ -2,42 +2,37 @@
CFG
=
/etc/pyrainput.cfg
help
()
{
cat
<<
ENDHELP
$1
{enable|disable} {keypad|gamepad|mouse}
ENDHELP
}
unsetValue
()
{
local
key
=
$1
[
!
-e
$CFG
]
&&
touch
$CFG
sed
-ie
'/^'
"
$key
"
'/d'
$CFG
}
setValue
()
{
local
key
=
$1
local
val
=
$2
unsetValue
"
$key
"
echo
"
$key
=
$val
"
>>
$CFG
}
case
"
$
1
-
$
2
"
in
disable-keypad
)
setValue keypad.export 0
;;
enable-keypad
)
unsetValue key
pad.export
;;
disable-gamepad
)
setValue gamepad.export 0
;;
enable-gamepad
)
unsetValue gamepad.export
;;
disable-mouse
)
setValue mouse.export 0
;;
enable-mouse
)
unsetValue mouse.export
;;
*
)
help
$0
;
exit
1
;;
case
"
$2
"
in
keypad|[kK][eE][yY]
*
)
TARGET
=
keypad.export
;;
gamepad|[gG][aA][mM][eE]
*
)
TARGET
=
game
pad.export
;;
mouse|[mM][oO][uU][sS][eE]
)
TARGET
=
mouse.export
;;
*
)
help
$0
;
exit
1
;;
esac
case
$1
in
enable
|
[
eE][nN][aA]
*
)
setValue
$TARGET
1
;;
disable|[dD][iI][sS]
*
)
setValue
$TARGET
0
;;
*
)
help
$0
;
exit
1
;;
esac
systemctl reload pyrainput
sudoers
0 → 100644
View file @
13f84553
%sudo ALL=(ALL)NOPASSWD: /usr/sbin/pyrainputctl
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment