diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2018-06-16 08:57:11 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2018-06-16 08:57:11 -0300 |
commit | 64e83b8c52efff9969a6b3182203bd48bc7cb979 (patch) | |
tree | 03667815ca8b29266cf2c7686e9d1f5e39fbfe36 | |
parent | adce0a14f172899279512c5616c07c34792a419b (diff) | |
download | wrappers-64e83b8c52efff9969a6b3182203bd48bc7cb979.tar.gz wrappers-64e83b8c52efff9969a6b3182203bd48bc7cb979.tar.bz2 |
Adds mc wrapper
-rwxr-xr-x | mc | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -0,0 +1,28 @@ +#!/bin/bash +# +# Wrapper for Midnight Commander +# + +# Parameters +BASENAME="`basename $0`" +MC="/usr/bin/mc" +INI="$HOME/.config/mc/ini" +CONF="`readlink $INI || echo $INI`" + +# Dispatch +if [ ! -z "$DISPLAY" ]; then + TERM=xterm-256color $MC $* +else + $MC $* +fi + +# Fix configuration +# +# These settings vary from screen size to screen size and +# might change mc's dotfiles whenever it's run on a different +# screen configuration. +# +# If $INI is a link, $CONF will be the link destination. +# That's important because `sed -i` usually breaks the linking. +sed -i '/^left_panel_size=.*$/d' $CONF +sed -i '/^top_panel_size=.*$/d' $CONF |