blob: e275aa7adbd176eb008bf69816235b41fafdac47 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# README for myautomount
## Overview
Myautomount is a solution for desktop users who want to have easy access to removable media, without dbus. Dependencies include autofs, python3, and gtk3. This package provides a system tray icon that displays the available removable media that can be mounted with autofs.
Myautomount is my response to the Go tool by Project Trident, [trident-automount][1]. I translated the Go tool almost line-for-line into shell, and then modified it slightly.
## Design and architecture
A shell script, myautomountd, wraps around `udevadm monitor` to watch for block devices that are added and removed. Upon finding a new block device, the daemon will generate pseudo-xdg [desktop files][2] in a particular directory which defaults to `/run/user/${UID}/media`.
The tray icon uses a python implementation of [inotify][3] to watch that directory, and generate menus for the left- and right-click actions.
## Testing and building myautomount
Build dependencies include txt2man, and my txtman-wrapper from [bgscripts-core][4].
Use environment variable `MYA_PREFIX` for testing.
export MYA_PREFIX=~/dev/myautomount/src
sudo DEBUG=1 MYA_PREFIX=~/dev/myautomount/src sh -x usr/libexec/myautomount/myautomount-initialize.sh
## TODO
A number of steps are still required before this package is production-worthy.
* add sudo rule
* make daemon invoke initialize script with sudo. This has to happen so the uid= in the autofs definition is the current user. So multi-seat usage could break the functionality, but that would also break regular file permissions.
# References
[1]: https://github.com/project-trident/trident-utilities/blame/master/src-go/automount/main.go
[2]: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
[3]: https://github.com/seb-m/pyinotify
[4]: https://gitlab.com/bgstack15/bgscripts/-/blob/master/src/usr/bin/txt2man-wrapper
|