FS#80137 - [obsidian] Extend to support custom user flags

Attached to Project: Arch Linux
Opened by Evangeline Rome (nikelborm) - Thursday, 02 November 2023, 01:44 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:26 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
Many electron applications on Wayland require additional flags to run in wayland mode and not in xwayland.
For example this is needed to avoid blurriness caused by xwayland when gnome user set fractional scaling in their system.

Since there is no way to contribute to [arch obsidian package repo](https://gitlab.archlinux.org/archlinux/packaging/packages/obsidian/-/blob/main/obsidian.sh?ref_type=heads), somebody please update `obsidian.sh` to this:
```
#!/bin/bash

XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config}

# Allow users to override command-line options
if [[ -f $XDG_CONFIG_HOME/obsidian-flags.conf ]]; then
OBSIDIAN_USER_FLAGS="$(sed 's/#.*//' $XDG_CONFIG_HOME/obsidian-flags.conf | tr '\n' ' ')"
fi

# Launch
exec /bin/electron /usr/lib/obsidian/app.asar "$@" $OBSIDIAN_USER_FLAGS
```

This is done in some packages already (e.g. [extra/code](https://gitlab.archlinux.org/archlinux/packaging/packages/code/-/blob/1.83.1-1/code.sh?ref_type=tags), [aur/youtube-music](https://aur.archlinux.org/cgit/aur.git/tree/youtube-music.sh?h=youtube-music), [aur/code](https://aur.archlinux.org/cgit/aur.git/tree/visual-studio-code-bin.sh?h=visual-studio-code-bin)) and it works fine.

Would be great to have that for obsidian!
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:26 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/obsidian/issues/1
Comment by Toolybird (Toolybird) - Thursday, 02 November 2023, 01:48 GMT
Related  FS#80087 
Comment by Toolybird (Toolybird) - Thursday, 02 November 2023, 19:40 GMT
Shelling out using sed and tr like that just looks plain suboptimal. "code" manages to do it in pure bash which would be better...
Comment by Evangeline Rome (nikelborm) - Friday, 03 November 2023, 01:24 GMT
I took that example (and changed a bit) from here: https://aur.archlinux.org/cgit/aur.git/tree/visual-studio-code-bin.sh?h=visual-studio-code-bin

I don't think those microseconds of speed difference during launch really matter

Loading...