Browse code

Updating config and README

Steven Saus authored on 14/08/2019 22:47:57
Showing 3 changed files

... ...
@@ -1,28 +1,58 @@
1 1
 # obdevicemenu_udisks2_bash
2
-A bash implementation of obdevicemenu that utilizes udisks2
2
+An Openbox pipe menu for the management of removable media with Udisks utilizing udisks2
3 3
 
4
+## Contents
5
+ 1. [About](#1-about)
6
+ 2. [License](#2-license)
7
+ 3. [Prerequisites](#3-prerequisites)
8
+ 4. [How to use](#4-how-to-use)
9
+ 5. [TODO](#5-todo)
4 10
 
5
-An Openbox pipe menu for the management of removable media with Udisks
11
+***
12
+ 
13
+## 1. About
6 14
 
7
-dependecies
15
+`obdevicemenu` is an Openbox pipe menu that uses udisks to easily mount, 
16
+unmount or eject removable devices. An extensive configuration file allows 
17
+desktop notifications about the success or failure of operations, as well as 
18
+the modification of several commands.
8 19
 
9
-udisks2
10
-lsblk
20
+This script does not provide automounting of removable media as there are 
21
+already many ways to automount. The file managers in GNOME and KDE handle 
22
+automounting, while udev rules or scripts like Udiskie can be used in other 
23
+environments.
11 24
 
25
+This script was originally written by 
26
+[Jamie Nguyen](https://bbs.archlinux.org/viewtopic.php?id=114702). The original version 
27
+utilized only udisks which is no longer installable in Debian Buster, so... yeah.
12 28
 
13
-A WORK IN PROGRESS, folks.
29
+## 2. License
14 30
 
15
-obdevicemenu is an Openbox pipe menu that uses udisks to easily mount, unmount or eject removable devices. An extensive configuration file allows desktop notifications about the success or failure of operations, as well as the modification of several commands.
31
+This project is licensed under the GPL3 license. For the full license, see `LICENSE`.
16 32
 
17
-This script does not provide automounting of removable media as there are already many ways to automount. The file managers in GNOME and KDE handle automounting, while udev rules or scripts like Udiskie can be used in other environments.
18 33
 
19
-Notes
20
-Dbus  and consolekit/policykit need to be running. If you aren't using a login manager, put this in ~/.xinitrc:
34
+## 3. Prerequisites
21 35
 
36
+ * `openbox` window manager. `openbox` can be found on major Linux distributions.
37
+ * `udisksctl` udisks manager. `udisksctl` can be found on major Linux distributions, often part of a package called something like udisks2.  
38
+ * `lsblk` information utitility. `lsblk` can be found on major Linux distributions.
39
+ * policykit (of your choice) should be running.
40
+ * Optionally, a notification manager like `dunst` or `notify-send`.
41
+
42
+## 4. How to use
43
+
44
+ * Make the script executable and copy/symlink the script to your choice of directory.
45
+ * Edit the configuration file to your liking. Copy the configuration file to `${HOME}/.config/obdevicemenu/config` 
46
+
47
+
48
+ * Dbus and consolekit/policykit need to be running. If you aren't using a login manager, put this in `~/.xinitrc`:
49
+``` 
22 50
 source /etc/X11/xinit/xinitrc.d/30-dbus
23 51
 exec ck-launch-session openbox
24 52
 
25
-If it doesn't already exist, create the file "/etc/polkit-1/localauthority/50-local.d/10-udiskie.pkla" with these contents:
53
+```
54
+ * If it doesn't already exist, create the file `/etc/polkit-1/localauthority/50-local.d/10-udiskie.pkla` with these contents:
55
+
26 56
 ```
27 57
 [Local Users]
28 58
 Identity=unix-group:storage
... ...
@@ -31,6 +61,18 @@ ResultAny=yes
31 61
 ResultInactive=no
32 62
 ResultActive=yes
33 63
 ```
34
-Then put inside the "root-menu" part of ~/.config/openbox/menu.xml something like this:
35 64
 
36
- <menu id="devices" label="Devices" execute="/usr/bin/obdevicemenu" />
65
+ * Place an entry calling obdevicemenu in your openbox menu, like so:
66
+
67
+```
68
+<menu execute="/home/user/bin/obdevicemenu" id="devices" label="devices"/>
69
+```
70
+
71
+and the magic should happen. You will be able to mount and unmount various devices.
72
+
73
+
74
+## 5. Todo
75
+
76
+ * Ejection - not intuitively handled by udisks2
77
+ * Additional drive information - again, not udisks2 equivalent
78
+ * Better support/recognition of internal devices
... ...
@@ -4,11 +4,7 @@
4 4
 # Place in ~/.config/obdevicemenu/config for per-user configuration.
5 5
 # XDG_CONFIG_HOME is respected if it has been set.
6 6
 
7
-# Set Udisks command path.
8
-udisks="/usr/bin/udisks"
9
-
10 7
 # Set filemanager command. The mount point is passed as the first argument.
11
-#filemanager="/usr/bin/uxterm -wf -e /usr/bin/mc"
12 8
 filemanager="/usr/bin/Thunar"
13 9
 #filemanager="/usr/bin/pcmanfm"
14 10
 
... ...
@@ -80,6 +76,7 @@ fancy_sort="0"
80 76
 # Uncomment the examples below, or modify them to pass any arbitrary commands.
81 77
 # post_mount is run immediately after a successful mount operation, and
82 78
 # post_unmount is run immediately after a successful unmount operation.
79
+# Note that these examples date from UDISKS not UDISKS2.
83 80
 
84 81
 # Set "run_post_mount" to "0" to disable or "1" to enable.
85 82
 run_post_mount="1"
... ...
@@ -98,4 +95,5 @@ run_post_unmount="1"
98 95
 #}
99 96
 
100 97
 # Set default mount options for Udisks.
101
-mount_options="--mount-options nosuid,noexec,noatime"
98
+# These don't really work right now.
99
+#mount_options="--mount-options nosuid,noexec,noatime"
... ...
@@ -1,21 +1,23 @@
1 1
 #!/bin/bash
2 2
 
3
-#=============================================================================#
4
-#          FILE: obdevicemenu                                                 #
5
-#       VERSION: 1.6.1                                                        #
6
-#                                                                             #
7
-#   DESCRIPTION: obdevicemenu is an Openbox pipe menu that uses udisks to     #
8
-#                easily mount, unmount or eject removable devices. An         #
9
-#                extensive configuration file allows desktop notifications    #
10
-#                about the success or failure of operations, as well as the   #
11
-#                modification of several other options.                       #
12
-#       LICENSE: GPL3                                                         #
13
-#        AUTHOR: Jamie Nguyen   
14
-#       Udisks2 tweaks: Steven Saus                                              #
15
-#=============================================================================#
3
+########################################################################
4
+#          FILE: obdevicemenu                                                 
5
+#       VERSION: 2                                                            
6
+#                                                                             
7
+#   DESCRIPTION: obdevicemenu is an Openbox pipe menu that uses udisks to     
8
+#                easily mount, unmount or eject removable devices. An         
9
+#                extensive configuration file allows desktop notifications     
10
+#                about the success or failure of operations, as well as the   
11
+#                modification of several other options.                       
12
+#       LICENSE: GPL3                                                         
13
+#        AUTHOR: Jamie Nguyen                                                   
14
+#  UDISKS2 REVS: Steven Saus                                              
15
+########################################################################
16
+
16 17
 
17 18
 # Copyright (C) 2011 Jamie Nguyen
18
-#
19
+# Udisks2 Revision (C) 2019 Steven Saus
20
+
19 21
 # This program is free software; you can redistribute it and/or modify it
20 22
 # under the terms of the GNU General Public License v3 as published by the
21 23
 # Free Software Foundation.
... ...
@@ -30,9 +32,10 @@
30 32
 # 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
31 33
 
32 34
 
33
-#-------------------------------------#
34
-#           CONFIGURATION             #
35
-#-------------------------------------#
35
+########################################################################
36
+#           CONFIGURATION             
37
+########################################################################
38
+
36 39
 # {{{
37 40
 
38 41
 unset GREP_OPTIONS
... ...
@@ -43,9 +46,6 @@ declare notify_options="--expire-time=3000"
43 46
 declare optical_devices="-E ^/dev/sr[0-9]+"
44 47
 declare removable_devices="-E ^/dev/sd[b-z][0-9]*|^/dev/mmcblk[0-9]+p*[0-9]*"
45 48
 
46
-#May have to remove these
47
-declare mount_options="-o nosuid,noexec,noatime"
48
-
49 49
 declare -i show_internal=0
50 50
 declare -i show_notifications=0
51 51
 declare -i show_optical_device_filename=1