• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Tsukasa no Hibi

Cloudy Sky. Occasional Rain.

You are here: Home / Blog / Nice global environment variable additions

Nice global environment variable additions

2008-07-26 by tsukasa Leave a Comment

Since my vacation is coming to an end I thought I’d leave a nice little trick on how to administrate a number of environment variable additions for all users on the system.

Sure, there is the /etc/environment file but it seems rather limiting to me. I needed a little more control, so I came up with the following the little scripting:

Create a new folder /etc/environment.imports, in the folder just have a ordered/leveled number of scripts (i.e. 01_qt, 02_java). Add the following code to your /etc/profile:

# Custom PATH and LD_LIBRARY additions
xdg_source_list=`echo /etc/environment.imports/*`
for source_file in $xdg_source_list
do
 Â Ã‚ Ã‚ Ã‚ Ã‚ Ã‚  source $source_file
done

Now you can just export all the necessary additions through the files in /etc/environment.imports:

#!/bin/sh
export LD_LIBRARY_PATH=/opt/wine/lib:$LD_LIBRARY_PATH
export PATH=/opt/wine/bin:$PATH
export PKG_CONFIG_PATH=/opt/wine/lib/pkgconfig:$PKG_CONFIG_PATH

export XDG_DATA_DIRS=/opt/wine/share:$XDG_DATA_DIRS

This way it’s extremely easy to maintain a large number of custom-prefixed software for a complete system without touching the user’s custom profile.

Filed Under: Blog Tagged With: Linux, Tips

Reader Interactions

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Tags

.net AutoHotkey Bitcasa Blog C# Docker Fonts Fun Google Chrome Hardware How To Life Linux Mono Mplayer Music My NAS nVidia OBS OpenEdge OpenSSH Palaver Pangya! Portable App PowerShell Programming Quote RaiDrive Reminder Scripting Software Streaming Technology Tips twitter Video Virtualization VMware Web Windows Wine WordPress Wuala YouTube ZNC

Cool stuff

  • AdiIRC
  • Affinity Designer
  • Affinity Photo
  • AquaSnap
  • Arch Linux
  • Archive Team
  • ConEmu
  • Debian
  • Directory Opus
  • Far Manager
  • FileLocator Pro
  • Fluent Search
  • foobar2000
  • Forte Agent
  • IRCCloud
  • ISBoxer
  • Jetbrains Rider
  • Newsblur
  • OBS Studio
  • Obsidian.md
  • RaiDrive
  • Sublime
  • SyncBackPro
  • The Semware Editor
  • True Launch Bar
  • Vivaldi
  • Wavebox
  • WinHex
  • WinRAR
  • WinSCP
  • XYplorer
  • ZNC
  • Zoom Player Max

Semantic Web

  • Mastodon
  • Tsukasa no Hibi
  • Tsukasa no Hibi Sitemap

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Footer

About

Going since 2004, Tsukasa no Hibi is my personal blog about technology, media and sometimes society.

More about Tsukasa no Hibi

WordPress · Log in