Tiny Core Linux
Tiny Core Base => TCB Bugs => Topic started by: Arslan S. on August 16, 2012, 10:31:45 PM
-
writeFLWMitem and writeWBARitem should take only first Name and Exec
this can easily be done with checking if variable is set in functions writeFLWMitem and writeWBARitem
--- wbar_update.sh.orig
+++ wbar_update.sh
@@ -6,13 +6,15 @@
busybox awk -v output="$TMP" -v target="$TARGET" -v wbaricons="$TCEWBAR" '
BEGIN {
FS = "="
+ name = ""
+ exec = ""
}
function rtrim(s) { sub(/[ \t]+$/, "", s); return s }
{
- if ( $1 == "Name") {
+ if ( $1 == "Name" && name == "") {
name = rtrim($2)
gsub(/ /, "", name)
- } else if ( $1 == "Exec" ) {
+ } else if ( $1 == "Exec" && exec == "") {
exec = $2
test = match(exec,"%")
if ( test ) exec = substr(exec,0,test-1)
--- flwm_topside_menu_common.orig
+++ flwm_topside_menu_common
@@ -6,12 +6,14 @@
busybox awk -v output="$TARGET" '
BEGIN {
FS = "="
+ name = ""
+ exec = ""
}
{
- if ( $1 == "Name") {
+ if ( $1 == "Name" && name == "") {
name = $2
gsub(/ /, "", name)
- } else if ( $1 == "Exec" ) {
+ } else if ( $1 == "Exec" && exec == "") {
exec = $2
test = match(exec,"%")
if ( test ) exec = substr(exec,0,test-1)
see also
http://forum.tinycorelinux.net/index.php/topic,13855.msg77500.html#new (http://forum.tinycorelinux.net/index.php/topic,13855.msg77500.html#new)
-
Arslan, Thanks for the patches. Will apply for 4.6 final.
-
hi roberts,
there is one more line in wbar_update.sh that needs to be changed
patch below makes awk exit immediately after first match with return code 0
@@ -70,7 +72,7 @@
FREEDESK=/usr/local/share/applications/"$APPNAME".desktop
if [ -e "$FREEDESK" ]; then
ICONCHECK="$(awk 'BEGIN{FS = "="}$1=="X-FullPathIcon"{print $2}' "$FREEDESK")"
- NAMECHECK="$(awk 'BEGIN{FS = "="}$1=="Name"{print $2}' "$FREEDESK")"
+ NAMECHECK="$(awk 'BEGIN{FS = "="}$1=="Name"{print $2; exit 0}' "$FREEDESK")"
if grep -qw "^t: *${NAMECHECK// /}$" "${TCEDIR}"/xwbar.lst 2>/dev/null; then exit 0; fi
TARGET="$APPNAME".img
[ -f "$ICONCHECK" ] && writeWBARitem "$FREEDESK" && [ -G /tmp/.X11-unix/X0 ] && wbar.sh
-
OK. Thanks again!
-
Now posted updated wbar and flwm* in repository.
-
Cool thanks, be nice to see if this fixes the issue where icons are labeled incorrectly..