Get file properties via dbus command

Ahmad Ismail ismail783 at gmail.com
Sat Jun 24 04:37:51 UTC 2023


Thank you very much. This command works. I have been working on a rofi
script like

....
#!/bin/bash

select=$( ls | rofi -dmenu -format q -kb-custom-1 "Alt+Return" )
status=$?

if [ $status -eq 0 ]; then
    echo you have selected $select
elif [ $status -eq 10 ]; then
    menu=$(echo -e "Bookmark\nCopy\nCut\nDelete\nOpen\nOpen
Folder\nProperties\Rename" | rofi -dmenu)
    echo $menu $select
else
    echo "do nothing"
fi
....

I am planning to get the file properties with this command. Can I use path
like "/home/ismail/Desktop/file.txt" with your command?

*Thanks and Best Regards,Ahmad Ismail*


On Fri, Jun 23, 2023 at 3:53 PM Thomas Kluyver <thomas at kluyver.me.uk> wrote:

> On Fri, 23 Jun 2023, at 10:14, Ahmad Ismail wrote:
>
> Suppose I have file like /home/ismail/Desktop/file.txt or, file:///
> home/ismail/Desktop/file.txt
>
> I want to see it's properties using cli.
>
> What command shall I use?
>
> Something like this will work:
>
> dbus-send --session --print-reply --dest=org.freedesktop.FileManager1
> /org/freedesktop/FileManager1
> org.freedesktop.FileManager1.ShowItemProperties
> array:string:"file:///home/ismail/Desktop/file.txt" string:""
>
> But like Lawrence said, it may not do what you want. This asks your file
> manager to show its 'file properties' window; it doesn't give the
> information back in the terminal. If you want to show or use the
> information inside the terminal, you probably don't want to use D-Bus.
>
> Thomas
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dbus/attachments/20230624/01d91c86/attachment.htm>


More information about the dbus mailing list