Archive

Posts Tagged ‘mc’

Midnight Commander tips

Copy the name of the current file to the mini shell:
“Esc+Enter” (i.e. press Esc, release, then press Enter)

I already knew this. Here are some new ones that I learned today:

The one above has an alternative shortcut:
“Ctrl+Enter”

Paste to the shell the path of the selected panel:
“Esc+a” or “Ctrl+x p”

Paste to the shell the path of the unselected (other) panel:
“Esc+A” or “Ctrl+x Ctrl+p”

These are actually in the man page, so it would be a good idea to read it once :)

Thanks to Andrew B. on the mc mailing list.

Categories: bash Tags: ,

Disable Unity’s F9

Problem
I use Midnight Commander a lot and F9 in MC means: “go to the top menu bar“. However, Unity steals F9 and activates a widget layer. By default this layer is empty, so you only see that the screen greys out.

How to disable this shit?

Solution
Start “ccsm“, find the Desktop section and untick “Widget Layer“. Done.

MC: get the same folder in the other panel

Problem
In Midnight Commander, you want to see the same folder in the other panel.

Solution

Alt + i

It can also be a good idea to run through the manual for more tricks: “man mc” :)

mc doesn’t open zip files

Problem
After I upgraded Ubuntu to 12.04, I also updated mc from source. The current stable version is 4.8.1.3. However, these recent versions of mc introduced some novelties. For instance, using the old mc.ext files, they won’t open archives :(

Solution
Another novelty is that the folder of mc was moved from “~/.mc” to “~/.config/mc“. So I moved my mc.ext file to the new location. I also had a symbolic link called “bindings” that pointed to mc.ext, it was moved too. Then I removed the obsolete folder ~/.mc.

Now, update your mc.ext file to the new format in order to open archives:

cd ~/.config/mc
mv mc.ext mc.ext.old
cat mc.ext.old | sed 's|\(Open.*\)#\(.*\)$|\1/\2://|' > mc.ext

Restart mc and opening the archives should work now.

This tip is from here.

Categories: ubuntu Tags: , , ,

mc problem: cannot chmod target file, operation not permitted

March 25, 2012 Leave a comment

Problem
With mc, you want to copy lots of small files to an NTFS partition. However, for every file it drops a warning: “cannot chmod target file”. Either you switch to root or you sit next to the keyboard and press Skip for every single file. WTF?

Solution
When you press F5, untick the option “Preserve attributes“. Done.

Install Midnight Commander from source

August 10, 2011 6 comments

Problem
I’ve already noticed that the Ubuntu repositories are sometimes very out-of-date. A good example for this is the “mc” package. There is a PPA for Midnight Commander that should solve this problem but it’s also very old. At the time of writing (August 10, 2011), the current stable release is 4.7.5.3 while the PPA contains the version 4.7.0.9 (updated on Sept. 15, 2010).

Solution
Since I wanted to use a fresh release of MC, I installed it from source. Steps to follow:

  • Download the latest stable source and unpack it.
  • For a successful compilation I had to install this package too: “sudo apt-get install libslang2-dev libglib2.0-dev”.
  • ./configure
  • make
  • If it was successful then you should have a binary “mc” file in the src/ folder. If it’s there, you can remove your current version with “sudo apt-get remove mc“.
  • Then install the new version with “sudo make install“.

I also had to modify my .bashrc a bit:

# old:
#alias mc='. /usr/share/mc/bin/mc-wrapper.sh'
# new:
alias mc='. /usr/local/libexec/mc/mc-wrapper.sh'

Update (20120505)
Installing mc from source is now integrated in jabbatron.

Categories: bash, ubuntu Tags: , , ,

Ubuntu 11.04 Natty Narwhal

April 29, 2011 5 comments

Yesterday I installed the newest Ubuntu on my machines. The upgrade went smoothly, there were no problems. I collect here my notes about this new release.

If you want to upgrade several machines, read this post. With this “trick” you can reuse the downloaded packages on other machines too.

Unity redefines F10. As I use Midnight Commander a lot, it’s quite annoying as F10 means “quit” in MC. A workaround is to use ESC + 0 in MC, but that’s a PITA. Also, I assigned something to F10 in vim… Here is how to disable F10 in Unity: (1) install compizconfig-settings-manager and start it, (2) filter “unity” and start the Ubuntu Unity Plugin, (3) edit “Key to open the first panel menu” and disable it. Now everything is back to normal.

With CTRL + ALT + T you can start a new instance of your default terminal emulator. I use terminator, so here is how to make it the default: click on the power button in the top right corner and choose “System Settings”. On the left side at the bottom you will see “Set Preferred Applications”. Start it, and under the System tab specify your favorite terminal emulator.

Want to monitor the RAM / CPU usage? Execute the following commands:

sudo add-apt-repository ppa:alexeftimie/ppa
sudo apt-get update
sudo apt-get install indicator-sysmonitor
indicator-sysmonitor &

I use this customized output: “| CPU: {cpu} | RAM: {mem} |”. To edit it, right click on the applet and choose Preferences.

Is the Dropbox indicator applet gone? Here you will find a fix.

Missing the weather indicator? Execute “sudo apt-get install indicator-weather“. (via webupd8)

Unity wallpapers with shortcuts: here.

After playing one day with Unity, I found one thing very frustrating: there is no bottom panel for the applications, so I never know what programs are running. I noticed that I was pressing ALT + TAB a lot… I was already thinking of switching back to Ubuntu Classic when I could figure out how to get the bottom panel back. You just need to launch “gnome-panel” and customize the new panel. Add it to your startup applications, this way it will be launched each time you log in. It also added a top panel that I removed (right click, delete). Customization: right click and add “Window List” and “Workspace Switcher”. Since this is a classic panel, you can add all those applets that are missing in Unity, for instance the “System Monitor”.

If you find the global menu (File, Edit, etc. are on the top panel like in MacOS) annoying, here is how to get rid of it (via webupd8):

sudo apt-get remove appmenu-gtk indicator-applet-appmenu indicator-appmenu

Log out and log back in to take it into account. (edit: same thing in 11.10)

Under Eclipse I had a strange problem. Sometimes it crashed with the error message “The program ‘Eclipse’ received an X Window System error.” I found the solution here. In short, I had two xulrunner instances on my system, versions 1.9.1 and 1.9.2. Fire up Synaptic and remove 1.9.1.

With Firefox, I also had some strange problems. I couldn’t drag and drop an URL from the location bar to the Bookmarks. Or, sometimes the popup menu activated with the right mouse button disappeared when I moved the mouse pointer above it. The following command solved these problems:

sudo apt-get remove firefox-globalmenu

If you don’t like the new overlay scrollbars, here is how to get rid of them:

sudo apt-get remove overlay-scrollbar liboverlay-scrollbar-0.1-0

This tip is from here.

Categories: ubuntu Tags: , , , , ,
Follow

Get every new post delivered to your Inbox.

Join 72 other followers