Giter VIP home page Giter VIP logo

Comments (11)

coldfix avatar coldfix commented on June 12, 2024

If you find or design such an icon (with free license!), it is no problem. I just chose the CDROM icon, because it was available as a stock item in the default GTK icons.

About the second part of the question: At first glance, I don't see any means to identify the device type from the information provided by UDisks. So, I'll give you a careful no for now (possibly I overlooked something, in this case, please tell me!).

from udiskie.

alejandro-perez avatar alejandro-perez commented on June 12, 2024

I have several of them from different themes. I personally like the first one:
From the elementary theme:
elementary drive-removable-media-usb
elementary gnome-dev-harddisk-usb

From the gnome theme:
gnome drive-harddisk

From the oxygen theme:
oxygen drive-removable-media-usb
oxygen drive-removable-media-usb-pendrive

The main problem with them would be themes. You could use "drive-removable-media-usb" if the theme provides it. If not, try then with "drive-removable-media". Else, try "drive-removable-media-symbolic". Else, fallback to whatever.

About the second part, thunar, nautilus, etc. all of them do something similar. Of course they might use "ugly" heuristics such as look at the device filename and comparte it with /dev/sr*, but I don't think so. I have inserted both, a pendrive and a CDROM in my system, and I think I might have found something, at least with udisks2. This is the output of udisksctl dump:

PENDRIVE:
/org/freedesktop/UDisks2/drives/General_USB_Flash_Disk_053077000000000A:
org.freedesktop.UDisks2.Drive:
CanPowerOff: true
Configuration: {}
ConnectionBus: usb
Ejectable: true
Id: General-USB-Flash-Disk-053077000000000A
Media:
MediaAvailable: true
MediaChangeDetected: true
MediaCompatibility:
MediaRemovable: true
Model: USB Flash Disk
Optical: false
OpticalBlank: false
OpticalNumAudioTracks: 0
OpticalNumDataTracks: 0
OpticalNumSessions: 0
OpticalNumTracks: 0
Removable: true
Revision: 1.00
RotationRate: -1
Seat: seat0
Serial: 053077000000000A
SiblingId: /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0
Size: 8022654976
SortKey: 01hotplug/1401776858983479
TimeDetected: 1401776858983479
TimeMediaDetected: 1401776858983479
Vendor: General
WWN:

CDROM
/org/freedesktop/UDisks2/drives/MATSHITADVD_RAM_UJ8D3_WQ39_153215:
org.freedesktop.UDisks2.Drive:
CanPowerOff: false
Configuration: {}
ConnectionBus:
Ejectable: true
Id: MATSHITADVD-RAM-UJ8D3-WQ39_153215
Media: optical_cd
MediaAvailable: true
MediaChangeDetected: true
MediaCompatibility: optical_cd
optical_cd_r
optical_cd_rw
optical_dvd
optical_dvd_plus_r
optical_dvd_plus_r_dl
optical_dvd_plus_rw
optical_dvd_r
optical_dvd_ram
optical_dvd_rw
optical_mrw
optical_mrw_w
MediaRemovable: true
Model: MATSHITADVD-RAM UJ8D3
Optical: true
OpticalBlank: false
OpticalNumAudioTracks: 33
OpticalNumDataTracks: 0
OpticalNumSessions: 1
OpticalNumTracks: 33
Removable: true

It says Media: optical_cd. Not sure if that's enough.
Even better. Drives have an attribute called "Optical". It is true for the CDROM, and false for the USB.

Anyway, this issue was more like a whishlist. Your program, your rules :). I can change the icon for my system with a 1 line patch. It's not so much work :). Actually, I have been doing ever since I've been using it.

Regards

from udiskie.

coldfix avatar coldfix commented on June 12, 2024

I'd rather not rely on a third party theme being installed. Furthermore, this is complicated to check anyway, since GTK provides fallback NO-ICON icons instead of raising exceptions or returning None. I know, the code base grew a lot larger, since I adopted the package, but I still want to handle things in a somewhat lightweight way.

I'd say yes to include an icon named udiskie-tray.svg or similar (this is simple and good). In this case, you wouldn't even need the one-line patch, but just replace the icon file or chose a different theme with customized icons. In this case, can you check, whether it is possible to include any of your preferred icons with this repository (license).

I'll have to check on the Optical property. Will take me a while, since I'm busy on something else, ATM, sorry.

from udiskie.

alejandro-perez avatar alejandro-perez commented on June 12, 2024

I'd rather not rely on a third party theme being installed.
Furthermore, this is complicated to check anyway, since GTK provides
fallback NO-ICON icons instead of raising exceptions or returning
None. I know, the code base grew a lot larger, since I adopted the
package, but I still want to handle things in a somewhat lightweight way.

Makes total sense to me. I'm also a lover of simple things. Otherwise I
would use KDE or GNOME and not XFCE and udiskie. But, I'm also a lover
of the Do It Yourself approach. So I like to have SW that does what I
want. I usually patch it myself (I have several packages in AUR), but if
I think that might be something interesting, I share that idea with the
package owner. Of course you can reject it, it's your project :D!

I'd say yes to include an icon named |udiskie-tray.svg| or similar
(this is simple and good). In this case, you wouldn't even need the
one-line patch, but just replace the icon file or chose a different
theme with customized icons.

Even a symbolic link... great! You could even (again, this is a
brainstorming, don't even listen to me :D), add a configuration option
(icon path). This would allow changing it without root permission.

In this case, can you check, whether it is possible to include any of
your preferred icons with this repository (license).

https://github.com/shimmerproject/elementary-xfce
It is GPL2, which I guess is more than OK.

I'll have to check on the |Optical| property. Will take me a while,
since I'm busy on something else, ATM, sorry.

Oh, don't worry. I will patch it for the moment.
Thanks. Udiskie rules!

from udiskie.

coldfix avatar coldfix commented on June 12, 2024

Even a symbolic link... great! You could even (again, this is a brainstorming, don't even listen to me :D), add a configuration option (icon path). This would allow changing it without root permission.

I believe you can do this without root permission, by placing a file in ~/.local/share/icons/hicolor/scalable/actions/udiskie-tray.svg for example. (Maybe this is not working, after all, I thought, at some point it worked for me, but possibly, I just didnt remove the icons from the cache elsewhere.)

It is GPL2, which I guess is more than OK.

Actually, I don't know, whether this is okay. If I understand GPL correctly, it requires me to relicense udiskie as GPL2 as well if just including one icon, which in turn, might create a hazzle for other people.

b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.

I am no expert in those matters, however. Maybe, my understanding is incorrect. I will hesitate using these icons for now, since I don't want to rely on the theme being installed separately, and I don't want to go into licensing issues. Thanks for the suggestion anyway! If you know some evidence, that it is actually no problem to include GPL2 data within a MIT-licensed project, please let me know. Otherwise, I will probably just wait for a less restrictively licensed icon to come along ;)

Best regards,

Thomas

from udiskie.

alejandro-perez avatar alejandro-perez commented on June 12, 2024

Hi!

makes total sense. Licenses are an unknown world to me, so I was just guessing.

Best regards,
Alejandro

from udiskie.

coldfix avatar coldfix commented on June 12, 2024

Hey, turns out, there is indeed a neat way to let GTK choose from a selection of icon names. Furthermore, you can now customize the desired icon names in your config file. See #46. (But putting file names there is still not supported).
I will not include any icons from other themes for now.
I have not implemented the Optical/USB recognition feature, so this issue stays open.

Best regards,
Thomas

from udiskie.

alejandro-perez avatar alejandro-perez commented on June 12, 2024

That's great! Thanks!
I will test soon and provide you with some feedback.

Regards

from udiskie.

alejandro-perez avatar alejandro-perez commented on June 12, 2024

It seems to work perfectly fine, thanks!

from udiskie.

coldfix avatar coldfix commented on June 12, 2024

Hey, I don't think, I will go for the automatic icon change according to type of inserted media, sorry (this is somewhat ambiguous anyway), so closing this for now.

from udiskie.

alejandro-perez avatar alejandro-perez commented on June 12, 2024

Oh,that's completely ok. I love its current state. thanks!

from udiskie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.