xpra icon
Bug tracker and wiki

Opened 13 days ago

Last modified 29 hours ago

#1956 assigned enhancement

lookup application categories for content-type hint

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: 2.5
Component: server Version: 2.3.x
Keywords: Cc:

Description

Follow up for #1950: some applications will set WM_COMMAND, for others we have to parse /proc/$PID/cmdline, then we can lookup the desktop file whose Exec attribute matches the command.
The desktop file contains a list of Categories which we can use to guess the content-type.

ie: this doesn't work well for google-chrome on Fedora:

$ xprop  | grep PID
_NET_WM_PID(CARDINAL) = 3656
$ cat /proc/3656/cmdline 
/opt/google/chrome-unstable/chrome
$ grep -r Exec= /usr/share/applications/google-chrome-unstable.desktop 
Exec=/usr/bin/google-chrome-unstable %U
Exec=/usr/bin/google-chrome-unstable
Exec=/usr/bin/google-chrome-unstable --incognito

/usr/bin/google-chrome-unstable is a script that runs the actual /opt/google/chrome-unstable/chrome.
So this would need fuzzy matching, or just continue with the existing heuristics from #1950.

For reference, the list of categories is pretty long, and some applications have two or more...

$ grep Categories /usr/share/applications/*desktop |awk -F Categories= '{print $2}' | xargs -n 1 -d ";" | grep -v "^X-" | sort -u

2DGraphics
3DGraphics
Accessibility
Application
Applications
Archiving
Audio
AudioVideo
AudioVideoEditing
Calculator
Calendar
Clock
Compression
ConsoleOnly
ContactManagement
Core
Debugger
DesktopSettings
Development
DiscBurning
Documentation
Education
Electronics
Email
Emulator
Engineering
FileManager
Filesystem
FileTools
FileTransfer
Game
GNOME
Graphics
GTK
HardwareSettings
IDE
InstantMessaging
Java
KDE
LogicGame
Math
Mixer
Monitor
Network
Office
P2P
PackageManager
ParallelComputing
Player
Printing
Profiling
Qt
RasterGraphics
Recorder
RemoteAccess
Scanning
Science
Security
Settings
Spreadsheet
System
TerminalEmulator
TextEditor
TrayIcon
Utility
Video
Viewer
WebBrowser
WordProcessor

Change History (1)

comment:1 Changed 29 hours ago by Antoine Martin

Milestone: 2.42.5
Status: newassigned
Note: See TracTickets for help on using tickets.