Bash library nxhshlib¶
prime_user
Returns the username of the first user having an X session running. This is used in various nxhelper tools, for example for screen locking or messegae sending.
This is kind of stub.\
Screen locking should happen for all X session, all logged in VTs and even for all Wayland sessions.\
Messages should also go to all users. Or maybe not, because of security.\
This is all kind of a mess to be sorted out. For now, it works for me in a single seat scenario. It most certainly will NOT work in a multi-seat setup.
WARNING this is probably a security issue. At least for multi seat and/or multi user setups.
mount_dev_is_blocked dev
Returns 0 if `dev` is blocked by key mount_block in either system or session config. 1 otherwise.
This is buggy: The user should be able to block additional devices, but not mask devices blocked by system. But right now, any user blocked device masks all system blocked devices.
umount_dev_is_auto_blocked dev
Returns 0 if `dev` is blocked for auto-mount by key umount_auto_skip in either system or session config. 1 otherwise.
This is buggy: The user should be able to block additional devices, but not mask devices blocked by system. But right now, any user blocked device masks all system blocked devices.
dev_is_mountable dev mounted
Returns 0 if `dev` is mountable, eg its neither blocked nor already mounted (as by the list of mounted deviced `mounted`).
get_mountable_devsStores a list of "mountable devices" in `$devices`. This list is dependant on the type of mounter which is configured by key mount_method: udiskie or pmount.
- For udiskie, those are all devices reported by `udiskie-info -a -f is_filesystem` which are mountable according to dev_is_mountable
- For pmount, those are all devices stated in key mount_devs which are mountable according to dev_is_mountable
get_unmountable_devsStores a list of "unmountable devices" in `$devices`. This list is dependant on the type of mounter which is configured by key mount_method: udiskie or pmount.
- For udiskie, those are all devices mounted under /run/media/USER
- For pmount, those are all devices mounted under /media
display_by_username user
Echoes the X11 Display (as in `$DISPLAY`) for `user` (if any). Returns 0 if `user` has one, 1 otherwise.
This is not much tested and may fail.
is_docked
Return 0 if the system is docked, 1 otherwise. Does (in theory) the same as is_docked from nxhclib (Parameter `pseudo_dock` is read as value of key pseudo_dock.
Updated by Stefan Mark over 4 years ago · 1 revisions