xmonad install clarification - xmonad

I'm attempting to install xmonad on my machine and I'm at this point in the instructions
(http://www.haskell.org/haskellwiki/Xmonad/Using_xmonad_on_Apple_OSX#Installing_xmonad)
2.2 Configuring Your .profile
Insert the following into your ~/.profile
export PATH=$PATH:~/.cabal/bin:/usr/local/bin
export USERWM=`which xmonad`
Much of this isn't needed until later, but it's good to get it out the way now.
2.2.1 Installing Cabal
I understand what's going on with export PATH=$PATH:~/.cabal/bin:/usr/local/bin but could someone please explain 1. what the USERWM global variable is and what exactly is meant to be assigned to it? (I'm assuming 'which xmonad' isn't meant literally). Is it a version number of xmonad? Something else?

It is later executed in ~/.xinitrc:
source ~/.profile
exec $USERWM
Cheers

Also, the line
export USERWM=`which xmonad`
is correct as is. The shell will treat things in backticks (next to the '1' on top of most keyboards) as a command to be executed. The which command will give the path to xmonad by searching through the PATH variable.
Note that this means
export USERWM='which xmonad'
will not work, since the shell wouldn't run the command with the regular tick marks.

Related

EMCC not found - only works in emsdk not globally in terminal

I am a new Linux user and am looking to get the emscripten emcc command to work globally on Ubuntu.
This is my current configuration:
LLVM_ROOT = '/home/mpaccione/Projects/emsdk/upstream/bin'
BINARYEN_ROOT = '/home/mpaccione/Projects/emsdk/upstream'
EMSCRIPTEN_ROOT = '/home/mpaccione/Projects/emsdk/upstream/emscripten'
NODE_JS = '/home/mpaccione/Projects/emsdk/node/12.9.1_64bit/bin/node'
TEMP_DIR = '/tmp'
COMPILER_ENGINE = NODE_JS
JS_ENGINES = [NODE_JS]
If I am in /var/www/html/collision-detection-wasm/hello-world
... command 'emcc' not found.
I followed the install instructions but they did not work how I would expect. I need this to work globally or it's not of use.
How do I go about doing that on Ubuntu Linux?
In order to use emcc it needs to be in your $PATH.
To do this you can run source /path/to/emsdk/emsdk_env.sh in your terminal.
Or if you want to make it permanent you can add that same command to your startup scripts (e.g. $HOME/.bash_profile or $HOME/.bashrc).
This is documented at https://emscripten.org/docs/getting_started/downloads.html.
Hijacking #sbc100's answer to further clarify things to answer OP's question asked as a comment.
In order to use emcc one needs to set the PATH and other environment variables.
As it can be seen in the documentation, the command source ./emsdk_env.sh (or source /path/to/emsdk/emsdk_env.sh if you are not within the emsdk directory) does exactly that for the current terminal.
If you want this effect to be permanent, then do just as #sbc100's said. Just add it to, for example, to your bashrc file by inserting source /path/to/emsdk/emsdk_env.sh to a new line at the end. This will make the script run each time a terminal opens. This may be annoying to same as it outputs what was added to PATH and which environment variables were set.
Alternatively, one may also add the entries to the bashrc manually that the script kindly tells us about. For me, it meant inserting the following lines:
## Emscripten ########
export PATH="/home/dudly01/repos/github/emsdk:$PATH"
export PATH="/home/dudly01/repos/github/emsdk/upstream/emscripten:$PATH"
export PATH="/home/dudly01/repos/github/emsdk/node/14.18.2_64bit/bin:$PATH"
export EMSDK="/home/dudly01/repos/github/emsdk"
export EM_CONFIG="/home/dudly01/repos/github/emsdk/.emscripten"
export EMSDK_NODE="/home/dudly01/repos/github/emsdk/node/14.18.2_64bit/bin/node"
I would think, however, that these lines need to be adjusted as the project evolves.

Mujoco_py missing path to LD_LIBRARY_PATH, Ubuntu 16.04

I am trying to get mujoco_py running. When I do
import mujoco_py
I get this error:
Exception:
Missing path to your environment variable.
Current values LD_LIBRARY_PATH=
Please add following line to .bashrc:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/jonah/.mujoco/mjpro150/bin
I have added the above line to both /etc/skel/.bashrc and ~/.bashrc. If I run
echo $LD_LIBRARY_PATH
I get
/home/jonah/.mujoco/mjpro150/bin/
My .mujoco folder includes mjkey.txt and the mjpro150 folder. I can run ./simulate successfully, so I have a feeling that this is some kind of mujoco_py specific bug.
Which program do you use to import mujoco?
I had a similar issue using mujoco_py with PyCharm Community 2018.1. A workaround was to launch PyCharm from the terminal instead of using the launcher icon. Maybe it could help with your issue too.
Otherwise you could try adding the LD_LIBRARY_PATH to ~/.profile instead of ~/.bashrc, as proposed in this answer here: https://askubuntu.com/questions/1022836/python-not-recognizing-ld-library-path/1022913#1022913
You can try to reinstall Pycharm for the newest version.
After you save the .bashrc file your want execute this code.
source ~/.bashrc
Now link is updated.
Please check the user which you run the code with. The mismatch user will cause this problem. There is the checklist may help you:
Don’t use ‘sudo’ to run the code;
Don’t use ‘sudo’ or virtual environment (e.g., anaconda) to run Pycharm (If you run the code in Pycharm).

Make a program in path preferable instead of another

There is a program in the PATH variable installed by root, but I installed a more recent version in my local.
There is any way to make my program preferable instead of the root?
Sorry for my bad english.
export PATH="/path/to/my/local/directory:$PATH"
Set this in your shell's startup file (e.g., ~/.bash_profile or ~/.zshenv) and restart your shell (or just execute it in your terminal).
put the preferred directory in front of the other one. It will pick up the first one it finds.
export PATH=/this/path/is/searched/first:/this/one/is/second:$PATH

customed command not found in a new terminal

everyone.
I had a basic question want to consult, about the environment variable setting.
After closed my one existed terminal which could execute compile(make) and do customed(mksdboot) command, i can't do mksdboot command anymore(I had execute a predefined setting environment variable shell script i.e. $ . ./arndale_envsetup.sh again) in the new terminal.
Cause i am a beginner in Linux, i am not very clearly about the environment variable setting rules.
i had tried to 'su' or 'sudo' to execute mksdboot, but no luck:(
ps. I had another project needs to compile in my PC(i didn't export PATH to .bashrc, only execute export PATH when i open a new terminal every time), may it efforts the original project's environment variable?
thanks.
[UPDATED]
i tried using $source ./arndale_envsetup.sh, relative commands worked finally.
but i still did't figure out the reason between work or not work. >"<
The command
history
will list what your previous commands where.
This might give you a pointer what set the path in the way you needed it.
You could also try to see where you command is via
locate mksdboot

Backspace in zsh fails to work in quite the strange way

I'm on a fresh Virtualbox install of CentOS 6.4.
After installing zsh 5.0.2 from source using ./configure --prefix=/usr && make && make install and setting it as the shell with chsh -s /usr/bin/zsh, everything is good.
Then some time after, after installing python it seems, it starts acting strange.
Happens with PuTTY and iTerm2 over SSH, does not happen on the raw terminal through Virtualbox.
typing something, then erasing it: rather than removing the char and moving the cursor back, the cursor moves forward.
Typing Ctrl+V then Backspace repeatedly prints out this repeating pattern '^#?'
Running cat from zsh works fine. Prints out '^H' if I type that, backspaces like normal if I type normal backspace.
Surely someone's seen this before and knows exactly what the hell it is.
I'm not positive yet, but it seems that installing oh-my-zsh can fix this. But I really want to know what the specific issue is here.
OK , I suggest you try
export TERM=xterm
in your .zshrc configuration
the Changing into Zsh caused the bug.
sigh I knew I solved this before.
It's too damn easy to forget things.
The solution is to compile and apply the proper terminfo data with tic, as I have a custom config with my terminal clients, xterm-256color-italic, that confuses zsh.
There appear to be other ways to configure this stuff too; I basically just need it to be properly set up so italics work everywhere (including in tmux) so hopefully I can figure out how to do this more portably than I am currently.
I encounter the same problem when I manually install ZSH without root, when the backspace turns to blankspace but still functions as Backspace. Finally, I find it is because "ncurses" is not installed well.
tic: error while loading shared libraries: libncurses.so.6: cannot open shared object file: No such file or directory
? tic could not build /home/user/ceph-data/soft/ncurses-6.1/share/terminfo
After I reinstall the "ncurses", the problem of ZSH backspace is solved. Just for your information.
my $TERM is xterm-256color, by the way.

Resources