Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux.ts: added new paths to executables #1115

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 107 additions & 22 deletions app/src/lib/editors/linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,39 @@ interface ILinuxExternalEditor {
const editors: ILinuxExternalEditor[] = [
{
name: 'Atom',
paths: ['/snap/bin/atom', '/usr/bin/atom'],
paths: [
'/snap/bin/atom',
'/usr/bin/atom',
'/usr/bin/env atom'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we tested this out? I feel like this is going to error because this string is expected to be a path, and having the additional parameter is not going to work...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've tested this so many times. this is how unix system works, and yea - you can try it yourself, just type env <binaryname> and it will start! (ofc untill this binary is exist into PATH. you can check path with env also, typing it into current terminal.)
and yes - this will fix nixos/nix issue that i've mentioned, i've also tested it localy.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, not tested the approach but instead tested the app can handle this parameter. I fear it might blow up, but I also fear that it might skip over this scenario because this is doing a "path exists" check - defeating the intent of the change...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, i haven't stumble across this issue. we always can create testing branch, merge it into and test it, i will help as i need it.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I can figure out how to test this locally, but it's gonna take some focus time to dig into it. Perhaps later this week, otherwise definitely on the weekend...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i want to help as much as i can bc i wan't to PR into nixpkgs it, but as you wish, my friend. as you say, but if i can help you - just ping me. :)

],
},
{
name: 'Neovim',
paths: ['/usr/bin/nvim'],
paths: [
'/usr/bin/nvim',
'/usr/bin/env nvim'
],
},
{
name: 'Neovim-Qt',
paths: ['/usr/bin/nvim-qt'],
paths: [
'/usr/bin/nvim-qt',
'/usr/bin/env nvim-qt'
],
},
{
name: 'Neovide',
paths: ['/usr/bin/neovide'],
paths: [
'/usr/bin/neovide',
'/usr/bin/env neovide'
],
},
{
name: 'gVim',
paths: ['/usr/bin/gvim'],
paths: [
'/usr/bin/gvim',
'/usr/bin/env gvim'
],
},
{
name: 'Visual Studio Code',
Expand All @@ -45,6 +61,7 @@ const editors: ILinuxExternalEditor[] = [
'/mnt/c/Program Files/Microsoft VS Code/bin/code',
'/var/lib/flatpak/app/com.visualstudio.code/current/active/export/bin/com.visualstudio.code',
'.local/share/flatpak/app/com.visualstudio.code/current/active/export/bin/com.visualstudio.code',
'/usr/bin/env code'
],
},
{
Expand All @@ -54,6 +71,7 @@ const editors: ILinuxExternalEditor[] = [
'/usr/bin/code-insiders',
'/var/lib/flatpak/app/com.visualstudio.code.insiders/current/active/export/bin/com.visualstudio.code.insiders',
'.local/share/flatpak/app/com.visualstudio.code.insiders/current/active/export/bin/com.visualstudio.code.insiders',
'/usr/bin/env code-insiders'
],
},
{
Expand All @@ -64,19 +82,29 @@ const editors: ILinuxExternalEditor[] = [
'/usr/share/vscodium-bin/bin/codium',
'.local/share/flatpak/app/com.vscodium.codium/current/active/export/bin/com.vscodium.codium',
'/snap/bin/codium',
'/usr/bin/env codium'
],
},
{
name: 'VSCodium (Insiders)',
paths: ['/usr/bin/codium-insiders'],
paths: [
'/usr/bin/codium-insiders',
'/usr/bin/env codium-insiders'
],
},
{
name: 'Sublime Text',
paths: ['/usr/bin/subl'],
paths: [
'/usr/bin/subl',
'/usr/bin/env subl'
],
},
{
name: 'Typora',
paths: ['/usr/bin/typora'],
paths: [
'/usr/bin/typora',
'/usr/bin/env typora'
],
},
{
name: 'SlickEdit',
Expand All @@ -85,63 +113,87 @@ const editors: ILinuxExternalEditor[] = [
'/opt/slickedit-pro2017/bin/vs',
'/opt/slickedit-pro2016/bin/vs',
'/opt/slickedit-pro2015/bin/vs',
// maybe? '/usr/bin/env vs' //
],
},
{
// Code editor for elementary OS
// https://github.com/elementary/code
name: 'Code',
paths: ['/usr/bin/io.elementary.code'],
paths: [
'/usr/bin/io.elementary.code',
'/usr/bin/env io.elementary.code'
],
},
{
name: 'Lite XL',
paths: ['/usr/bin/lite-xl'],
paths: [
'/usr/bin/lite-xl',
'/usr/bin/env lite-xl'
],
},
{
name: 'JetBrains PhpStorm',
paths: [
'/snap/bin/phpstorm',
'.local/share/JetBrains/Toolbox/scripts/PhpStorm',
'/usr/bin/env phpstorm'
],
},
{
name: 'JetBrains WebStorm',
paths: [
'/snap/bin/webstorm',
'.local/share/JetBrains/Toolbox/scripts/webstorm',
'/usr/bin/env webstorm'
],
},
{
name: 'IntelliJ IDEA',
paths: ['/snap/bin/idea', '.local/share/JetBrains/Toolbox/scripts/idea'],
paths: [
'/snap/bin/idea',
'.local/share/JetBrains/Toolbox/scripts/idea',
'/usr/bin/env idea'
],
},
{
name: 'IntelliJ IDEA Ultimate Edition',
paths: [
'/snap/bin/intellij-idea-ultimate',
'.local/share/JetBrains/Toolbox/scripts/intellij-idea-ultimate',
'/usr/bin/env intelliji-idea-ultimate'
],
},
{
name: 'IntelliJ Goland',
paths: [
'/snap/bin/goland',
'.local/share/JetBrains/Toolbox/scripts/goland',
'/usr/bin/env goland'
],
},
{
name: 'JetBrains CLion',
paths: ['/snap/bin/clion', '.local/share/JetBrains/Toolbox/scripts/clion1'],
paths: [
'/snap/bin/clion',
'.local/share/JetBrains/Toolbox/scripts/clion1',
'/usr/bin/env clion'
],
},
{
name: 'JetBrains Rider',
paths: ['/snap/bin/rider', '.local/share/JetBrains/Toolbox/scripts/rider'],
paths: [
'/snap/bin/rider',
'.local/share/JetBrains/Toolbox/scripts/rider',
'/usr/bin/env rider'
],
},
{
name: 'JetBrains RubyMine',
paths: [
'/snap/bin/rubymine',
'.local/share/JetBrains/Toolbox/scripts/rubymine',
'/usr/bin/env rubymine'
],
},
{
Expand All @@ -150,57 +202,89 @@ const editors: ILinuxExternalEditor[] = [
'/snap/bin/pycharm',
'/snap/bin/pycharm-professional',
'.local/share/JetBrains/Toolbox/scripts/pycharm',
'/usr/bin/env pycharm'
],
},
{
name: 'JetBrains JetBrains RustRover',
paths: [
'/snap/bin/rustrover',
'.local/share/JetBrains/Toolbox/scripts/rustrover',
'/usr/bin/env rustrover'
],
},
{
name: 'Android Studio',
paths: [
'/snap/bin/studio',
'.local/share/JetBrains/Toolbox/scripts/studio',
'/usr/bin/env studio'
],
},
{
name: 'Emacs',
paths: ['/snap/bin/emacs', '/usr/local/bin/emacs', '/usr/bin/emacs'],
paths: [
'/snap/bin/emacs',
'/usr/local/bin/emacs',
'/usr/bin/emacs',
'/usr/bin/env emacs'
],
},
{
name: 'Kate',
paths: ['/usr/bin/kate'],
paths: [
'/usr/bin/kate',
'/usr/bin/env kate'
],
},
{
name: 'GEdit',
paths: ['/usr/bin/gedit'],
paths: [
'/usr/bin/gedit',
'/usr/bin/env gedit'
],
},
{
name: 'GNOME Text Editor',
paths: ['/usr/bin/gnome-text-editor'],
paths: [
'/usr/bin/gnome-text-editor',
'/usr/bin/env gnome-text-editor'
],
},
{
name: 'GNOME Builder',
paths: ['/usr/bin/gnome-builder'],
paths: [
'/usr/bin/gnome-builder',
'/usr/bin/env gnome-builder'
],
},
{
name: 'Notepadqq',
paths: ['/usr/bin/notepadqq'],
paths: [
'/usr/bin/notepadqq',
'/usr/bin/env notepadqq'
],
},
{
name: 'Mousepad',
paths: ['/usr/bin/mousepad'],
paths: [
'/usr/bin/mousepad',
'/usr/bin/env mousepad'
],
},
{
name: 'Pulsar',
paths: ['/usr/bin/pulsar'],
paths: [
'/usr/bin/pulsar',
'/usr/bin/env pulsar'
],
},
{
name: 'Pluma',
paths: ['/usr/bin/pluma'],
paths: [
'/usr/bin/pluma',
'/usr/bin/env pluma'
],
},
{
name: 'Zed',
Expand All @@ -210,6 +294,7 @@ const editors: ILinuxExternalEditor[] = [
'/usr/bin/zed-editor',
'~/.local/bin/zed',
'/usr/bin/zed',
'/usr/bin/env zed'
],
},
]
Expand Down