You are not logged in.
How can I change the "BROWSER" environment variable with a shell script; so I can change it on the fly?
Last edited by oldtimeyjunk (2012-10-31 12:57:42)
"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed." - Unix for Dummies, 2nd Edition
Offline
export BROWSER=your_browser
Offline
rk700, that will not work as it will only "export" the variable into the shell that is running the script. When the script ends, so to does the lifetime of that variable setting.
I have wondered a bit about this myself, unfortunately I haven't had any luck yet.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
If you just want to do it for BROWSER so that you can change your default web browser on the fly, you could set BROWSER to e.g. ~/bin/mybrowser and create a symlink to the browser you want at ~/bin/mybrowser. Then you could change the symlink at will.
EDIT: man xdg-settings
Last edited by cfr (2012-10-31 02:20:16)
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
hmm, how about xdg-settings
Offline
export BROWSER=your_browser
I have tried that, but as Trilby said, it doesn't work as it should.
The idea suggested by cfr could do the trick. I will also look at XDG Settings.
Thanks!
"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed." - Unix for Dummies, 2nd Edition
Offline
I do this for setting http_proxy etc, basically I set the values in a file and then have that file sourced in my .zshrc.local
Its kind of a hack though as currently running terminals/apps don't get the changed values.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline