LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-13-2017, 02:29 PM   #1
josefin
LQ Newbie
 
Registered: Jul 2007
Distribution: Slackware
Posts: 20

Rep: Reputation: 2
Question Use eject key on macbook


I have just installed Slackware 14.2 on my macbook (core 2 duo from 2009), and pretty much everything works. The only issue I have found is that the eject button does not work in kde (version 4.14.3).

I have added the eject button as a shortcut to
Code:
/usr/bin/eject
using the Custom Shortcuts tab in the KDE settings. However, it only works if I press the eject button right after a CD is inserted. Once KDE has detected the CD, the shortcut no longer works, and I can only eject with Dolphin's GUI, or by running eject as root.

My user is a member of the groups
Code:
 users disk floppy audio video cdrom plugdev,
so I definitely have the permission to access the CD drive.

If I try to run eject manually from the terminal without root privileges, I encounter the following error:
Code:
umount /run/media/josefin/SlackDVD: umount failed: Operation not permitted
eject: unmount of `/run/media/josefin/SlackDVD' failed
Does anyone know how to get the shortcut working?
 
Old 05-13-2017, 03:46 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 8,887

Rep: Reputation: Disabled
Maybe add the user josefin to the polkitd group.

PS Not sure this works, anyway the solution prpised by Gazl in post #3 is probably better.

Last edited by Didier Spaier; 05-16-2017 at 05:08 AM. Reason: EDIT added
 
Old 05-14-2017, 07:17 AM   #3
GazL
LQ Guru
 
Registered: May 2008
Posts: 5,036
Blog Entries: 16

Rep: Reputation: 2667Reputation: 2667Reputation: 2667Reputation: 2667Reputation: 2667Reputation: 2667Reputation: 2667Reputation: 2667Reputation: 2667Reputation: 2667Reputation: 2667
There's a udev rule (in 60-cdrom_id.rules) that locks the drive when a cd/dvd is detected and this will stop /usr/bin/eject from doing its thing. You could try using "udisks --eject" instead of eject. (An alternative would be to disable the udev rule that locks the disk (I used to do that) but that's more invasive and using udisks will be more reliable if you're a xfce/kde desktop user.
 
1 members found this post helpful.
Old 05-18-2017, 06:58 PM   #4
josefin
LQ Newbie
 
Registered: Jul 2007
Distribution: Slackware
Posts: 20

Original Poster
Rep: Reputation: 2
Talking

Thanks for both of your suggestions.

I found that the easiest solution was to edit the file
/usr/share/polkit-1/actions/org.freedesktop.udisks.policy

and edit the stanza

Code:
  
  <action id="org.freedesktop.udisks.filesystem-unmount-others">
    <description>Unmount a device mounted by another user</description>
    <description xml:lang="da">Afmontér en enhed monteret af en anden bruger</description>
    <message>Authentication is required to unmount devices mounted by another user</message>
    <message xml:lang="da">Autorisering er påkrævet for at afmontere enheder monteret af en anden bruger</message>
    <defaults>
      <allow_any>no</allow_any>
      <allow_inactive>no</allow_inactive>
      <allow_active>auth_admin</allow_active>
    </defaults>
  </action>
to
Code:
  
  <action id="org.freedesktop.udisks.filesystem-unmount-others">
    <description>Unmount a device mounted by another user</description>
    <description xml:lang="da">Afmontér en enhed monteret af en anden bruger</description>
    <message>Authentication is required to unmount devices mounted by another user</message>
    <message xml:lang="da">Autorisering er påkrævet for at afmontere enheder monteret af en anden bruger</message>
    <defaults>
      <allow_any>no</allow_any>
      <allow_inactive>no</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>
I was then successfully able to bind the eject key to
udisks --unmount /dev/sr0 && udisks --eject /dev/sr0
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
G4 MacBook debian 8.4 Jessie screen dim at beginning. function key on babbab Debian 4 05-12-2016 08:44 PM
Alt key doesn't work on Macbook 5.2. lensilvan Slackware 3 08-28-2015 12:43 PM
when i use right click and then choose eject button eject: unable to open `/dev/hda' sanatkrtiwari86 Linux - Newbie 3 12-02-2008 05:10 AM
Eject CD/DVD Media using Eject Button - Hal/Udev help v00d00101 Linux - Hardware 4 03-17-2008 03:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration