Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#74483 - [code] Add code-flags.conf support
Attached to Project:
Community Packages
Opened by Aviana Cruz (AvianaCruz) - Sunday, 17 April 2022, 05:58 GMT
Last edited by Massimiliano Torromeo (mtorromeo) - Friday, 09 September 2022, 22:43 GMT
Opened by Aviana Cruz (AvianaCruz) - Sunday, 17 April 2022, 05:58 GMT
Last edited by Massimiliano Torromeo (mtorromeo) - Friday, 09 September 2022, 22:43 GMT
|
DetailsDescription:
As the startup script not reads code-flags.conf currently, setting flags in code-flags.conf does't have any effects. Replacing the startup script with these lines from https://aur.archlinux.org/cgit/aur.git/tree/visual-studio-code-bin.sh?h=visual-studio-code-bin works. ``` #!/bin/bash XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config} # Allow users to override command-line options if [[ -f $XDG_CONFIG_HOME/code-flags.conf ]]; then CODE_USER_FLAGS="$(sed 's/#.*//' $XDG_CONFIG_HOME/code-flags.conf)" fi # don't edit the electron binary name here! simply change the variable in the PKGBUILD and we will sed it into the correct one :) ELECTRON_RUN_AS_NODE=1 exec electron17 /usr/lib/code/out/cli.js /usr/lib/code/code.js $CODE_USER_FLAGS "$@" ``` Additional info: https://wiki.archlinux.org/title/Visual_Studio_Code#Running_natively_under_Wayland |
This task depends upon
Closed by Massimiliano Torromeo (mtorromeo)
Friday, 09 September 2022, 22:43 GMT
Reason for closing: Implemented
Friday, 09 September 2022, 22:43 GMT
Reason for closing: Implemented
```
#!/bin/bash
set -euo pipefail
shopt -s lastpipe
if [[ -f ${XDG_CONFIG_HOME:=~/.config}/code-flags.conf ]]; then
CODE_USER_FLAGS=()
echo "$(<"$XDG_CONFIG_HOME"/code-flags.conf)" | while IFS='' read -r line; do CODE_USER_FLAGS+=("$line"); done
IFS=' ' read -r -a CODE_USER_FLAGS <<<"${CODE_USER_FLAGS[@]}"
fi
# don't edit the electron binary name here! simply change the variable in the PKGBUILD andwe will sed it into the correct one :)
ELECTRON_RUN_AS_NODE=1 exec electron18 /usr/lib/code/out/cli.js /usr/lib/code/code.js "${CODE_USER_FLAGS[@]}" "$@"
```
There should be nothing that you are prevented from doing by having to put each argument on a new line so, in the end, I don't see good any reason to change it.