Giter VIP home page Giter VIP logo

env-switcher-gui's People

Contributors

smarie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

env-switcher-gui's Issues

FR: Systray icon

This might be quite a special and niche request:

Provide a systray icon.
Offer env switching via context menu.
Indicate current env via symbol.

I do have the very problem you describe as an example:
Having to toggle proxy env setting depending on whether I'm using a VPN or not.

Working like that, one pain is what you describe: having to edit env variables.
I just prefix the keys so they don't get recognized, whenever I do not want to use certain envvars.
That makes that one way easier.

But the bigger pain for me is keeping in mind the current state.
I hope a visible indicator would catch my eyes enough that I would remember about the current settings, before the commands that need different settings fail.

So the idea would be that users can assign a certain appereance (icon? rather just color?) to certain environments and env-switcher-gui would use them whenever the environment matches the current settings.
Handling different simultaneously applying envs is not something I would consider in a first revision.
Even just keeping track of what was set through env-switcher-gui might be "good enough" for a first implementation.

The indicator should always be visible, be reasonably easy and lightweight to implement and nor disturb, nor interfere with OS features, so the systray seems a good place for me.

Thanks for reading and maybe even considering :)

Bug with the GUI on Linux

@smarie: Here is the small experiment you expected about your GUI tool on my Linux

benoit@mirabelle:~/Téléchargements/envswitch-1.3.0-linux-x86_64-3.5$ ls
envswitch      imageformats  libpython3.5m.so.1.0  libQt5Widgets.so.5  LICENSE       platforms  VERSION__
envswitch_gui  lib           libQt5Core.so.5       libyaml-0.so.2      LICENSE-PyQt  README.md
envswitch.ico  libffi.so.6   libQt5Gui.so.5        libz.so.1           LICENSE-Qt    resources
benoit@mirabelle:~/Téléchargements/envswitch-1.3.0-linux-x86_64-3.5$ ./envswitch_gui &
[1] 6220
benoit@mirabelle:~/Téléchargements/envswitch-1.3.0-linux-x86_64-3.5$ *** ENVSWITCH <1.3.0> ***
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Available platform plugins are: linuxfb, minimal, offscreen, xcb.

Reinstalling the application may fix this problem.

[1]+  Abandon                 (core dumped) ./envswitch_gui
benoit@mirabelle:~/Téléchargements/envswitch-1.3.0-linux-x86_64-3.5$ ./envswitch --help
Usage: envswitch [OPTIONS] COMMAND [ARGS]...

  Envswitch commandline. Use 'envswitch COMMAND --help' to get help on any
  specific command below.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  apply
  list
  open
benoit@mirabelle:~/Téléchargements/envswitch-1.3.0-linux-x86_64-3.5$ rm libQt5*.so*
rm : supprimer fichier 'libQt5Core.so.5' ? y
rm : supprimer fichier 'libQt5Gui.so.5' ? y
rm : supprimer fichier 'libQt5Widgets.so.5' ? y
benoit@mirabelle:~/Téléchargements/envswitch-1.3.0-linux-x86_64-3.5$ ./envswitch_gui 
Traceback (most recent call last):
  File "/home/travis/miniconda/lib/python3.5/site-packages/cx_Freeze/initscripts/__startup__.py", line 14, in run
  File "/home/travis/miniconda/lib/python3.5/site-packages/cx_Freeze/initscripts/Console.py", line 26, in run
  File "envswitch/gui.py", line 19, in <module>
ImportError: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.6' not found (required by /home/benoit/Téléchargements/envswitch-1.3.0-linux-x86_64-3.5/lib/python3.5/PyQt5/QtCore.so)
benoit@mirabelle:~/Téléchargements/envswitch-1.3.0-linux-x86_64-3.5$ ls
envswitch      envswitch.ico  lib          libpython3.5m.so.1.0  libz.so.1  LICENSE-PyQt  platforms  resources
envswitch_gui  imageformats   libffi.so.6  libyaml-0.so.2        LICENSE    LICENSE-Qt    README.md  VERSION__

The command line interface seems to work fine but the GUI tool does not work with your Qt shared library. It does not work also with the Qt of my system (from the official Ubuntu repository) because of a version problem.

problem when a variable is present in both the user and the system environment variables

If the variables of the proxy exist as local environment variables and as system environment variabes, then activating the mode "no_proxy" doesn't have any effect, since only the local ones will be deleted, but the system ones persist and the proxy remains active. Maybe some automatic check whether this situation is the case should be done to provide a message to the user if this is the case.

Implement the 'apply environment' in linux

In file envswitch/env_api_linuximpl.py the functions should perform the same thing than in envswitch/env_api_winimpl.py, that is, get/set environment variables directly on the OS, outside of the current process. Note: this cannot be done with a process fork, it really requires OS-specific knowledge about how the environment variables work.

Various possibilities exist (https://unix.stackexchange.com/questions/117467/how-to-permanently-set-environmental-variables), what should we implement as a good 'default' behaviour ? (testing and switch/case is allowed if no single behaviour is acceptable)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.