Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

development suggestion. #40

Open
dr3mro opened this issue Jan 1, 2022 · 0 comments
Open

development suggestion. #40

dr3mro opened this issue Jan 1, 2022 · 0 comments

Comments

@dr3mro
Copy link

dr3mro commented Jan 1, 2022

Thank you for your hard work but I have a tiny suggestion.
I have found a way to automount on startup
first:
create file
.config/systemd/user/mchfuse.service

[Unit]
Description=NetStorage MCH fuse mounter
Wants=network.target
After=network.target

[Service]
ExecStartPre=sleep 10
ExecStart=mchfuse -f -c %h/.config/mchfuse.conf  NetStorage %h/NetStorage

[Install]
WantedBy=graphical-session.target

then execute
systemctl --user start mchfuse.service
systemctl --user enable mchfuse.service
systemctl --user status mchfuse.service

and reboot
now it will automount on startup

user may need to chnage the device name and mount path as needed and save the conf file in ~/.config

:: EDIT ::

AFTER SLEEP MCH not working so I did unmount before and remount after sleep

mchfuse-sleep.service

[Unit]
Description=Unmount before sleep
Before=sleep.target
Requires=mchfuse.service
Conflicts=sleep.target

[Service]
Type=oneshot
ExecStart=umount %h/NetStorage
RemainAfterExit=No

[Install]
WantedBy=graphical.target

mchfuse-wake.service

[Unit]
Description=remount MCH after wake up from sleep
After=hibernate.target
After=hybrid-sleep.target
After=suspend.target
After=suspend-then-hibernate.target
Requires=mscfuse.service 
[Service]
Type=simple
ExecStart=/bin/systemctl --no-block --user restart mchfuse.service

[Install]
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target
WantedBy=suspend.target
WantedBy=suspend-then-hibernate.target

the user can enable using

systemctl --user enable mchfuse-wakeup.service
systemctl --user enable mchfuse-sleep.service

now it automount after startup and unmount during sleep and remount in wakeup

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant