- fixed bug #189

- move colorshell and history-sync from options-rc to nx-rc (and only define if actually used)
- simplify ls-colors creation code
- add  ls-colors for link, pipe, socket, block device, character device
- define fallback ls-color first
- update german translation
parent 85808db2
......@@ -6,6 +6,8 @@ Overview of changes in v9.1 "Dial T for TNT"
set softtabstop instead of shiftwidth for setting tab length
* #188 (keybindings-rc):
some of the keybindings set from UI didn't take effect
* #189 (colorshell):
option colorshell_reset did not work
=== Widgets ===
......@@ -146,6 +148,17 @@ Overview of changes in v9.1 "Dial T for TNT"
- title_color_fg: text color for titlebar
- title_color_bg: background color for titlebar
=== LS Colors ===
* code simplification
* set ls-color for '*' (fallback) first
* add ls-color options for:
- symbolic links
- sockets
- pipes
- block devices
- character devices
=== Translations ===
* updated German translation
......
ini_version = 17
ini_version = 18
[Style]
use_bashstyle = False
......@@ -189,6 +189,11 @@ tarbz2 = $liceblue
tarxz = $lcoldblue
zip = $lpink
rar = $lpink
link = $lcyan
socket = $lyellow
pipe = $lred
blockdev = $lblue
chardev = $lgreen
custom = ""
[Custom]
......
......@@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: BashStyle-NG\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-09-13 18:38+0200\n"
"PO-Revision-Date: 2015-09-13 18:39+0200\n"
"POT-Creation-Date: 2015-09-15 21:44+0200\n"
"PO-Revision-Date: 2015-09-15 21:45+0200\n"
"Last-Translator: Christopher Roy Bratusek <nano@jpberlin.de>\n"
"Language-Team: German (Germany) (http://www.transifex.com/projects/p/bs-ng/"
"language/de_DE/)\n"
......@@ -207,7 +207,7 @@ msgstr "Prompt Baukasten"
msgid "Shell Options"
msgstr "Shell Optionen"
#: ui/iconbook.py:52 ui/iconbook.py:68 ui/bashstyle.ui.h:785
#: ui/iconbook.py:52 ui/iconbook.py:68 ui/bashstyle.ui.h:790
msgid "GIT"
msgstr "GIT"
......@@ -215,7 +215,7 @@ msgstr "GIT"
msgid "About BashStyle-NG"
msgstr "Über BashStyle-NG"
#: ui/iconbook.py:54 ui/iconbook.py:70 ui/iconbook.py:121 ui/bashstyle.ui.h:808
#: ui/iconbook.py:54 ui/iconbook.py:70 ui/iconbook.py:121 ui/bashstyle.ui.h:813
msgid "Keybindings"
msgstr "Tastenkürzel"
......@@ -235,7 +235,7 @@ msgstr "GObject (aus gi.repository)"
msgid "Binding"
msgstr "Tastenkürzel"
#: ui/keybindings.py:112 ui/bashstyle.ui.h:763
#: ui/keybindings.py:112 ui/bashstyle.ui.h:768
msgid "Revert"
msgstr "Benutzer"
......@@ -2726,126 +2726,146 @@ msgid "Common"
msgstr "Standard"
#: ui/bashstyle.ui.h:742
msgid "JPEG Images:"
msgstr "JPEG Bilder:"
msgid "RAR Archive:"
msgstr "RAR Archiv:"
#: ui/bashstyle.ui.h:743
msgid "PNG Images:"
msgstr "PNG Bilder:"
msgid "ZIP Archive:"
msgstr "ZIP Archiv:"
#: ui/bashstyle.ui.h:744
msgid "GIF Images:"
msgstr "GIF Bilder:"
msgid "GZiped TAR Archive:"
msgstr "GZip TAR Archiv:"
#: ui/bashstyle.ui.h:745
msgid "FLAC Audio:"
msgstr "FLAC Audio:"
msgid "BZiped TAR Archive:"
msgstr "BZip TAR Archiv:"
#: ui/bashstyle.ui.h:746
msgid "OGG Vorbis Audio:"
msgstr "OGG Vorbis Audio:"
msgid "TAR Archive:"
msgstr "TAR Archiv:"
#: ui/bashstyle.ui.h:747
msgid "MP3 Audio:"
msgstr "MP3 Audio:"
msgid "Archives"
msgstr "Archive"
#: ui/bashstyle.ui.h:748
msgid "Media"
msgstr "Medien"
msgid "MP3 Audio:"
msgstr "MP3 Audio:"
#: ui/bashstyle.ui.h:749
msgid "TAR Archive:"
msgstr "TAR Archiv:"
msgid "JPEG Images:"
msgstr "JPEG Bilder:"
#: ui/bashstyle.ui.h:750
msgid "Archives"
msgstr "Archive"
msgid "OGG Vorbis Audio:"
msgstr "OGG Vorbis Audio:"
#: ui/bashstyle.ui.h:751
msgid "GZiped TAR Archive:"
msgstr "GZip TAR Archiv:"
msgid "PNG Images:"
msgstr "PNG Bilder:"
#: ui/bashstyle.ui.h:752
msgid "ZIP Archive:"
msgstr "ZIP Archiv:"
msgid "FLAC Audio:"
msgstr "FLAC Audio:"
#: ui/bashstyle.ui.h:753
msgid "BZiped TAR Archive:"
msgstr "BZip TAR Archiv:"
msgid "GIF Images:"
msgstr "GIF Bilder:"
#: ui/bashstyle.ui.h:754
msgid "RAR Archive:"
msgstr "RAR Archiv:"
msgid "Media"
msgstr "Medien"
#: ui/bashstyle.ui.h:755
msgid "Links:"
msgstr "Verknüpfungen:"
#: ui/bashstyle.ui.h:756
msgid "Pipes:"
msgstr "Pipes:"
#: ui/bashstyle.ui.h:757
msgid "Sockets:"
msgstr "Sockets:"
#: ui/bashstyle.ui.h:758
msgid "Block Devices:"
msgstr "Block-Geräte:"
#: ui/bashstyle.ui.h:759
msgid "Character Devices:"
msgstr "Character-Geräte:"
#: ui/bashstyle.ui.h:760
msgid "LS Colors"
msgstr "LS Farben"
#: ui/bashstyle.ui.h:756
#: ui/bashstyle.ui.h:761
msgid "Use a custom prompt"
msgstr "Eigenen Prompt benutzen"
#: ui/bashstyle.ui.h:757
#: ui/bashstyle.ui.h:762
msgid "Show Toolbox"
msgstr "Werkzeugkasten aufrufen"
#: ui/bashstyle.ui.h:758
#: ui/bashstyle.ui.h:763
msgid "PS1"
msgstr "PS1"
#: ui/bashstyle.ui.h:759
#: ui/bashstyle.ui.h:764
msgid "PROMPT_COMMAND"
msgstr "PROMPT_COMMAND"
#: ui/bashstyle.ui.h:760
#: ui/bashstyle.ui.h:765
msgid "Empty"
msgstr "Löschen"
#: ui/bashstyle.ui.h:761
#: ui/bashstyle.ui.h:766
msgid "Undo"
msgstr "Rückgängig"
#: ui/bashstyle.ui.h:762
#: ui/bashstyle.ui.h:767
msgid "Redo"
msgstr "Wiederholen"
#: ui/bashstyle.ui.h:764
#: ui/bashstyle.ui.h:769
msgid "Factory"
msgstr "Factory"
#: ui/bashstyle.ui.h:765
#: ui/bashstyle.ui.h:770
msgid "Custom"
msgstr "Eigenes"
#: ui/bashstyle.ui.h:766
#: ui/bashstyle.ui.h:771
msgid "Configurate GIT"
msgstr "GIT konfigurieren"
#: ui/bashstyle.ui.h:767
#: ui/bashstyle.ui.h:772
msgid "GIT user name"
msgstr "GIT Benutzername"
#: ui/bashstyle.ui.h:768
#: ui/bashstyle.ui.h:773
msgid "GIT mail address"
msgstr "GIT E-Mail-Adresse"
#: ui/bashstyle.ui.h:769
#: ui/bashstyle.ui.h:774
msgid "Editor for GIT"
msgstr "Editor für GIT"
#: ui/bashstyle.ui.h:770
#: ui/bashstyle.ui.h:775
msgid "Default GIT signing key"
msgstr "Standard GIT Signatur-Schlüssel"
#: ui/bashstyle.ui.h:771
#: ui/bashstyle.ui.h:776
msgid "Colorize GIT output"
msgstr "Farbige GIT Ausgabe"
#: ui/bashstyle.ui.h:772
#: ui/bashstyle.ui.h:777
msgid "GIT aliases"
msgstr "GIT aliases"
#: ui/bashstyle.ui.h:773
#: ui/bashstyle.ui.h:778
msgid ""
"Explanation of GIT aliases\n"
"\n"
......@@ -2861,7 +2881,7 @@ msgstr ""
"re = zurücksetzen auf HEAD\n"
"ma = master auschecken"
#: ui/bashstyle.ui.h:779
#: ui/bashstyle.ui.h:784
msgid ""
"\n"
"who = no of commits per contributor\n"
......@@ -2877,91 +2897,91 @@ msgstr ""
"stage = stage Änderung an überwachten Dateien\n"
"lsb = Zweige nach Aktivität anzeigen"
#: ui/bashstyle.ui.h:786
#: ui/bashstyle.ui.h:791
msgid "Enable histappend"
msgstr "Benutze histappend"
#: ui/bashstyle.ui.h:787
#: ui/bashstyle.ui.h:792
msgid "Enable cd-spell"
msgstr "Benutze cd-spell"
#: ui/bashstyle.ui.h:788
#: ui/bashstyle.ui.h:793
msgid "Enable checkhash"
msgstr "Benutze checkhash"
#: ui/bashstyle.ui.h:789
#: ui/bashstyle.ui.h:794
msgid "Enable force fignore"
msgstr "Benutze force fignore"
#: ui/bashstyle.ui.h:790
#: ui/bashstyle.ui.h:795
msgid "Enable no empty cmd comp."
msgstr "Benutze no empty cmd comp."
#: ui/bashstyle.ui.h:791
#: ui/bashstyle.ui.h:796
msgid "Enable cdable vars"
msgstr "Benutze cdable vars"
#: ui/bashstyle.ui.h:792
#: ui/bashstyle.ui.h:797
msgid "Enable cmdhist"
msgstr "Benutze cmdhist"
#: ui/bashstyle.ui.h:793
#: ui/bashstyle.ui.h:798
msgid "Enable histreedit"
msgstr "Benutze histreedit"
#: ui/bashstyle.ui.h:794
#: ui/bashstyle.ui.h:799
msgid "Enable dotglob"
msgstr "Benutze dotglob"
#: ui/bashstyle.ui.h:795
#: ui/bashstyle.ui.h:800
msgid "Enable extglob"
msgstr "Benutze extglob"
#: ui/bashstyle.ui.h:796
#: ui/bashstyle.ui.h:801
msgid "Enable nocaseglob"
msgstr "Benutze nocaseglob"
#: ui/bashstyle.ui.h:797
#: ui/bashstyle.ui.h:802
msgid "Enable nocasematch"
msgstr "Benutze nocasematch"
#: ui/bashstyle.ui.h:798
#: ui/bashstyle.ui.h:803
msgid "Enable autocd"
msgstr "Benutze autocd"
#: ui/bashstyle.ui.h:799
#: ui/bashstyle.ui.h:804
msgid "Enable dirspell"
msgstr "Benutze dirspell"
#: ui/bashstyle.ui.h:800
#: ui/bashstyle.ui.h:805
msgid "Enable globstar"
msgstr "Benutze globstar"
#: ui/bashstyle.ui.h:801
#: ui/bashstyle.ui.h:806
msgid "Enable checkjobs"
msgstr "Benutze checkjobs"
#: ui/bashstyle.ui.h:802
#: ui/bashstyle.ui.h:807
msgid "Enable globasciiranges"
msgstr "Benutze globasciiranges"
#: ui/bashstyle.ui.h:803
#: ui/bashstyle.ui.h:808
msgid "Enable direxpand"
msgstr "Benutze direxpand"
#: ui/bashstyle.ui.h:804
#: ui/bashstyle.ui.h:809
msgid "3.x | Shopts"
msgstr "3.x | Shopts"
#: ui/bashstyle.ui.h:805
#: ui/bashstyle.ui.h:810
msgid "4.x"
msgstr "4.x"
#: ui/bashstyle.ui.h:806
#: ui/bashstyle.ui.h:811
msgid "4.3"
msgstr "4.3"
#: ui/bashstyle.ui.h:807
#: ui/bashstyle.ui.h:812
msgid "Shopts"
msgstr "Shopts"
......
......@@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: BashStyle-NG\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-09-13 18:38+0200\n"
"PO-Revision-Date: 2015-09-09 18:36+0200\n"
"POT-Creation-Date: 2015-09-15 21:44+0200\n"
"PO-Revision-Date: 2015-09-15 21:45+0200\n"
"Last-Translator: Christopher Roy Bratusek <nano@jpberlin.de>\n"
"Language-Team: German (Germany) (http://www.transifex.com/projects/p/bs-ng/"
"language/de_DE/)\n"
......@@ -53,7 +53,7 @@ msgid "BashStyle-NG Logfile:"
msgstr "BashStyle-NG Logdatei:"
#: rc/nx-rc:72 rc/nx-rc:103 rc/nx-rc:107 rc/nx-rc:125 rc/nx-rc:134 rc/nx-rc:137
#: rc/nx-rc:140 rc/nx-rc:144 rc/nx-rc:209 rc/settings/alias-rc:13
#: rc/nx-rc:140 rc/nx-rc:144 rc/nx-rc:217 rc/settings/alias-rc:13
#: rc/settings/alias-rc:16 rc/settings/alias-rc:21 rc/settings/alias-rc:26
#: rc/settings/alias-rc:31 rc/settings/alias-rc:36 rc/settings/alias-rc:41
#: rc/settings/alias-rc:46 rc/settings/alias-rc:51 rc/settings/alias-rc:56
......@@ -128,7 +128,7 @@ msgstr "Ausfall-Prompt"
msgid "PS2 PS3 PS4"
msgstr "PS2 PS3 PS4"
#: rc/nx-rc:209
#: rc/nx-rc:217
msgid "Welcome Message"
msgstr "Willkommensgruß"
......@@ -288,10 +288,10 @@ msgid "Keybindings"
msgstr "Tastenkürzel"
#: rc/settings/ls-rc:12
msgid "LSCOLORS"
msgstr "LSCOLORS"
msgid "LS_COLORS"
msgstr "LS_COLORS"
#: rc/settings/ls-rc:80
#: rc/settings/ls-rc:72
msgid "LS_COLORS Setting: LS_COLORS"
msgstr "LS_COLORS Setze: LS_COLORS"
......
......@@ -17,7 +17,7 @@ export BSNG_DATA_DIR=@DATADIR@
export BSNG_RC_DIR=${BSNG_DATA_DIR}/bashstyle-ng/rc
export BSNG_VERSION=@VERSION@
export BSNG_YEAR="2007 - 2015"
INI_VERSION=17
INI_VERSION=18
source ${BSNG_RC_DIR}/internal/misc
source ${BSNG_RC_DIR}/internal/logging
......@@ -173,10 +173,38 @@ declare -f -t trap_add
# do trapping stuff
if [[ $(ini_get colorshell) && ${enable_colors} == True ]]; then
_colorshell () {
cmd_text_colour='\[`tput setaf $((RANDOM%7))`\]'
shopt -s promptvars
PS1="${PS1}${cmd_text_colour}"
PS2="${PS2}${cmd_text_colour}"
PS3="${PS3}${cmd_text_colour}"
PS4="${PS4}${cmd_text_colour}"
}
trap_add '_colorshell' DEBUG
if [[ $(ini_get colorshell_reset) == True ]]; then
_colorshell_reset () {
echo -ne "\e[0m"
}
trap_add '_colorshell_reset' DEBUG
fi
fi
if [[ $(ini_get history_sync) == True ]]; then
_synchistory () {
builtin history -a
builtin history -c
builtin history -r
}
trap_add '_synchistory' DEBUG
history () {
......
......@@ -9,7 +9,7 @@
# #
#########################################################
dbg_msg $"BashStyle-NG Setting:" $"LSCOLORS"
dbg_msg $"BashStyle-NG Setting:" $"LS_COLORS"
lblack="${style};30"
lred="${style};31"
......@@ -20,20 +20,20 @@ lmagenta="${style};35"
lcyan="${style};36"
lwhite="${style};37"
if [[ $TERM != *xterm* ]]; then
lcoldblue=$lblue
lsmoothblue=$lblue
liceblue=$lblue
lturqoise=$lcyan
lsmoothgreen=$lgreen
lwinered=$lred
lbrown=$lyellow
lsilver=$lwhite
locher=$lyellow
lorange=$lyellow
lpurple=$lmagenta
lpink=$lmagenta
lcream=$lmagenta
if [[ ${TERM} != *xterm* ]]; then
lcoldblue=${lblue}
lsmoothblue=${lblue}
liceblue=${lblue}
lturqoise=${lcyan}
lsmoothgreen=${lgreen}
lwinered=${lred}
lbrown=${lyellow}
lsilver=${lwhite}
locher=${lyellow}
lorange=${lyellow}
lpurple=${lmagenta}
lpink=${lmagenta}
lcream=${lmagenta}
else
lcoldblue="${style};38;5;33"
lsmoothblue="${style};38;5;111"
......@@ -50,31 +50,23 @@ else
lcream="${style};38;5;5344"
fi
export lblack lred lgreen lyellow lblue lmagenta lcyan lwhite lcoldblue lsmoothblue liceblue lturqoise lsmoothgreen lwinered lbrown lsilver locher lorange lpurple lpink lcream
export lblack lred lgreen lyellow lblue lmagenta lcyan lwhite lcoldblue \
lsmoothblue liceblue lturqoise lsmoothgreen lwinered lbrown lsilver \
locher lorange lpurple lpink lcream
eval _exec=$(ini_get exec)
eval _gen=$(ini_get generic)
eval _log=$(ini_get logs)
eval _deb=$(ini_get deb)
eval _rpm=$(ini_get rpm)
eval _dirs=$(ini_get dirs)
eval _jpg=$(ini_get jpeg)
eval _png=$(ini_get png)
eval _gif=$(ini_get gif)
eval _mp3=$(ini_get mp3)
eval _ogg=$(ini_get ogg)
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)
lscolors=(exec generic logs deb rpm dirs jpeg png gif mp3 ogg flac tar targz
tarbz2 tarxz zip rar link socket pipe blockdev chardev)
for lscolor in ${lscolors[@]}; do
eval _${lscolor}=$(ini_get ${lscolor})
done
_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:*.tar.xz=$_tarxz:*.zip=$_zip:*.rar=$_rar:\
$_custom"
dbg_log export LS_COLORS="*=${_generic}:ex=${_exec}:*.log=${_logs}:*.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}:*.tar.xz=${_tarxz}:*.zip=${_zip}:*.rar=${_rar}:ln=${_link}:\
so=${_socket}:pi=${_pipe}:bd=${_blockdev}:cd=${_chardev}:${_custom}"
dbg_msg $"LS_COLORS Setting: LS_COLORS" "$LS_COLORS"
dbg_msg $"LS_COLORS Setting: LS_COLORS" ${LS_COLORS}
......@@ -34,12 +34,6 @@ else
export TMOUT=$(ini_get timeout)
fi
_synchistory () {
builtin history -a
builtin history -c
builtin history -r
}
dbg_log export HISTSIZE=$(ini_get history_size)
dbg_msg $"BashStyle-NG Setting:" $"HISTSIZE" "$HISTSIZE"
......@@ -83,19 +77,3 @@ dbg_log export dirchar=$(ini_get directory_indicator)
dbg_log export GLOBIGNORE=$(ini_get globignore)
dbg_msg $"BashStyle-NG Setting:" $"GLOBIGNORE" "$GLOBIGNORE"
colorshell_revert=$(ini_get colorshell_revert)
_colorshell () {
cmd_text_colour='\[`tput setaf $((RANDOM%7))`\]'
shopt -s promptvars
PS1="${PS1}${cmd_text_colour}"
PS2="${PS2}${cmd_text_colour}"
PS3="${PS3}${cmd_text_colour}"
PS4="${PS4}${cmd_text_colour}"
[[ ${colorshell_revert} == True ]] && trap 'echo -ne "\e[0m"' DEBUG
}
This diff is collapsed.
......@@ -264,6 +264,11 @@ class BashStyleNG(object):
WidgetHandler.InitWidget("ls_tarbz2", "LSColors", "tarbz2", "combo", dicts.ls_colors)
WidgetHandler.InitWidget("ls_zip", "LSColors", "zip", "combo", dicts.ls_colors)
WidgetHandler.InitWidget("ls_rar", "LSColors", "rar", "combo", dicts.ls_colors)
WidgetHandler.InitWidget("ls_link", "LSColors", "link", "combo", dicts.ls_colors)
WidgetHandler.InitWidget("ls_socket", "LSColors", "socket", "combo", dicts.ls_colors)
WidgetHandler.InitWidget("ls_pipe", "LSColors", "pipe", "combo", dicts.ls_colors)
WidgetHandler.InitWidget("ls_blockdev", "LSColors", "blockdev", "combo", dicts.ls_colors)
WidgetHandler.InitWidget("ls_chardev", "LSColors", "chardev", "combo", dicts.ls_colors)
######################## Keybindings ###############################################
keytree = keybindings.KeyTree(config.cfo, config.udc, config.fdc)
......
......@@ -31,7 +31,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 = 17
app_ini_version = 18
class Config(object):
def InitConfig(self):
......
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