Difference between revisions of "Talk:Udisks"

From ArchWiki
Jump to: navigation, search
(restoring here the scripts deleted with https://wiki.archlinux.org/index.php?title=Udiskie&diff=next&oldid=248036)
(Udiskie - Window Manager Menu Scripts: re)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==<s>Out of date</s>==
+
== Udiskie - Window Manager Menu Scripts ==
Ernestas: This article should be edited as ConsoleKit was replaced by logind.
+
:Fixed, close. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 06:57, 14 April 2013 (UTC)
+
 
+
== Window Manager Menu Scripts ==
+
  
 
''[Restoring here the scripts deleted with https://wiki.archlinux.org/index.php?title=Udiskie&diff=next&oldid=248036 without an appropriate discussion. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 07:00, 14 April 2013 (UTC)]''
 
''[Restoring here the scripts deleted with https://wiki.archlinux.org/index.php?title=Udiskie&diff=next&oldid=248036 without an appropriate discussion. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 07:00, 14 April 2013 (UTC)]''
  
 +
''[Moved from [[Talk:Udiskie]] because [[Udiskie]] now redirects to [[Udisks]] and the following scripts might still be relevant. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 11:38, 27 August 2014 (UTC)]''
 +
 +
:Assuming this should be kept, doesn't it belong in the respective [[window manager]] articles? -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 00:45, 17 January 2016 (UTC)
 +
 +
::It's always the same dilemma with cross-software content, I think arguments can be brought to support both sides, and I'd be completely neutral; maybe if restored in the respective WM articles, their sections could be linked from here, or vice versa.
 +
::Regarding the keep or delete problem, I don't like deleting original work, but since I haven't tested the scripts I won't restore them either. I don't mind if they stay here until somebody tests them and moves them back to an article if working, or deletes them if broken.
 +
::— [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 03:33, 18 January 2016 (UTC)
 +
 +
<hr>
 
For convenience, you can add a script to the menu in some window managers to allow for easy access and control of removable media.
 
For convenience, you can add a script to the menu in some window managers to allow for easy access and control of removable media.
  
 
===Openbox===
 
===Openbox===
 +
 
Here's an openbox menu script that offers a slight variation on the WindowMaker example below:
 
Here's an openbox menu script that offers a slight variation on the WindowMaker example below:
  
Line 125: Line 131:
 
echo \"Media\" END
 
echo \"Media\" END
 
</pre>
 
</pre>
 +
 +
== Using udisksctl for manual mounting ==
 +
 +
I found that using udisksctl for manual mounting by a regular user is really easy. Is there a reason it's not on this page?
 +
 +
For example:
 +
 +
# udisksctl mount -b /dev/sdb1
 +
 +
Creates a mount point at /run/media/user/LabelOfDisk, with all the correct permissions for the user to be able to access it. It also has other commands like
 +
inof {{Unsigned| 16:34, 20 April 2015‎|Jryan}}
 +
 +
:Added a hint to the manual where this is described, as well as non-obvious example using inotifywait. [https://wiki.archlinux.org/index.php?title=Udisks&diff=370322&oldid=369663] Opinions? -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 16:44, 20 April 2015 (UTC)
 +
 +
::No further objections, closing. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 00:07, 17 January 2016 (UTC)

Latest revision as of 03:34, 18 January 2016

Udiskie - Window Manager Menu Scripts

[Restoring here the scripts deleted with https://wiki.archlinux.org/index.php?title=Udiskie&diff=next&oldid=248036 without an appropriate discussion. -- Kynikos (talk) 07:00, 14 April 2013 (UTC)]

[Moved from Talk:Udiskie because Udiskie now redirects to Udisks and the following scripts might still be relevant. -- Lahwaacz (talk) 11:38, 27 August 2014 (UTC)]

Assuming this should be kept, doesn't it belong in the respective window manager articles? -- Alad (talk) 00:45, 17 January 2016 (UTC)
It's always the same dilemma with cross-software content, I think arguments can be brought to support both sides, and I'd be completely neutral; maybe if restored in the respective WM articles, their sections could be linked from here, or vice versa.
Regarding the keep or delete problem, I don't like deleting original work, but since I haven't tested the scripts I won't restore them either. I don't mind if they stay here until somebody tests them and moves them back to an article if working, or deletes them if broken.
— Kynikos (talk) 03:33, 18 January 2016 (UTC)

For convenience, you can add a script to the menu in some window managers to allow for easy access and control of removable media.

Openbox

Here's an openbox menu script that offers a slight variation on the WindowMaker example below:

#!/bin/bash

# An openbox menu for removable media (requires udiskie).
#
# This script will generate sub-menus for any device mounted
# under /media. You can browse the device in a file manager or
# unmount it.
#
# It will ignore the "cd", "dvd", and "fl" directories and the U3
# containers found on some windows formatted drives
#
# By default, this script uses the rox file manager to browse the
# media.

DIR=$(cd $(dirname "$0") && pwd)
SCRIPT=$(basename "$0")
NOTIFY="notify-send"
FM_CMD="rox"

pipemenu() {

    cd /media
    echo '<openbox_pipe_menu>'

    for i in *
    do
	if [ "$i" != "*" ] && [[ ! "$i" =~ ^U3|cd|dvd|fl ]]; then
	    echo "<item label=\"Browse $i\">"
	    echo "<action name=\"Execute\">"
	    echo "<execute>$FM_CMD /media/$i</execute>"
	    echo "</action></item>"
	    echo "<item label=\"Unmount $i\">"
	    echo "<action name=\"Execute\">"
	    echo "<execute>$DIR/$SCRIPT unmount /media/$i</execute>"
	    echo "</action></item>"
	    echo "<separator/>"
	fi
    done

    echo "<item label=\"Eject CD/DVD\">"
    echo "<action name=\"Execute\">"
    echo "<execute>eject -T</execute>"
    echo "</action></item>"

    echo "<item label=\"Remount all\">"
    echo "<action name=\"Execute\">"
    echo "<execute>$DIR/$SCRIPT remount</execute>"
    echo "</action></item>"

    echo "</openbox_pipe_menu>"
}

case $1 in 
    unmount)
	udiskie-umount $2
	if mountpoint -q $2; then
	    $NOTIFY "Failed to unmount $2"
	else
	    $NOTIFY "Unmounted $2"
	fi
	;;
    remount)
	killall udiskie
	udiskie &
	$NOTIFY "Mounting removable media..."
	;;
    *)
	pipemenu
	;;
esac

Window Maker

Create a "Generated Submenu" entry in the root menu.

#!/bin/bash

# For a Window Maker menu for removable media.
#
# This script will generate sub-menus for any device mounted
# under /media. You can browse the device in a file manager or
# unmount it.
#
# It will ignore the "cd", "dvd", and "fl" directories.
#
# It uses "emelFM2" file manager to browse the media.

cd /media

echo \"Media\" MENU

for i in *
do
  if ["$i" != "*" ] && [ "$i" != "cd" ] && [ "$i" != "dvd" ] && [ "$i" != "fl" ]
  then
    echo \"Browse $i\" EXEC \"emelfm2 -1 \'/media/$i\'\"
  fi
done

for i in *
do
  if ["$i" != "*" ] && [ "$i" != "cd" ] && [ "$i" != "dvd" ] && [ "$i" != "fl" ]
  then
    echo \"Unmount $i\" EXEC \"udiskie-umount \'/media/$i\'\"
  fi
done

echo \"Eject Disc\" EXEC \"eject --traytoggle\"

echo \"Media\" END

Using udisksctl for manual mounting

I found that using udisksctl for manual mounting by a regular user is really easy. Is there a reason it's not on this page?

For example:

# udisksctl mount -b /dev/sdb1

Creates a mount point at /run/media/user/LabelOfDisk, with all the correct permissions for the user to be able to access it. It also has other commands like inof —This unsigned comment is by Jryan (talk) 16:34, 20 April 2015‎. Please sign your posts with ~~~~!

Added a hint to the manual where this is described, as well as non-obvious example using inotifywait. [1] Opinions? -- Alad (talk) 16:44, 20 April 2015 (UTC)
No further objections, closing. -- Alad (talk) 00:07, 17 January 2016 (UTC)