New stuff:

- use_gitcfg option: only change GIT options if this is set
- use_keybindingscfg option: only change keybindings if this is set
- keybindings setter: major improvement in setting keybindings on start up
- tarxz option: ls colors setting for .tar.xz (default: coldblue)
- history_timeformat option: option for changing HISTTIMEFORMAT (default: none)
- update Debian vendor configuration
- bump ini version to 11
- string changes in nx-rc
- remove rc/styles/fallback-rc (set directly in nx-rc in case of emergency)
- remove ERR_MSG from nx-rc (simply show file errors directly)
parent ccba0dc7
......@@ -117,6 +117,13 @@ Overview of changes in v9.0 "Hotride"
string resembling an executable, the complete path will be added to
the command line.
* New configuration options
- use_gitcfg: only change GIT settings if this is set
- use_keybindingscfg: only change readline Keybindings if this is set
- tarxz: ls color setting for .tar.xz files (default: coldblue)
- history_timeformat: setting for changing HISTTIMEFORMAT, prepend time and
date to entries in bash's history (default: none)
* New git aliases
- ls alias to git (prettified version of log)
- lsb alias to git (sort branches (local + remote) by last activity)
......
ini_version = 10
ini_version = 11
[Style]
use_bashstyle = False
......@@ -47,6 +47,7 @@ alias_nine = ""
history_control = erasedups
history_ignore = bg *:fg *:exit:cd *:source *:. *:clear:sudo *:su *:
history_size = 1000
history_timeformat = ""
separator = |
ps234 = »
pwdcut = «
......@@ -158,6 +159,7 @@ flac = $lyellow
tar = $lcyan
targz = $lblue
tarbz2 = $liceblue
tarxz = $lcoldblue
zip = $lpink
rar = $lpink
custom = ""
......@@ -168,6 +170,7 @@ command = ""
prompt = ""
[Git]
use_gitcfg = False
git_user_name = ""
git_user_mail = ""
git_color = False
......@@ -176,6 +179,7 @@ git_aliases = False
git_signkey = ""
[Keybindings]
use_keybindingscfg = False
undo = C:_
upcase_word = e:u
capitalize_word = e:c
......
ini_version = 10
ini_version = 11
[Style]
use_bashstyle = True
......@@ -47,6 +47,7 @@ alias_nine = ""
history_control = erasedups
history_ignore = bg *:fg *:exit:cd *:source *:. *:clear:sudo *:su *:
history_size = 1000
history_timeformat = ""
separator = |
ps234 = »
pwdcut = «
......@@ -158,6 +159,7 @@ flac = $lyellow
tar = $lcyan
targz = $lblue
tarbz2 = $liceblue
tarxz = $coldblue
zip = $lpink
rar = $lpink
custom = ""
......@@ -168,6 +170,7 @@ command = ""
prompt = ""
[Git]
use_gitcfg = False
git_user_name = ""
git_user_mail = ""
git_color = True
......@@ -176,6 +179,7 @@ git_aliases = True
git_signkey = ""
[Keybindings]
use_keybindingscfg = False
undo = C:_
upcase_word = e:u
capitalize_word = e:c
......
......@@ -41,8 +41,6 @@ export BSNG_LOGFILE=$HOME/.bashstyle.log
dbg_log rm -f $BSNG_LOGFILE
dbg_log touch $BSNG_LOGFILE
dbg_log source $BSNG_RC_DIR/styles/null-rc
dbg_msg $"BashStyle-NG Starting"
dbg_msg $"BashStyle-NG Bash Major Version:" $(echo ${BASH_VERSINFO[0]})
dbg_msg $"BashStyle-NG Bash Minor Version:" $(echo ${BASH_VERSINFO[1]})
......@@ -55,7 +53,7 @@ dbg_msg $"BashStyle-NG Logfile:" $BSNG_LOGFILE
if [[ $(ini_get use_readlinecfg) == "True" ]]; then
dbg_msg $"BashStyle-NG Loading:" $"ReadlineCFG"
dbg_log source $BSNG_RC_DIR/settings/readline-rc
dbg_log bind -f ${HOME}/.inputrc
bind -f ${HOME}/.inputrc
fi
if [[ $(ini_get use_vimcfg) == "True" ]]; then
......@@ -68,12 +66,6 @@ if [[ $(ini_get use_nanocfg) == "True" ]]; then
dbg_log source $BSNG_RC_DIR/settings/nano-rc
fi
if [[ $(ini_get use_bashstyle) == False ]]; then
dbg_msg $"BashStyle-NG: Exiting"
else
dbg_msg $"BashStyle-NG Loading:" $"BashStyle-NG"
fi
if [[ $(ini_get enable_colors) == "True" ]]; then
dbg_log source $BSNG_RC_DIR/settings/color-rc
fi
......@@ -83,10 +75,20 @@ if [[ $(ini_get use_lscolors) == "True" && $(ini_get enable_colors) == "True" ]]
dbg_log source $BSNG_RC_DIR/settings/ls-rc
fi
dbg_log source $BSNG_RC_DIR/settings/git-rc
if [[ $(ini_get use_gitcfg) == "True" ]]; then
dbg_log source $BSNG_RC_DIR/settings/git-rc
fi
if [[ $(ini_get use_keybindingscfg == True) ]]; then
dbg_log source $BSNG_RC_DIR/settings/keybindings-rc
bind -f ${HOME}/.keybindings
fi
if [[ $(ini_get use_bashstyle) == "True" ]]; then
dbg_msg $"BashStyle-NG Loading:" $"BashStyle-NG"
dbg_log source $BSNG_RC_DIR/styles/null-rc
if [[ $(lsb_release -is) == Debian ]]; then
# if [[ ${1} == -r ]]; then
# START_LINE=$(sed -n '/^\#if \[ "$color_prompt" = yes/=' ~/.bashrc)
......@@ -136,14 +138,14 @@ if [[ $(ini_get use_bashstyle) == "True" ]]; then
use_custom_prompt=$(ini_get use_custom_prompt)
if [[ $use_custom_prompt == "True" ]]; then \
dbg_msg $"BashStyle-NG Setting:" $"Style Custom"
dbg_msg $"BashStyle-NG Setting:" $"Custom Prompt"
dbg_log source $BSNG_RC_DIR/styles/custom-rc
elif [[ -e $BSNG_RC_DIR/styles/${pstyle}-rc ]]; then
dbg_msg $"BashStyle-NG Setting:" $"Style" $pstyle
dbg_msg $"BashStyle-NG Setting:" $pstyle $"Prompt"
dbg_log source $BSNG_RC_DIR/styles/${pstyle}-rc
else
dbg_msg $"BashStyle-NG Setting:" $"Style Fallback"
dbg_log source $BSNG_RC_DIR/styles/fallback-rc
dbg_msg $"BashStyle-NG Setting:" $"Fallback Prompt"
dbg_log export PS1="\u@\h\w: "
fi
dbg_msg $"BashStyle-NG Setting:" $"PS2 PS3 PS4"
......@@ -178,10 +180,6 @@ if [[ $(ini_get use_bashstyle) == "True" ]]; then
fi
if [[ $(ini_get use_readline == True) ]]; then
dbg_log source $BSNG_RC_DIR/settings/keybindings-rc
fi
function lscd() {
OLD_PWD=${PWD}
......@@ -228,10 +226,4 @@ function reload () {
}
if [[ $ERR_MSG != "" ]]; then
echo -e "${eyellow}\n\nImportant informations:"
echo -e "${eorange}${ERR_MSG}\n"
fi
dbg_finalize
......@@ -9,14 +9,6 @@
# #
#########################################################
keybindings_unsetter () {
for key in $(bind -p | grep ${1} | gawk -F \: '{print $1}'); do
bind "${key}":self-insert
done
bind "${2}":self-insert
}
keybindings_setter () {
if [[ "${1}" != "" ]]; then
......@@ -29,19 +21,18 @@ keybindings_setter () {
esac
if [[ ${MOD} == e ]]; then
keybindings_unsetter ${ACT} "\\e${KEY}"
bind "\\e${KEY}":self-insert
echo -E \"\\e${KEY}\":${ACT} >> $RC_FILE
elif [[ ${MOD} == C ]]; then
keybindings_unsetter ${ACT} "\\C-${KEY}"
bind "\\C-${KEY}":self-insert
echo -E \"\\C-${KEY}\":${ACT} >> $RC_FILE
fi
fi
}
if [[ -e $HOME/.keybindings && ( ! -w $HOME/.keybindings || ! -r $HOME/.keybindings ) ]]; then
ERR_MSG+="\n * $HOME/.keybindings is not accessible! -- adjust permissions"
echo -e "\n * $HOME/.keybindings is not accessible! -- adjust permissions"
elif [[ ! -e $HOME/.keybindings.bs-ng.* ]]; then
export RC_FILE=$HOME/.keybindings.bs-ng.$(date +%I-%M-%S)
......@@ -59,7 +50,6 @@ elif [[ ! -e $HOME/.keybindings.bs-ng.* ]]; then
done
mv ${RC_FILE} ${HOME}/.keybindings
builtin bind -f ${HOME}/.keybindings
unset RC_FILE
fi
......@@ -84,13 +84,15 @@ eval _flac=$(ini_get flac)
eval _tar=$(ini_get tar)
eval _targz=$(ini_get targz)
eval _tarbz2=$(ini_get tarbz2)
eval _tarxz=$(ini_get tarxz)
eval _zip=$(ini_get zip)
eval _rar=$(ini_get rar)
_custom="$(ini_get custom)"
dbg_log export LS_COLORS="ex=$_exec:*=$_gen:*.log=$_log:*.deb=$_deb:*.rpm=$_rpm:di=$_dirs:*.jpg=$_jpg:*.png=$_png:*.gif=$_gif:\
*.mp3=$_mp3:*.ogg=$_ogg:*.flac=$_flac:*.tar=$_tar:*.tar.gz=$_targz:*.tar.bz2=$_tarbz2:*.zip=$_zip:*.rar=$_rar:$_custom"
*.mp3=$_mp3:*.ogg=$_ogg:*.flac=$_flac:*.tar=$_tar:*.tar.gz=$_targz:*.tar.bz2=$_tarbz2:*.tar.xz=$_tarxz:*.zip=$_zip:*.rar=$_rar:\
$_custom"
dbg_msg $"LS_COLORS Setting: LS_COLORS" "$LS_COLORS"
dbg_msg $"LS_COLORS Loading: BashStyle-NG"
......@@ -10,7 +10,7 @@
#########################################################
if [[ -e $HOME/.nanorc && ( ! -w $HOME/.nanorc || ! -r $HOME/.nanorc ) ]]; then
ERR_MSG+="\n * $HOME/.nanorc is not fully acccessible! -- adjust permissions."
echo -e "\n * $HOME/.nanorc is not fully acccessible! -- adjust permissions."
elif [[ ! -e $HOME/.nanorc.bs-ng.* ]]; then
export RC_FILE=$HOME/.nanorc.bs-ng.$(date +%I-%M-%S)
......
......@@ -9,6 +9,9 @@
# #
#########################################################
HISTTIMEFORMAT="$(ini_get history_timeformat) "
dbg_msg $"BashStyle-NG Setting:" $"HISTTIMEFORMAT" "$HISTTIMEFORMAT"
HISTCONTROL=$(ini_get history_control)
dbg_msg $"BashStyle-NG Setting:" $"HISTCONTROL" "$HISTCONTROL"
......@@ -25,7 +28,7 @@ FCEDIT=$(ini_get fcedit)
dbg_msg $"BashStyle-NG Setting:" $"FCEDIT" "$FCEDIT"
if [[ $(grep -w TMOUT /etc/profile.d/*msec.sh 2>/dev/null) != "" ]]; then
ERR_MSG+="\n * /etc/profile.d/msec.sh prevents setting TMOUT!"
echo -e "\n * /etc/profile.d/msec.sh prevents setting TMOUT!"
else TMOUT=$(ini_get timeout)
dbg_msg $"BashStyle-NG Setting:" $"TMOUT" "$TMOUT"
fi
......
......@@ -10,7 +10,7 @@
#########################################################
if [[ -e $HOME/.inputrc && ( ! -w $HOME/.inputrc || ! -r $HOME/.inputrc ) ]]; then
ERR_MSG+="\n * $HOME/.inputrc is not accessible! -- adjust permissions."
echo -e "\n * $HOME/.inputrc is not accessible! -- adjust permissions."
elif [[ ! -e $HOME/.inputrc.bs-ng.* ]]; then
export RC_FILE=$HOME/.inputrc.bs-ng.$(date +%I-%M-%S)
......
......@@ -10,7 +10,7 @@
#########################################################
if [[ -e $HOME/.vimrc && ( ! -w $HOME/.vimrc || ! -r $HOME/.vimrc ) ]]; then
ERR_MSG+="\n * $HOME/.vimrc is not accessible! -- adjust permissions"
echo -e "\n* $HOME/.vimrc is not accessible!"
elif [[ ! -e $HOME/.vimrc.bs-ng.* ]]; then
export RC_FILE=$HOME/.vimrc.bs-ng.$(date +%I-%M-%S)
......
#!/bin/bash
#########################################################
# #
# This is BashStyle-NG #
# #
# Licensed under GNU GENERAL PUBLIC LICENSE v3 #
# #
# Copyright 2007 - 2015 Christopher Bratusek #
# #
#########################################################
PS1="\u@\h\w: "
This diff is collapsed.
......@@ -126,6 +126,7 @@ class BashStyleNG(object):
WidgetHandler.InitWidget("pwd_len", "Advanced", "pwdlength", "int", None)
WidgetHandler.InitWidget("timeout", "Advanced", "timeout", "int", None)
WidgetHandler.InitWidget("history_control", "Advanced", "history_control", "combo", dicts.history_types)
WidgetHandler.InitWidget("history_timeformat", "Advanced", "history_timeformat", "text", None)
WidgetHandler.InitWidget("dirchar", "Advanced", "directory_indicator", "text", None)
WidgetHandler.InitWidget("tabrotate", "Advanced", "tab_rotation", "bool", None)
WidgetHandler.InitWidget("enable_lscd", "Advanced", "use_lscd", "bool", None)
......@@ -137,13 +138,6 @@ class BashStyleNG(object):
WidgetHandler.InitWidget("restore_pwd", "Advanced", "restore_directory", "bool", None)
WidgetHandler.InitWidget("debug_verbose", "Advanced", "debug_verbose", "bool", None)
self.reset_history = gtkbuilder.get_object("reset_history")
def do_reset_history(widget, data=None):
os.remove(os.path.expanduser("~/.bash_history"))
self.reset_history.connect("clicked", do_reset_history)
####################### Readline stuff #############################################
WidgetHandler.InitWidget("readline", "Readline", "use_readlinecfg", "bool", None)
WidgetHandler.InitWidget("completion", "Readline", "completion", "bool", None)
......@@ -178,6 +172,7 @@ class BashStyleNG(object):
WidgetHandler.InitWidget("globasciiranges", "Shopt", "globasciiranges", "bool", None)
######################## GIT Stuff #################################################
WidgetHandler.InitWidget("use_gitcfg", "Git", "use_gitcfg", "bool", None)
WidgetHandler.InitWidget("git_user", "Git", "git_user_name", "text", None)
WidgetHandler.InitWidget("git_mail", "Git", "git_user_mail", "text", None)
WidgetHandler.InitWidget("git_editor", "Git", "git_editor", "text", None)
......
......@@ -32,7 +32,7 @@ USER_DEFAULTS_SAVE = (os.getenv('HOME') + '/.bs-ng.ini.save')
FACTORY_DEFAULTS = (DATADIR + '/bashstyle-ng/bs-ng.ini')
VENDOR_DEFAULTS = ('/etc/bs-ng_vendor.ini')
app_ini_version = 10
app_ini_version = 11
class Config(object):
def InitConfig(self):
......
......@@ -94,12 +94,16 @@ class IconBook(object):
main_label = gtkbuilder.get_object("main.label")
use_keys_button = gtkbuilder.get_object("use_keybindingscfg")
use_keys_button.set_visible(0)
reset_key = gtkbuilder.get_object("reset_key")
reset_key.set_visible(0)
def back_clicked(data):
notebook.set_current_page(0)
reset_key.set_visible(0)
use_keys_button.set_visible(0)
back.set_visible(0)
main_label.set_visible(1)
......@@ -116,6 +120,7 @@ class IconBook(object):
notebook.set_current_page(notebook_pages[model[item][1]])
if model[item][1] == "Keybindings" :
reset_key.set_visible(1)
use_keys_button.set_visible(1)
if model[item][1] == "About BashStyle-NG" :
self.ShowAboutDialog()
if model[item][1] != "About BashStyle-NG" :
......
......@@ -65,7 +65,6 @@ keybindings = {
"backward_word",
"forward_word",
"overwrite_mode"
}
class KeyTree(object):
......@@ -76,6 +75,7 @@ class KeyTree(object):
self.factorydefault = fdc
def InitTree(self):
use_keys = gtkbuilder.get_object("use_keybindingscfg")
reset = gtkbuilder.get_object("reset_key")
store = gtkbuilder.get_object("treeviewstore")
tree = gtkbuilder.get_object("treeview")
......@@ -120,6 +120,13 @@ class KeyTree(object):
tree.get_selection().connect("changed", on_changed)
use_keys.set_active(self.config["Keybindings"].as_bool("use_keybindingscfg"))
def on_use_keys(widget):
self.config["Keybindings"]["use_keybindingscfg"] = widget.get_active()
use_keys.connect("toggled", on_use_keys)
def on_reset(data):
sel = tree.get_selection()
(model, iter) = sel.get_selected()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment