Im trying to change the theme of zsh but I can't figure out what the problem is. This item didn't help me, because as you can see in my .zshrc file below my zsh source is after the zsh theme attribute.
When I use echo $SHELL I receive: /usr/bin/zsh
This is the theme that is being loaded although the theme set is robbyrussel:
This is the ~/.zshrc file content:
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/daniel/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
you need to delete the .oh-my-zsh using rm -rf .oh-my-zsh and reinstall
Related
Recently I tried to use Linux on win10. I installed HyperTM, ZSH, Oh-My-ZSH, and the theme used the 'powerlevel9k'. After opening ZSH with HyperTM, my right label goes from one line to the next, as shown below.
oh-my-zsh with powerlevel9k on HyperTM
but my bash(window subsystem) is normal
bash.exe for Ubuntu on win10
I tried to change the setting of '.zshrc' and searching for HyperTM setting may solve this error, but did not find about, does anyone would solve this problem? :(
I'm not sure if this question is about powerlevel9k or ZSH or HyperTM.
following is my setting of .zshrc and HyperTM.
[.zshrc]
source ~/.zplug/init.zsh
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/weichieh/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# ZSH_THEME="powerlevel9k/powerlevel9k"
ZSH_THEME="powerlevel9k/powerlevel9k"
# powerlevel9k 設定
# POWERLEVEL9K_MODE='awesome_patched'
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
POWERLEVEL9K_DISABLE_RPROMPT=false
ZLE_RPROMPT_INDENT=0
#command line 左邊想顯示的內容
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir dir_writable vcs vi_mode newline)
#command line 右邊想顯示的內容
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs history load time)
# Set list of themes to load
# Setting this variable when ZSH_THEME=random
# cause zsh load theme from this variable instead of
# looking in ~/.oh-my-zsh/themes/
# An empty array have no effect
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
HIST_STAMPS="yyyy-mm-dd"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
zsh-syntax-highlighting
zsh-docker-aliases
zsh-completions
)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
autoload -U compinit && compinit
zplug load
[.hyper.js]
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
// default font size in pixels for all tabs
fontSize: 15,
// font family with optional fallbacks
fontFamily: '"Monaco","DejaVu Sans Mono", Awesome, "Source Code Pro","Fira Code", Menlo, Consolas, "Lucida Console", monospace',
// default font weight: 'normal' or 'bold'
fontWeight: 'normal',
// font weight for bold characters: 'normal' or 'bold'
fontWeightBold: 'bold',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
// terminal text color under BLOCK cursor
cursorAccentColor: '#000',
// `'BEAM'` for |, `'UNDERLINE'` for _, `'BLOCK'` for █
cursorShape: 'BLOCK',
// set to `true` (without backticks and without quotes) for blinking cursor
cursorBlink: false,
// color of the text
foregroundColor: '#fff',
// terminal background color
// opacity is only supported on macOS
backgroundColor: '#000',
// terminal selection color
selectionColor: 'rgba(248,28,229,0.3)',
// border color (window, tabs)
borderColor: '#333',
// custom CSS to embed in the main window
css: '',
// custom CSS to embed in the terminal window
termCSS: '',
// if you're using a Linux setup which show native menus, set to false
// default: `true` on Linux, `true` on Windows, ignored on macOS
showHamburgerMenu: '',
// set to `false` (without backticks and without quotes) if you want to hide the minimize, maximize and close buttons
// additionally, set to `'left'` if you want them on the left, like in Ubuntu
// default: `true` (without backticks and without quotes) on Windows and Linux, ignored on macOS
showWindowControls: '',
// custom padding (CSS format, i.e.: `top right bottom left`)
padding: '12px 14px',
// the full list. if you're going to provide the full color palette,
// including the 6 x 6 color cubes and the grayscale map, just provide
// an array here instead of a color map object
colors: {
black: '#000000',
red: '#C51E14',
green: '#1DC121',
yellow: '#C7C329',
blue: '#0A2FC4',
magenta: '#C839C5',
cyan: '#20C5C6',
white: '#C7C7C7',
lightBlack: '#686868',
lightRed: '#FD6F6B',
lightGreen: '#67F86F',
lightYellow: '#FFFA72',
lightBlue: '#6A76FB',
lightMagenta: '#FD7CFC',
lightCyan: '#68FDFE',
lightWhite: '#FFFFFF',
},
// the shell to run when spawning a new session (i.e. /usr/local/bin/fish)
// if left empty, your system's login shell will be used by default
//
// Windows
// - Make sure to use a full path if the binary name doesn't work
// - Remove `--login` in shellArgs
//
// Bash on Windows
// - Example: `C:\\Windows\\System32\\bash.exe`
//
// PowerShell on Windows
// - Example: `C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`
shell: 'C:\\Windows\\System32\\wsl.exe',
// for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`)
// by default `['--login', '-i', '/c wsl']` will be used
shellArgs: [],
// for environment variables
env: {},
// set to `false` for no bell
bell: 'SOUND',
// if `true` (without backticks and without quotes), selected text will automatically be copied to the clipboard
copyOnSelect: false,
// if `true` (without backticks and without quotes), hyper will be set as the default protocol client for SSH
defaultSSHApp: true,
// if `true` (without backticks and without quotes), on right click selected text will be copied or pasted if no
// selection is present (`true` by default on Windows and disables the context menu feature)
// quickEdit: true,
// URL to custom bell
// bellSoundURL: 'http://example.com/bell.mp3',
// for advanced config flags please refer to https://hyper.is/#cfg
},
// a list of plugins to fetch and install from npm
// format: [#org/]project[#version]
// examples:
// `hyperpower`
// `#company/project`
// `project#1.0.1`
plugins: [
'hyperfull'
],
// in development, you can create a directory under
// `~/.hyper_plugins/local/` and include it here
// to load it and avoid it being `npm install`ed
localPlugins: [],
keymaps: {
// Example
// 'window:devtools': 'cmd+alt+o',
},
};
Try to comment out the ZLE_RPROMPT_INDENT. This is usually the cause for such problems. The right gap will be fixed with the next release of Powerlevel9k anyway :)
Like many people I created a dotfiles repo and am trying extract bits that are not private into their respective dotfiles. I generally have a .whatever.local file loaded if it's present which might contain information I don't want checked into a repository. Rubygems use ~/.gemrc file, but I can't see a way to extract private information out of it into separate file. Does anyone know how this might be done?
In particular I'd like to have the list of sources external to the .gemrc file.
I do not see an equivalent to .local as per v2.4.6 (a recent, but not last version).
The source code of RubyGems states something relevant for what you want to achieve, though. For example, in src/ruby-2.3.0/lib/rubygems/config_file.rb:
##
# Gem::ConfigFile RubyGems options and gem command options from gemrc.
#
# gemrc is a YAML file that uses strings to match gem command arguments and
# symbols to match RubyGems options.
#
# Gem command arguments use a String key that matches the command name and
# +:sources+:: Sets Gem::sources
# +:verbose+:: See #verbose
#
# gemrc files may exist in various locations and are read and merged in
# the following order:
#
# - system wide (/etc/gemrc)
# - per user (~/.gemrc)
# - per environment (gemrc files listed in the GEMRC environment variable)
So you could use the GEMRC environment variable to load extra, private files as well.
I'm trying to debug the service wrapper for Neo4j Community Server and no matter what I've tried there is never a log file generated. Does the Windows-Wrapper actually generate log entries? The documentation references the neo4j-wrapper but not the windows-wrapper.
OS: Windows 8.1 or Windows Server 2012 R2
Neo4j: 2.1.4 or 2.1.7 Community
I changed the logging levels to ALL everywhere I could and the only log files generated are /data/neo4j.0.0.log which seems to only contain information about the HTTP endpoint and /data/graph.db/messages.log which has no references to the wrapper. I expected to find a log file called /data/log/windows-wrapper.0.0.log
Any ideas on what I've done wrong?
windows-wrapper.logging.properties
# Properties file which configures the operation of the JDK logging facility.
# The system will look for this config file, first using a System property
# specified at startup:
#
# >java -Djava.util.logging.config.file=myLoggingConfigFilePath
#
# If this property is not specified, then the config file is retrieved from its
# default location at:
# JDK_HOME/jre/lib/logging.properties
# Global logging properties.
# ------------------------------------------
# The set of handlers to be loaded upon startup.
# Comma-separated list of class names.
# (? LogManager docs say no comma here, but JDK example has comma.)
#handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler
handlers=java.util.logging.FileHandler
# Default global logging level.
# Loggers and Handlers may override this level
# SERVERE, INFO, FINE, FINEST
.level=ALL
# Loggers
# ------------------------------------------
# Loggers are usually attached to packages.
# Here, the level for each package is specified.
# The global level is used by default, so levels specified here simply act as
# an override.
org.neo4j.server.level=ALL
# Handlers
# -----------------------------------------
# --- ConsoleHandler ---
# Override of global logging level
java.util.logging.ConsoleHandler.level=ALL
java.util.logging.ConsoleHandler.formatter=org.neo4j.server.logging.SimpleConsoleFormatter
java.util.logging.ConsoleHandler.filter=org.neo4j.server.logging.NeoLogFilter
# --- FileHandler ---
# Override of global logging level
java.util.logging.FileHandler.level=ALL
# Naming style for the output file (the output file is placed in the directory
# defined by the "user.home" System property):
# "/" the local pathname separator
# "%t" the system temporary directory
# "%h" the value of the "user.home" system property
# "%g" the generation number to distinguish rotated logs
# "%u" a unique number to resolve conflicts
# "%%" translates to a single percent sign "%"
java.util.logging.FileHandler.pattern=data/log/windows-wrapper.%u.%g.log
# Specifies whether the FileHandler should append onto any existing files
# (defaults to false):
java.util.logging.FileHandler.append=true
# Limiting size of output file in bytes (10M):
java.util.logging.FileHandler.limit=10000000
# Number of output files to cycle through, by appending an integer to the base
# file name:
java.util.logging.FileHandler.count=10
# The name of the character set encoding to use (defaults to the default
# platform encoding):
#java.util.logging.FileHandler.encoding=
# Style of output (Simple or XML):
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
logging.properties
# Properties file which configures the operation of the JDK
# logging facility.
# The system will look for this config file, first using
# a System property specified at startup:
#
# >java -Djava.util.logging.config.file=myLoggingConfigFilePath
#
# If this property is not specified, then the config file is
# retrieved from its default location at:
# JDK_HOME/jre/lib/logging.properties
# Global logging properties.
# ------------------------------------------
# The set of handlers to be loaded upon startup.
# Comma-separated list of class names.
# (? LogManager docs say no comma here, but JDK example has comma.)
handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler
#handlers=java.util.logging.ConsoleHandler
# Default global logging level.
# Loggers and Handlers may override this level
# SEVERE, INFO, FINE, FINEST
.level=ALL
# Loggers
# ------------------------------------------
# Loggers are usually attached to packages.
# Here, the level for each package is specified.
# The global level is used by default, so levels specified here simply act as
# an override.
org.neo4j.server.level=ALL
# Handlers
# -----------------------------------------
# --- ConsoleHandler ---
# Override of global logging level
java.util.logging.ConsoleHandler.level=ALL
java.util.logging.ConsoleHandler.formatter=org.neo4j.server.logging.SimpleConsoleFormatter
#java.util.logging.ConsoleHandler.filter=org.neo4j.server.logging.NeoLogFilter
# --- FileHandler ---
# Override of global logging level
java.util.logging.FileHandler.level=ALL
# Naming style for the output file (the output file is placed in the directory
# defined by the "user.home" System property):
# "/" the local pathname separator
# "%t" the system temporary directory
# "%h" the value of the "user.home" system property
# "%g" the generation number to distinguish rotated logs
# "%u" a unique number to resolve conflicts
# "%%" translates to a single percent sign "%"
java.util.logging.FileHandler.pattern=data/log/neo4j.%u.%g.log
# Specifies whether the FileHandler should append onto any existing files
# (defaults to false):
java.util.logging.FileHandler.append=true
# Limiting size of output file in bytes (10M):
java.util.logging.FileHandler.limit=10000000
# Number of output files to cycle through, by appending an integer to the base
# file name:
java.util.logging.FileHandler.count=10
# The name of the character set encoding to use (defaults to the default
# platform encoding):
#java.util.logging.FileHandler.encoding=
# Style of output (Simple or XML):
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
Since I was the last person to make changes to that particular part of the codebase, I'll attempt an awswer: yes, we do do logging. Here, for example: https://github.com/neo4j/windows-wrapper/blob/master/src/main/java/org/neo4j/wrapper/NeoServiceWrapper.java#L49-60
That is only in the case where you launch it as a console app though, it seems. And I am not sure if the library we use does logging of it's own. And I have to admit that last I looked at this I didn't notice whether logging was indeed working or not.
So, I have not got any concrete advice for you at the moment. I'll make sure to make a note in the backlog to go over this. Meanwhile if you get a breakthrough let us know!
Lasse
I recently switched to zsh, pretty happy about that. Except that the heroku toolbelt doesn't work anymore ...
Here is what I have when I type heroku -v :
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find heroku (>= 0) amongst [actionmailer-3.2.13, actionpack-3.2.13, activemodel-3.2.13, activerecord-3.2.13, activeresource-3.2.13, activesupport-3.2.13, arel-3.0.2, bcrypt-ruby-3.0.1, bootstrap-sass-2.3.1.0, builder-3.0.4, bundler-1.3.5, climate_control-0.0.3, cocaine-0.5.1, coffee-rails-3.2.2, coffee-script-2.2.0, coffee-script-source-1.6.2, daemons-1.1.9, devise-2.2.3, erubis-2.7.0, eventmachine-1.0.3, execjs-1.4.0, faraday-0.8.7, haml-3.1.4, hashie-1.2.0, hike-1.2.2, httpauth-0.2.0, i18n-0.6.1, journey-1.0.4, jquery-rails-2.2.1, json-1.7.7, jwt-0.1.8, mail-2.5.3, mime-types-1.23, mime-types-1.22, multi_json-1.7.3, multi_json-1.7.2, multipart-post-1.2.0, oauth2-0.8.1, omniauth-1.1.3, omniauth-facebook-1.4.1, omniauth-oauth2-1.1.1, orm_adapter-0.4.0, paperclip-3.4.1, pg-0.15.1, polyglot-0.3.3, rack-1.4.5, rack-cache-1.2, rack-ssl-1.3.3, rack-test-0.6.2, rails-3.2.13, railties-3.2.13, rake-10.0.4, rdoc-3.12.2, rubygems-bundler-1.1.1, rvm-1.11.3.7, sass-3.2.9, sass-rails-3.2.6, sprockets-2.2.2, thin-1.5.1, thor-0.18.1, tilt-1.4.1, tilt-1.3.7, treetop-1.4.12, tzinfo-0.3.37, uglifier-2.1.0, warden-1.2.1] (Gem::LoadError)
from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
from /usr/local/bin/heroku:22:in `<main>'
I tried to reinstall the toolbelt since I read about it, but same result happen.
I compared bash and zsh $PATHs but they seem to contain the same pointers to heroku folders :
Bash:
/usr/local/heroku/bin:/home/augustin/.rvm/gems/ruby-1.9.3-p392/bin:/home/augustin/.rvm/gems/ruby-1.9.3-p392#global/bin:/home/augustin/.rvm/rubies/ruby-1.9.3-p392/bin:/home/augustin/.rvm/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/google/google_appengine:/usr/local/heroku/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/google/google_appengine:/home/augustin/.rvm/bin:/home/augustin/.rvm/bin
Zsh:
/home/augustin/.rvm/gems/ruby-1.9.3-p392/bin:/home/augustin/.rvm/gems/ruby-1.9.3-p392#global/bin:/home/augustin/.rvm/rubies/ruby-1.9.3-p392/bin:/home/augustin/.rvm/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/google/google_appengine:/usr/local/heroku/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/google/google_appengine:/home/augustin/.rvm/bin
I have read about installing heroku gem since I have ruby errors, but I also read it's depreciated since the toolbelt exists: https://github.com/robbyrussell/oh-my-zsh/issues/1401
So where is the problem?
I'm pretty new to Ruby, I still don't understand everything about rvms and I have the feeling my error is linked to it.
Finally, here is my .zshrc file, which I think could help too.
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#ZSH_THEME="robbyrussell"
#ZSH_THEME="muse"
ZSH_THEME="ys"
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
# Comment this out to disable bi-weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"
# Uncomment to change how often before auto-updates occur? (in days)
# export UPDATE_ZSH_DAYS=13
# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"
# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment following line if you want to disable command autocorrection
# DISABLE_CORRECTION="true"
# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"
# Uncomment following line if you want to disable marking untracked files under
# VCS as dirty. This makes repository status check for large repositories much,
# much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails rails3 git textmate ruby lighthouse)
source $HOME/.aliases
plugins=(git ruby rails rails3 rvm heroku)
source $ZSH/oh-my-zsh.sh
# [[ -s "$HOME/.rvm/scripts/rvm" ]] && . “$HOME/.rvm/scripts/rvm”
if [[ -s $HOME/.rvm/scripts/rvm ]] ; then source $HOME/.rvm/scripts/rvm ; fi
# Customize to your needs...
export PATH=$PATH:/usr/local/heroku/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/google/google_appengine:/home/augustin/.rvm/bin
Great thanks in advance.
edit the last line of ~/.zshrc and change it to:
export PATH=/usr/local/heroku/bin:$PATH:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/games:/usr/local/games:/opt/google/google_appengine
just put in you terminal :
sudo snap install --classic heroku
I'm trying to work out the best way to set some environment variables with puppet.
I could use exec and just do export VAR=blah. However, that would only last for the current session. I also thought about just adding it onto the end of a file such as bashrc. However then I don't think there is a reliable method to check if it is all ready there; so it would end up getting added with every run of puppet.
I would take a look at this related question.
*.sh scripts in /etc/profile.d are read at user-login time (as the post says, at the same time /etc/profile is sourced)
Variables export-ed in any script placed in /etc/profile.d will therefore be available to your users.
You can then use a file resource to ensure this action is idempotent. For example:
file { "/etc/profile.d/my_test.sh":
content => 'export MYVAR="123"'
}
Or an alternate means to an indempotent result:
Example
if [[ ! grep PINTO_HOME /root/.bashrc | wc -l > 0 ]] ; then
echo "export PINTO_HOME=/opt/local/pinto" >> /root/.bashrc ;
fi
This option permits this environmental variable to be set when the presence of the
pinto application makes it warrented rather than having to compose a user's
.bash_profile regardless of what applications may wind up on the box.
If you add it to your bashrc you can check that it's in the ENV hash by doing
ENV[VAR]
Which will return => "blah"
If you take a look at Github's Boxen they source a script (/opt/boxen/env.sh) from ~/.profile. This script runs a bunch of stuff including:
for f in $BOXEN_HOME/env.d/*.sh ; do
if [ -f $f ] ; then
source $f
fi
done
These scripts, in turn, set environment variables for their respective modules.
If you want the variables to affect all users /etc/profile.d is the way to go.
However, if you want them for a specific user, something like .bashrc makes more sense.
In response to "I don't think there is a reliable method to check if it is all ready there; so it would end up getting added with every run of puppet," there is now a file_line resource available from the puppetlabs stdlib module:
"Ensures that a given line is contained within a file. The implementation matches the full line, including whitespace at the beginning and end. If the line is not contained in the given file, Puppet appends the line to the end of the file to ensure the desired state. Multiple resources can be declared to manage multiple lines in the same file."
Example:
file_line { 'sudo_rule':
path => '/etc/sudoers',
line => '%sudo ALL=(ALL) ALL',
}
file_line { 'sudo_rule_nopw':
path => '/etc/sudoers',
line => '%sudonopw ALL=(ALL) NOPASSWD: ALL',
}