Racy Puppy 5.2.2 Final, 18 Nov. 2011

Please post any bugs you have found
Message
Author
User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#421 Post by Karl Godt »

Second :
Karl Godt posted some more fixes to /etc/rc.d/rc.shutdown, regarding to killing of stray processes and zombies. Applied.
I got this from: http://www.murga-linux.com/puppy/viewtopic.php?t=73122

Woof commit:
http://bkhome.org/fossil/woof2.cgi/info/a94d3c19f4
.. .. rc.shutdown fixes

Actually i found the killzombies functions while trying to implement udf detection to removeable devices :

Puppy 528 can't read DVD data disk made by Windows

Neither Slacko nor Lucid will read DVD-RAM

Sorry for not posting diff patches , but i am running Puppy511 atm
and want to get PUK detection to USB modem SIM cards to work

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#422 Post by BarryK »

jemimah wrote:The synaptics driver needs SHMConfig for the flsynclient calibration to work. I've added it in both xorgwizard and xorgwizard-automatic.

Code: Select all

--- xorgwizard.orig	2012-01-26 14:29:42.000000000 +0800
+++ xorgwizard	2012-01-26 13:16:57.000000000 +0800
@@ -1423,6 +1423,7 @@
   NEW3='Section "InputDevice"\
 	Identifier "Synaptics Mouse"\
 	Driver "synaptics"\
+	Option "SHMConfig" "on"\
 EndSection\
 \
 Section "Monitor" #sectionmonitor0'

Code: Select all

--- xorgwizard-automatic.orig	2012-01-26 14:29:52.000000000 +0800
+++ xorgwizard-automatic	2012-01-26 13:15:55.000000000 +0800
@@ -216,6 +216,7 @@
   NEW3='Section "InputDevice"\
 	Identifier "Synaptics Mouse"\
 	Driver "synaptics"\
+	Option "SHMConfig" "on"\
 EndSection\
 \
 Section "Monitor"'
Thanks, done. I will announce on blog soon and upload Woof.
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#423 Post by BarryK »

Karl Godt wrote:
BarryK wrote:
Karl Godt wrote: Please consider these 2 :

rc.shutdown :

Code: Select all

M=`mount`
MTD=`echo $M | rev | sed 's§ )§\n)§g'|rev`
echo "$MTD"
This works for me to turn mount output upside down to unmount sfs,iso,partition ...

*

the killzombies: cut that occurs in rc.shutdown

also occurs in

pmount
drives_all
pup_event_frontend_d
karl,
maybe because I haven't yet had my morning cup of coffee, but I don't understand either of these suggestions. Would you mind fleshing them out a bit?
OK : first , for the mountpoints :

/etc/rc.d/rc.shutdown has got these lines to unmount ~ everything ~
>
MNTDPARTS="`mount`"

#echo
#echo $(gettext "Unmounting stray filesystems:")
echo "Unmounting stray filesystems:"

#091117 110928 if partition mounted, when choose shutdown, pc rebooted. found that param given to fuser must be mount-point, not /dev/*...
STRAYPARTL="`echo "$MNTDPARTS" | grep ' /mnt/' |grep -v -E '/dev/pts|/proc|/sys|tmpfs|rootfs|on / |/dev/root|usbfs|unionfs|aufs|/initrd'`"
STRAYPARTD="`echo "$STRAYPARTL" | cut -f 1 -d ' ' | tr '\n' ' '`"
#111106 do not execute fuser if network share mount (may hang, see http://murga-linux.com/puppy/viewtopic.php?t=73122)...
STRAYPARTandMNT="`echo "$STRAYPARTL" | cut -f 1,3 -d ' ' | tr ' ' '|' | tr '\n' ' '`"
for ONESTRAY in $STRAYPARTandMNT
do
FLAGCIFS="`echo -n ${ONESTRAY} | grep '^//'`"
ONESTRAYMNT="`echo -n ${ONESTRAY} | cut -f 2 -d '|'`"
#echo "`eval_gettext "Unmounting \\\${ONESTRAY}..."`"
echo "Unmounting $ONESTRAY..."
if [ "$FLAGCIFS" = "" ];then
xFUSER="`fuser -m $ONESTRAY 2>/dev/null`"
[ "$xFUSER" != "" ] && fuser -k -m $ONESTRAYMNT 2>/dev/null
fi
killzombies #v3.99
sync
umount -r $ONESTRAY
done
I have mounted many loopdevices to show the problem of nested/encapsulated/interlaced mounts :
/dev/sda11 on /mnt/sda11 type ext2 (rw,relatime,errors=continue)
/dev/loop0 on /mnt/+mnt+sda11+luci_218_2011_10_25.sfs type squashfs (ro,relatime)
/dev/loop1 on /mnt/+mnt++mnt+sda11+luci_218_2011_10_25.sfs+JUMP-7+lucisave-MAIN.3fs type ext3 (ro,relatime,errors=continue,barrier=0,data=ordered)
/dev/loop2 on /mnt/+mnt++mnt+sda11+luci_218_2011_10_25.sfs+JUMP-7+luci-218.sfs type squashfs (ro,relatime)
/dev/loop3 on /mnt/+mnt++mnt+sda11+luci_218_2011_10_25.sfs+JUMP-7+Gimp_2.7.3_218.sfs type squashfs (ro,relatime)
/dev/loop4 on /mnt/+mnt++mnt+sda11+luci_218_2011_10_25.sfs+JUMP-7+luci_devx_218.sfs type squashfs (ro,relatime)
/dev/loop5 on /mnt/+mnt++mnt+sda11+luci_218_2011_10_25.sfs+JUMP-7+ISO+luci-218.iso type iso9660 (ro,relatime)
/dev/sda10 on /mnt/sda10 type ext3 (rw,relatime,errors=continue,barrier=0,data=ordered)
/dev/loop6 on /mnt/+mnt+sda10+JUMP-10+slacko-5.3.1-SCSI-MAIN.iso type iso9660 (ro,relatime)
/dev/loop7 on /mnt/+mnt++mnt+sda10+JUMP-10+slacko-5.3.1-SCSI-MAIN.iso+puppy_slacko_5.3.1.sfs type squashfs (ro,relatime)
The problem is the

for ONESTRAY in $STRAYPARTandMNT

would read the list of mounted partitions/directories in the above order and try to unmount

/dev/sda10
before /dev/loop6 existing on /dev/sda10

which would fail because being in use by /dev/loop6

And would try to unmount /dev/loop6 before /dev/loop7 existing inside /dev/loop6

which would fail because being in use by /dev/loop7

Code: Select all

MNTDPARTS="`mount`"
MNTDPARTS=`echo $MNTDPARTS |rev|sed 's# )#\n)#g' |rev`
should revert to
/dev/sda9 on /mnt/sda9 type ext4 (rw,relatime,barrier=1,data=ordered)
/dev/loop7 on /mnt/+mnt++mnt+sda10+JUMP-10+slacko-5.3.1-SCSI-MAIN.iso+puppy_slacko_5.3.1.sfs type squashfs (ro,relatime)
/dev/loop6 on /mnt/+mnt+sda10+JUMP-10+slacko-5.3.1-SCSI-MAIN.iso type iso9660 (ro,relatime)
/dev/sda10 on /mnt/sda10 type ext3 (rw,relatime,errors=continue,barrier=0,data=ordered)
/dev/loop5 on /mnt/+mnt++mnt+sda11+luci_218_2011_10_25.sfs+JUMP-7+ISO+luci-218.iso type iso9660 (ro,relatime)
/dev/loop4 on /mnt/+mnt++mnt+sda11+luci_218_2011_10_25.sfs+JUMP-7+luci_devx_218.sfs type squashfs (ro,relatime)
/dev/loop3 on /mnt/+mnt++mnt+sda11+luci_218_2011_10_25.sfs+JUMP-7+Gimp_2.7.3_218.sfs type squashfs (ro,relatime)
/dev/loop2 on /mnt/+mnt++mnt+sda11+luci_218_2011_10_25.sfs+JUMP-7+luci-218.sfs type squashfs (ro,relatime)
/dev/loop1 on /mnt/+mnt++mnt+sda11+luci_218_2011_10_25.sfs+JUMP-7+lucisave-MAIN.3fs type ext3 (ro,relatime,errors=continue,barrier=0,data=ordered)
/dev/loop0 on /mnt/+mnt+sda11+luci_218_2011_10_25.sfs type squashfs (ro,relatime)
/dev/sda11 on /mnt/sda11 type ext2 (rw,relatime,errors=continue)

none on /proc/bus/usb type usbfs (rw,relatime)
none on /nodev/smackfs type smackfs (rw,relatime)
none on /nodev/mqueue type mqueue (rw,relatime)
none on /nodev/nfsd type nfsd (rw,relatime)
none on /nodev/hugetlbfs type hugetlbfs (rw,relatime)
none on /nodev/ramfs type ramfs (rw,relatime)
none on /nodev/rpc_pipefs type rpc_pipefs (rw,relatime)
none on /nodev/securityfs type securityfs (rw,relatime)
none on /nodev/debugfs type debugfs (rw,relatime)
none on /nodev/binfmt_misc type binfmt_misc (rw,relatime)
none on /nodev/cgroup type cgroup (rw,relatime,freezer,devices,memory,cpuacct,cpu,ns,debug,cpuset)
shmfs on /dev/shm type tmpfs (rw,relatime,size=217284k)
none on /sys type sysfs (rw,relatime)
none on /dev/pts type devpts (rw,relatime,gid=2,mode=620,ptmxmode=000)
none on /proc type proc (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=501124k,nr_inodes=125281,mode=755)
/dev/root on / type ext3 (rw,relatime,errors=continue,barrier=0,data=ordered)
rootfs on / type rootfs (rw)
[own kernel with # Device Drivers
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_DEBUG_DEVRES=y
CONFIG_MTD_BLKDEVS=m
# Self-contained MTD device drivers ]
Thanks for spelling it out. Applied, will upload Woof soon.
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#424 Post by BarryK »

Karl Godt wrote:Second :
Karl Godt posted some more fixes to /etc/rc.d/rc.shutdown, regarding to killing of stray processes and zombies. Applied.
I got this from: http://www.murga-linux.com/puppy/viewtopic.php?t=73122

Woof commit:
http://bkhome.org/fossil/woof2.cgi/info/a94d3c19f4
.. .. rc.shutdown fixes

Actually i found the killzombies functions while trying to implement udf detection to removeable devices :

Puppy 528 can't read DVD data disk made by Windows

Neither Slacko nor Lucid will read DVD-RAM

Sorry for not posting diff patches , but i am running Puppy511 atm
and want to get PUK detection to USB modem SIM cards to work
Thanks for more details. Well, diffs against latest rc.shutdown would help, as difficult to sift through your post. Anyway, I have applied your latest change to ZOMBIES= line. Will upload Woof very soon.
[url]https://bkhome.org/news/[/url]

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#425 Post by Karl Godt »

the killzombies: cut that occurs in rc.shutdown

also occurs in

pmount
drives_all
pup_event_frontend_d
zombie line of
/usr/sbin/pmount for example :
#v3.99 fix zombie process prevents partition unmount, invisible to fuser...
if [ $umVAL -ne 0 ];then
ZOMBIES="`ps -H -A | grep '<defunct>' | sed -e 's/ /|/g' | grep -v '|||' | cut -f 1 -d ' ' | tr '\n' ' '`"
for ONEZOMBIE in $ZOMBIES
do
echo "Killing parentless zombie process $ONEZOMBIE"
kill $ONEZOMBIE
done
umount $MNTPT ; umVAL=$?
fi
would need to be :

Code: Select all

ZOMBIES="`ps -H -A | grep '<defunct>' | sed 's/^[[:blank:]]*//;s/  /|/g' | grep -v '|||' | cut -f 1 -d ' ' | tr '\n' ' '`"
and also in
/usr/local/bin/drives_all
/sbin/pup_event_frontend_d

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#426 Post by BarryK »

Karl Godt wrote:
the killzombies: cut that occurs in rc.shutdown

also occurs in

pmount
drives_all
pup_event_frontend_d
zombie line of
/usr/sbin/pmount for example :
#v3.99 fix zombie process prevents partition unmount, invisible to fuser...
if [ $umVAL -ne 0 ];then
ZOMBIES="`ps -H -A | grep '<defunct>' | sed -e 's/ /|/g' | grep -v '|||' | cut -f 1 -d ' ' | tr '\n' ' '`"
for ONEZOMBIE in $ZOMBIES
do
echo "Killing parentless zombie process $ONEZOMBIE"
kill $ONEZOMBIE
done
umount $MNTPT ; umVAL=$?
fi
would need to be :

Code: Select all

ZOMBIES="`ps -H -A | grep '<defunct>' | sed 's/^[[:blank:]]*//;s/  /|/g' | grep -v '|||' | cut -f 1 -d ' ' | tr '\n' ' '`"
and also in
/usr/local/bin/drives_all
/sbin/pup_event_frontend_d
Thanks, committed to Woof, see blog:
http://bkhome.org/blog/?viewDetailed=02663
[url]https://bkhome.org/news/[/url]

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#427 Post by jemimah »

I've been trying to figure out why new2dir does not work with cmake and I've come up with this fix. I'm not sure if this will cause other problems or not. I'm attaching an example pkginstall.list that does not work.

Code: Select all

--- new2dir.orig	2012-02-01 20:39:28.759717585 +0800
+++ new2dir	2012-02-01 20:40:23.791713837 +0800
@@ -179,7 +179,7 @@
 # filter out $UPONE...
 # BUGPATTERN='&'"$UPONE"
 # no, just filter out /mnt and /initrd...
-cat /tmp/pkginstall.list | grep '#success$' | tr -s '\t' | tr '&' ' ' | tr '\t' '&' | grep '^[345]&open&' | grep --extended-regexp -v '&/dev/tty&|&/dev/null&|&/root/\.packages/|&/tmp/|&/root/\.icewm/|&/proc/|&/sys/|DotPupTmpDir|/\.myownmenuerc' | grep -E -v '&/initrd|&/mnt/' | cut -f 3 -d '&' > ${RELPATH}/${EXE_PKGNAME}.files
+cat /tmp/pkginstall.list | grep '#success$' | tr -s '\t' | tr '&' ' ' | tr '\t' '&' | egrep '^[345]&open&|^0&chmod&' | grep --extended-regexp -v '&/dev/tty&|&/dev/null&|&/root/\.packages/|&/tmp/|&/root/\.icewm/|&/proc/|&/sys/|DotPupTmpDir|/\.myownmenuerc' | grep -E -v '&/initrd|&/mnt/' | cut -f 3 -d '&' > ${RELPATH}/${EXE_PKGNAME}.files
 #...list will only have created files, not created directories, so an empty
 #   directory won't get recorded.
 
Attachments
pkginstall.list.gz
(1.51 KiB) Downloaded 484 times

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#428 Post by jemimah »

This patch applies Technosaurus' wget progressbar function to the download_file utility. It also replaces an rxvt window with an Xdialog tailbox.

Code: Select all

--- download_file.orig	2012-02-02 19:29:24.361557081 +0800
+++ download_file	2012-02-02 19:45:58.424489335 +0800
@@ -20,7 +20,7 @@
 while [ 1 ];do
  echo -n "" > /tmp/download_file_spider.log1
  #gtklogfileviewer "/tmp/download_file_spider.log" "Close" 0 0 600 200 "Testing remote file exists:" &
- rxvt -geometry 130x10+0+0 -bg orange -fg black -title "Testing file exists: ${URLSPEC}" -e tail -f /tmp/download_file_spider.log1 &
+ Xdialog --wmclass "gtkdialog2" --title "Testing file exists: ${URLSPEC}" --tailbox /tmp/download_file_spider.log1 30 100 &
  PID1=$!
  wget -4 -t 2 -T 20 --waitretry=20 --spider -S "${URLSPEC}" > /tmp/download_file_spider.log1 2>&1
  if [ $? -ne 0 ];then
@@ -165,7 +165,11 @@
  fi
 
  echo -n "" > /tmp/download_file_spider.log2
- rxvt -geometry 130x10+0+0 -bg orange -fg black -title "Downloading file: ${URLSPEC}" -e tail -f /tmp/download_file_spider.log2 &
+ tail -f /tmp/download_file_spider.log2 | while read LINE; do
+      case $LINE in
+         *%*)LINE=${LINE##*..};echo ${LINE%%%*};;
+      esac
+ done |Xdialog --gauge "Download progress..." 0 0&
  PID1=$!
  #-t 5 means retry 5 times, -w 5 means wait 5 seconds between retries...
  wget -4 ${CONTPARAM} -t 5 -w 5 "${URLSPEC}" > /tmp/download_file_spider.log2 2>&1

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

Description: 4 bugs in the XKB Configuration Manager

#429 Post by npierce »

The XKB Configuration Manager is a very handy utility for customizing your keyboard. It has served Puppy users well for a number of years. If a user doesn't ask a lot of it, it works quite fine. But if a user wants multiple layouts with variants, removes layouts after adding variants, or removes options, there may be problems.

I first noticed this the other day when I had trouble setting options.

There seems to be a small problem in /usr/local/apps/XkbConfigurationManager/XkbApplyNow.

This program sets options by calling setxkbmap. The problem results from the fact that when setxkbmap sets options, it does not overwrite the options as it does for model, layout, and variant. It adds to the existing options. So the effect is cumulative.

This means that, for instance, if the user chooses "NumLock LED shows alternative group", clicks OK, clicks Yes to activate new settings, then later chooses "CapsLock LED shows alternative group", clicks OK, and clicks Yes to activate new settings, both LEDs will light for the alternative group. Also, if the user selects the same item a second time, it will not be removed as the dialog box says it will.

When I started looking into this, it wasn't long before I ran into three more bugs.

Below is a description of all four bugs, including suggested fixes.

I am also attaching corrected versions of the scripts with my proposed fixes, and a diff -ur file, showing changes in all three scripts.

CAUTION: The tests described below will modify the keyboard section of your xorg.conf file. Make a backup. Some tests will temporarily change your keyboard layout. Anyone who is not comfortable working with keyboard layouts should probably not try these tests.

==========================================================

Bug #1

PROBLEM:

Adding a new layout with a variant fails if an existing layout has a variant.

FILE:

XkbVariantConfig

TO REPRODUCE:

1. Start with an xorg.conf that has only one layout listed in its "XkbLayout" line, and does not have an "XkbVariant" line. (This is true of a freshly-booted Racy-5.2.2 Live CD with no save file.)

2. Run the XKB Configuration Manager (xkbconfigmanager).

3. Choose Layout Variants and add a variant.

4. Choose Layouts and add another layout.

5. Choose Layout Variants and add a variant for the new layout.

6. Examine xorg.conf and see if the new variant is listed.

EXPECTED RESULTS:

Both variants should be listed in "XkbVariant" line.

ACTUAL RESULTS:

Only the first is listed.

CURRENT WORK-AROUND:

Add all your layouts first, before adding any variants.

If you later decide to add another layout with a variant, you will need to remove all exiting variants. Then you may add them all back, including the new one. (Alternatively, you can, of course, just edit xorg.conf.)

FIX:

XkbVariantConfig places the variant name into the appropriate field in the list of variants. The problem was that sometimes the appropriate field did not exist. If there was no list of variants, an empty list was created with the same number of fields as the layout list, and the new variant name was then placed in the appropriate field. That worked fine. But if a new layout was later added and the user attempted to add a variant for it, there were not enough fields in the existing list.

The fix was simply to count the fields on the layout list, and, if necessary, pad the variants list with enough fields to match.

==========================================================

Bug #2

PROBLEM:

If you are using two or more variants that have the same name, neither is listed under "You are currently using the following variants:" in the dialog window.

FILE:

XkbVariantConfig

TO REPRODUCE:

1. Start with an xorg.conf that has only the "us" layout listed in its "XkbLayout" line, and does not have an "XkbVariant" line. (This is true of a freshly-booted Racy-5.2.2 Live CD with no save file.)

2. Run the XKB Configuration Manager (xkbconfigmanager).

3. Choose Layouts and add the gb United Kingdom layout.

4. Choose Layout Variants and add the intl us:International (with dead keys) variant.

5. Choose Layout Variants and add the intl gb:International (with dead keys) variant.

6. Choose Layout Variants and note the list immediately under "You are currently using the following variants:".

EXPECTED RESULTS:

The list should contain the two variants just added.

ACTUAL RESULTS:

The list is empty white space.

CURRENT WORK-AROUND:

None. Everything else works OK. As always, you may remove either of the variants. It is just confusing that they are not listed.

FIX:

Since variant names are not unique (e.g., "us" and "gb" layouts both have a variant named "intl"), XkbVariantConfig has to determine the name of the layout that corresponds to each variant in order to uniquely identify it in the list of current variants reported to the user. So it determines which field of the list each variant name is in, then finds the layout name in the corresponding field of the layout list.

Previously this was done by breaking each field into a separate line, then using fgrep -n to set $POS, the field number. This worked fine as long as all current variants had different names, but trouble arrived when they did not. For instance, if there was an "intl" variant in the first field, and another "intl" variant in the third field, $POS would be set to "1 3" -- not a valid number.

The fix was to simply increment $POS within the loop that reads the names.

==========================================================

Bug #3

PROBLEM:

Removing a layout fails to adjust "XkbVariant" line in xorg.conf.

FILE:

XkbLayoutConfig

TO REPRODUCE:

1. Start with an xorg.conf that has only the "us" layout listed in its "XkbLayout" line, and does not have an "XkbVariant" line. (This is true of a freshly-booted Racy-5.2.2 Live CD with no save file.)

2. Run the XKB Configuration Manager (xkbconfigmanager).

3. Choose Layouts and add the be Belgium layout.

4. Choose Layout Variants and add the intl us:International (with dead keys) variant.

5. Choose Layouts and remove the us U.S. English layout.

6. Examine xorg.conf and see if the "XkbVariant" line has been adjusted.

EXPECTED RESULTS:

"intl" variant should have been removed from "XkbVariant" line.

ACTUAL RESULTS:

"XkbVariant" line still has variant for deleted layout. This line is no longer valid.

CURRENT WORK-AROUND:

Remove all variants before removing any layouts. After removing one or more layouts, you may add the variants again. (Alternatively, you can, of course, just edit xorg.conf.)

(If you have already removed a layout and left an orphan variant, you will probably need to restore the layout before you can remove the orphan. To do this, you must get the layout into the layout list at the same position that its orphan is in the variant list.)

FIX:

Previously, XLayoutConfig never touched the "XkbVariant" list in xorg.conf. To get it to to adjust that list was simply a matter of borrowing two blocks of code from XkbVariantConfig to read that list from xorg.conf and determine the positions of the layout being removed from the layout list, then go through the variant list and delete the corresponding fields, and then write the list back to xorg.conf.

(Note: if the layout list was created by this utility, there will only be one field to remove from each of the layout and variant lists, since this utility only allows one entry for any layout. But since X allows more than one entry, it is possible that someone may have hand-edited xorg.conf and set up for more than one entry (with different variants). Since this utility will remove both layouts, the new code will remove both variants.)

Note that it is not necessary to adjust the variant list when adding a layout, since layouts are only added to the end of the list.

==========================================================

Bug #4

PROBLEM:

Removing an option will sometimes fail to return keyboard to previous state.

FILE:

XkbApplyNow

TO REPRODUCE:

1. Start with an xorg.conf that does not have an "XkbOptions" line. (This is true of a freshly-booted Racy-5.2.2 Live CD with no save file.)

2. Run the XKB Configuration Manager (xkbconfigmanager).

3. Choose Options tab.

4. Choose Third level choosers then select the lv3:rwin_switch setting, and click OK.

5. Choose Control key position then select the ctrl:swapcaps setting, and click OK.

6. Click Yes to activate the new settings.

7. In a terminal window (e.g. rxvt), verify that CapsLock and the left Ctrl key have switched identities. This is good.

8. Choose Control key position then select the ctrl:swapcaps setting again, and press OK. (As explained in the instructions at the top of the dialog window, this should remove the setting.)

9. Click Yes to activate the new settings.

10. In a terminal window (e.g. rxvt), see if the CapsLock and the left Ctrl key have returned to their normal functions.

EXPECTED RESULTS:

CapsLock and the left Ctrl key should return to normal.

ACTUAL RESULTS:

CapsLock and the left Ctrl key are still swapped.

CURRENT WORK-AROUND:

Remove every option that you have set in any of the options dialogs, then click Yes to activate the new settings. (So, in this test case you would remove lv3:rwin_switch.) You may then add back any options that you want. (Alternatively, you can, of course, edit xorg.conf before clicking Yes.)

FIX:

XkbApplyNow uses the setxkbmap utility to set the keyboard configuration. When you pass a list of options to that utility with the -options option, it adds them to the existing list of options; it doesn't overwrite the existing list unless it is sent an empty list.

The fix was simply to clear the existing list by sending an empty list (-options "") before sending the list of desired options.

==========================================================

Also, while I was poking around in XkbVariantConfig, I figured that I may as well correct the window title from "Select XkbModel" to "Configure Xkb Variant".

The attached files are based on the versions that came with Racy-5.2.2, which are still current in the PET at the puppylinux/pet_packages-4/ repository.
Attachments
XkbVariantConfig.gz
Corrected XkbVariantConfig
(1.69 KiB) Downloaded 486 times
XkbLayoutConfig.gz
Corrected XkbLayoutConfig
(2.06 KiB) Downloaded 494 times
XkbApplyNow.gz
Corrected XkbApplyNow.
(564 Bytes) Downloaded 467 times
XkbConfigurationManager.diff.gz
diff -ur file for all three scripts
(2.45 KiB) Downloaded 516 times

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#430 Post by Karl Godt »

I would have a request :

To launch xwin
not by /etc/profile
but by /etc/inittab
like

[edit > busybox init syntax is different for /etc/inittab >
[strike-through]
xwin:3:once:/usr/bin/xwin
xwin=ui*NOTreallyUSED:3=runlevel:once=run only once:program=/usr/bin/xwin
[/strike-through]
keyboard controlling tty without /dev/ prefix:runlevel:action:process

Code: Select all

:3:once:/usr/bin/xwin 
or

Code: Select all

tty1:3:once:/usr/bin/xwin 
</edit]

Would be nice to test

It is mainly about
if /tmp/bootcnt.txt gets deleted
every time /etc/profile gets sourced (by $HOME/.bashrc) it would start xwin .

[edit > i am using '#!/bin/bash --login' as hashbang in /usr/bin/xwin to parse /etc/profile for the $PATH < /edit]
*

Older bug not often encountered :

Reminder for /usr/local/bin/pupzip :
Edit /usr/local/bin/pupzip at line 100:
Code:
RPM2CPIO="rpm2cpio2"

Remove last '2':
Code:
RPM2CPIO="rpm2cpio"
http://murga-linux.com/puppy/viewtopic. ... 360#451839
post is made by shinobar .

Thought i had seen it also once as a post from GuestToo , but can not find it today somehow .

willem1940NLD
Posts: 205
Joined: Wed 07 Jul 2010, 01:07
Location: Sittard, Limburg, The Netherlands

#431 Post by willem1940NLD »

Pidgin 2.7.5w5 works in racy 5.2.2 but the pidgin icon in tray bottom right in screen looks like a document with a red "X".

Tried an older version of Pidgin and the right icon popped in, but that pidgin did not work, could not be opened.

Re-installed pidgin 2.7.5w5 without uninstalling the old one; pidgin working alright but still with the dummy icon.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#432 Post by Karl Godt »

XkbApplyNow uses the setxkbmap utility to set the keyboard configuration. When you pass a list of options to that utility with the -options option, it adds them to the existing list of options; it doesn't overwrite the existing list unless it is sent an empty list.

The fix was simply to clear the existing list by sending an empty list (-options "") before sending the list of desired options.
the man page of setxkbmap says so :
-option name
Specifies the name of an option to determine the components
which make up the keyboard description; multiple options may
be specified, one per -option flag. Note that setxkbmap adds
options specified in the command line to the options that were
set before (as saved in root window properties). If you want to
replace all previously specified options, use the -option flag
with an empty argument first.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#433 Post by Karl Godt »

EXPECTED RESULTS:

"intl" variant should have been removed from "XkbVariant" line.
Don't know if it should have been removed

but to toggle
Option "XkbOptions" "lv3:ralt_switch,grp:rwin_toggle"

the keyboard layout
Option "XkbLayout" "de,us" #xkeymap0

does not work having two variants here
Option "XkbVariant" "deadgraveacute,alt-intl"

(Puppy 4.3.1) .

So maybe only one "XkbVariant" allowed though several "XkbLayout" can be toggled .

Feels like a ^ hidden bug ^ in Xorg / x11-xkb-utils .

Need to observe that further .

@npierce :

+++ new/XkbLayoutConfig

probably needs to be

Code: Select all

+        VARIANTS=`echo "$VARIANTS" | sed 's/^,//;s/,$//'`
If i issue

setxkbmap -rules xorg -model pc102 -layout us,de -variant ",alt-intl" -option grp:rwin_toggle,lv3:ralt_switch
in terminal
i get
Error loading new keyboard description


setxkbmap -rules xorg -model pc102 -layout us,de -variant "alt-intl" -option grp:rwin_toggle,lv3:ralt_switch
works ok .

willem1940NLD
Posts: 205
Joined: Wed 07 Jul 2010, 01:07
Location: Sittard, Limburg, The Netherlands

#434 Post by willem1940NLD »

Openoffice SFS I found in packet manager does not work!

Can I safely delete the relevant files?

Edit: apparently it is the same sfs as mentioned by Raffy months ago .... why is it still offered in SFS section of package manager?
raffy wrote:.......

ADDITIONAL: Racy can't use the old OpenOffice sfs4 that Barry uploaded with Puppy 4.31. It is working in other sfs4 puppies, so there must be a problem somewhere.
I deleted the useless SFS and successfully installed an old openoffice-3.2.0.9450.pet made by Coolpup.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#435 Post by Karl Godt »

OK , Super diffs by npierce .. THEY WORK !

Request of mine for xkbconfigmanager :

I wanted to have a xorg.conf like this :

Option "XkbLayout" "de,de,de,de" #xkeymap0
Option "XkbVariant" "deadacute,deadgraveacute,nodeadkeys,dvorak"

several layouts of one kind for several different layout variants :

Code: Select all

--- /Downloads/XkbLayoutConfig	2012-02-04 10:04:14.000000000 -0100
+++ /usr/local/apps/XkbConfigurationManager/XkbLayoutConfig	2012-02-04 20:31:15.000000000 -0100
@@ -2,9 +2,6 @@
 # A script to change the XkbLayout variable in xorg.conf
 # Part of the Puppy XkbConfigurator

-# Revision history - - -
-# 20120201 npierce: Removing a layout also adjusts the variant list.
-
 ##--------variables---------->>
 INFILE='/etc/X11/xorg.conf'
 OUTFILE='/etc/X11/xorg.conf.tmp2'
@@ -19,8 +16,11 @@ ORIGINAL=`fgrep '"XkbLayout"' $INFILE |

 # the full line containig XkbVariant, and the variants extracted from that line:   #20120201
 ORIGINALVARIANTS=`fgrep '"XkbVariant"' $INFILE | grep -v '^#'`
+echo ORIGINALVARIANTS=$ORIGINALVARIANTS
 CURRENTVARIANTS=`echo "$ORIGINALVARIANTS" | cut -d'"' -f4`
+echo CURRENTVARIANTS=$CURRENTVARIANTS
 VARIANTS="$CURRENTVARIANTS"
+echo VARIANTS=$VARIANTS

 #find current layouts:
 CURRENT=`echo "$ORIGINAL" | cut -d'"' -f4`
@@ -29,10 +29,12 @@ CURRENT=`echo "$ORIGINAL" | cut -d'"' -f
 # make list of existing layouts with their names:
 if [ ! "$CURRENT" = "" ]; then
 	EXIST=`echo "$CURRENT" | tr ',' '\n' | while read ONE;
-do fgrep " $ONE " $LIST | grep -v ':' ; done`
+do
+[ "$ONE" = "" ] && ONE='garage'
+fgrep " $ONE " $LIST | grep -v ':' ; done`
 ## could add head and tail for the fgrep, but this works ok.
 else
-	EXIST="NONE!"
+	EXIST='NONE!'
 fi
 #count how many layouts we already have:
 COUNT=`echo "$EXIST" | wc -l | tr -d ' '`
@@ -61,35 +63,52 @@ CHOICE=`Xdialog --stdout --title "Config
 $EXIST

 $MESSAGE" 0 0 15 us "U.S. English" ara "Arabic" al "Albania" am "Armenia" az "Azerbaijan" by "Belarus" be "Belgium" bd "Bangladesh" bt "Bhutan" ba "Bosnia and Herzegovina" br "Brazil" bg "Bulgaria" ca "Canada" hr "Croatia" cz "Czechia" dk "Denmark" ee "Estonia" fo "Faroe Islands" fi "Finland" fr "France" ge "Georgia" de "Germany" gr "Greece" hu "Hungary" is "Iceland" in "India" ir "Iran" ie "Ireland" il "Israel" it "Italy" jp "Japan" kg "Kyrgyzstan" la "Laos" latam "Latin American" lt "Lithuania" lv "Latvia" mao "Maori" mkd "Macedonian" mt "Malta" mm "Myanmar" mn "Mongolia" nl "Netherlands" no "Norway" pk "Pakistan" pl "Poland" pt "Portugal" qc "Quebec" ro "Romania" ru "Russia" srp "Serbian" si "Slovenia" sk "Slovakia" es "Spain" lk "Sri Lanka" se "Sweden" ch "Switzerland" sy "Syria" tj "Tajikistan" th "Thailand" tr "Turkish " ua "Ukraine" gb "United Kingdom" uz "Uzbekistan" vn "Vietnam"`
-[ ! $? -eq 0 ] && echo "cancelled" && exit
+[ ! $? -eq 0 ] && echo "cancelled" && exit

 # position of $CHOICE in layout list   #20120201
 ITSPOS=`echo "$CURRENT" | tr ',' '\n' | fgrep -n "$CHOICE" | cut -d: -f1`
+echo ITSPOS=$ITSPOS
+
+if echo "$CURRENT" | tr ',' '\n' | fgrep -wq $CHOICE ; then
+ if [ "$COUNT" -lt '4' ];then
+xmessage -buttons "ADD :140, REMOVE:141" "DO you want to add the already mentioned Layout
+to add another Layout Variant ,
+Or do you want to remove it from the Layout List ?"
+if [ "$?" != '140' ];then
+REMOVE='yes';else REMOVE='no';fi
+ else REMOVE='yes';fi #remove
+fi

-if echo "$CURRENT" | tr ',' '\n' | fgrep -wq $CHOICE ; then #remove
-	NEW=`echo -n $CURRENT | tr ',' '\n' | fgrep -wv $CHOICE | tr '\n' ',' | sed 's/^,//;s/,$//'`
+echo "REMOVE='$REMOVE'"
+echo "CHOICE='$CHOICE'"
+if [ "$REMOVE" = 'yes' ];then
+	NEW=`echo -n $CURRENT | sed "s#$CHOICE##" | sed 's/^,//;s/,$//' |tr -s ','`
 	[ "$NEW" = "" ] && NEW="$CURRENT"
 	[ -n "$VARIANTS" ] && for POS in $ITSPOS ; do VARIANTS=`echo "$VARIANTS" | tr ',' '\n' | sed "${POS}d" | tr '\n' ','` ; done   #20120201
-        VARIANTS=`echo "$VARIANTS" | sed 's/,$//'`
+        VARIANTS=`echo "$VARIANTS" | sed 's/^,//;s/,$//'`
 else #add
 	[ "$COUNT" = "4" ] && Xdialog --title "ERROR" --msgbox "Sorry! No more than 4 layouts are allowed..." 0 0 && exit
 	NEW="$CURRENT,$CHOICE"
 	[ $COUNT -eq 1 ] && [ $CHANGE -eq 0 ] && NEW="$CHOICE"
-	[ "$EXIST" = "NONE!" ] && NEW="$CHOICE"
+	[ "$EXIST" = 'NONE!' ] && NEW="$CHOICE"
 fi

 # add new layout to line:
 MODIFIED=`echo "$ORIGINAL" | sed "s%\"$CURRENT\"%\"$NEW\"%"`

+# add to file
+#cat $INFILE | sed "s%$ORIGINAL%$MODIFIED%" >$OUTFILE
 # adjust variants line:   #20120201
 MODIFIEDVARIANTS=`echo "$ORIGINALVARIANTS" | sed "s%\"$CURRENTVARIANTS\"%\"$VARIANTS\"%"`
+echo MODIFIEDVARIANTS=$MODIFIEDVARIANTS

 # add to file
 if [ -z "$MODIFIEDVARIANTS" ] ; then
         cat $INFILE | sed "s%$ORIGINAL%$MODIFIED%" > $OUTFILE
 else
         cat $INFILE | sed -e "s%$ORIGINAL%$MODIFIED%" -e "s%$ORIGINALVARIANTS%$MODIFIEDVARIANTS%" > $OUTFILE   #20120201
-fi
+fi
+
 if ! fgrep -q '"XkbModel"' $OUTFILE ; then
 	eval $ERRMSG
 	rm -f $OUTFILE
@@ -97,4 +116,4 @@ else
 	mv -f $OUTFILE $INFILE
 	eval $SUCCESS
 fi
-exit
\ No newline at end of file
+exit

Code: Select all

--- /Downloads/XkbVariantConfig	2012-02-04 10:04:03.000000000 -0100
+++ /usr/local/apps/XkbConfigurationManager/XkbVariantConfig	2012-02-04 20:42:24.000000000 -0100
@@ -2,11 +2,6 @@
 # A script to change the XkbVariant variable in xorg.conf
 # Part of the Puppy XkbConfigurator

-#Revision history - - -
-#20120201 npierce: Corrected calculation of $POS.
-#20120202 npierce: Pad $OLD to give it same number of fields as $LAYOUTS.
-#20120203 npierce: Corrected window title.
-
 ##--------variables---------->>
 INFILE='/etc/X11/xorg.conf'
 OUTFILE='/etc/X11/xorg.conf.tmp3'
@@ -19,22 +14,38 @@ LIST="/etc/X11/xkb/rules/xorg.lst"

 # the full lines containing XkbVariant and XkbLayout:
 ORIGINAL=`fgrep '"XkbVariant"' $INFILE | grep -v '^#'`
+echo "ORIGINAL='$ORIGINAL'"
 LAYOUTSLINE=`fgrep '"XkbLayout"' $INFILE | grep -v '^#'`
 [ "$ORIGINAL" = "" ] && NEWLINE="yes"
-
+echo NEWLINE=$NEWLINE
 #find current variants and layouts:
 CURRENT=`echo "$ORIGINAL" | cut -d'"' -f4`
 OLD="$CURRENT" #needed if line exists but nothing in it
 LAYOUTS=`echo "$LAYOUTSLINE" | cut -d'"' -f4`
+echo "CURRENT='$CURRENT'"
+echo "OLD='$OLD'"
+echo "LAYOUTS='$LAYOUTS'"

 # create list of variants available for our layouts:
+
+#[ "$AVAR" = "" ] && continue
+#POS=`echo "$CURRENT" | tr ',' '\n' | fgrep -n -w -"$AVAR" | cut -d: -f1`
+#MYLAY=`echo "$LAYOUTS" | cut -d',' -f$POS 2>/dev/null`
+
 if [ ! `echo "$CURRENT" | tr -d ','` = "" ]; then
 	EXIST=$(echo "$CURRENT" | tr ',' '\n' | while read AVAR ;do
-POS=$(( $POS + 1 ))   #20120201
-[ "$AVAR" = "" ] && continue
-MYLAY=`echo "$LAYOUTS" | cut -d',' -f$POS`
+	POS=$(( $POS + 1 ))   #20120201
+if [ "$AVAR" = "" ];then
+AVAR=' not set yet';echo "$AVAR";continue;fi
+MYLAY=`echo "$LAYOUTS" | cut -d',' -f $POS 2>/dev/null`
+[ ! "$MYLAY" ] && MYLAY=$OLDMYLAY
+OLDMYLAY=$MYLAY
 fgrep " $AVAR " $LIST | fgrep -w "$MYLAY:"
 done)
+echo POS=$POS
+echo AVAR=$AVAR
+echo MYLAY=$MAYLAY
+
 	MESSAGE="You are currently using the following variants:
 "$EXIST"

@@ -49,9 +60,13 @@ else
 fi

 # Pad $OLD to give it same number of fields as $LAYOUTS.   #20120202
-LAYOUTCOUNT=`echo "$LAYOUTS" | tr ',' '\n' | wc -l #grep -c ".*"`
-VARIANTCOUNT=`echo "$OLD" | tr ',' '\n' | grep -c ".*"`
+LAYOUTCOUNT=`echo "$LAYOUTS" | tr ',' '\n' | wc -l`
+echo LAYOUTCOUNT=$LAYOUTCOUNT
+echo "OLD='$OLD'"
+VARIANTCOUNT=`echo "$OLD" | tr ',' '\n' | wc -l`
+echo VARIANTCOUNT=$VARIANTCOUNT
 DIFFERENCE=$(( $LAYOUTCOUNT - $VARIANTCOUNT ))
+echo DIFFERENCE=$DIFFERENCE
 while test "$DIFFERENCE" -gt "0" ; do
 	OLD="${OLD},"
 	DIFFERENCE=$(( $DIFFERENCE - 1 ))
@@ -66,6 +81,7 @@ do fgrep " $ALAY:" $LIST | tr -s ' ' ; d
 	echo "\"$INDEX: $TAG\" \""$INFO"\""; INDEX=`expr $INDEX + 1` ; done > $TMPLIST

 # create dialog with all options (in temp file)
+#Xdialog --left --stdout --title "Select XkbModel" --menubox "' >$TMPDIALOG
 echo -n '#!/bin/sh
 Xdialog --left --stdout --title "Configure Xkb Variant" --menubox "' >$TMPDIALOG   #20120203
 echo -n "$MESSAGE\" 0 0 15 " >>$TMPDIALOG
@@ -75,19 +91,31 @@ chmod 755 $TMPDIALOG
 # run dialog and get choice
 CHOICE=`eval $TMPDIALOG`
 [ "$CHOICE" = "" ] && echo "cancelled" && exit
-echo "$CHOICE"
+echo "CHOICE='$CHOICE'"

 # find the variant chosen and its position
-NEWVAR=`fgrep "$CHOICE" $TMPLIST | cut -d'"' -f2 | cut -d' ' -f2`
-ITSLAY=`fgrep "$CHOICE" $TMPLIST | cut -d'"' -f4 | cut -d: -f1`
+NEWVAR=`fgrep -w "$CHOICE" $TMPLIST | cut -d'"' -f2 | cut -d' ' -f2`
+ITSLAY=`fgrep -w -m1 "$CHOICE" $TMPLIST | cut -d'"' -f4 | cut -d: -f1`
 ITSPOS=`echo "$LAYOUTS" | tr ',' '\n' | fgrep -n "$ITSLAY" | cut -d: -f1`
+for n in $ITSPOS;do
+if [ "`echo "$OLD" | cut -f $n -d,`" = "" ];then
+ITSPOS=$n;break;fi;done
+ITSPOS=`echo "$ITSPOS" |head -n1`
+if [ "`echo "$OLD" | fgrep -w "$NEWVAR"`" ];then
+ITSPOS=`echo "$OLD" | tr ',' '\n' | fgrep -n -w -m1 "$NEWVAR" |cut -f 1 -d:`
+fi

+echo "NEWVAR='$NEWVAR'"
+echo "ITSLAY='$ITSLAY'"
+echo "ITSPOS='$ITSPOS'"

+echo "OLD='$OLD'"
 #the last sed is since we need to cut off the last , (echo -n doesn't work well)
-NEW=`echo "$OLD" | tr ',' '\n' | sed "${ITSPOS}s/.*/$NEWVAR/" | tr '\n' ',' | sed 's/,$//'`
-
+NEW=`echo "$OLD" | tr ',' '\n' | sed "${ITSPOS} s/.*/$NEWVAR/" | tr '\n' ',' | sed 's/,$//'`
+echo "NEW='$NEW'"
 # if old is same as new: remove
-[ "$NEW" = "$OLD" ] && NEW=`echo "$OLD" | tr ',' '\n' | sed "${ITSPOS}s/.*//" | tr '\n' ',' | sed 's/,$//'`
+[ "$NEW" = "$OLD" ] && NEW=`echo "$OLD" | tr ',' '\n' | sed "${ITSPOS} s/.*//" | tr '\n' ',' | sed 's/,$//'`
+echo "NEW='$NEW'"

 # add new variant to line, or entire line, if it doesn't exist:
 if [ "$NEWLINE" = "yes" ] ;then
@@ -107,4 +135,4 @@ else
 	mv -f $OUTFILE $INFILE
 	eval $SUCCESS
 fi
-exit
\ No newline at end of file
+exit
NOTE : DON'T use these diffs as they are
because
A) XkbLayoutConfig uses xmessage for asking about removing or adding an already noted layout

B) They would delete the header notes of npierce !

C) They are not tested much !

The diffs are made against npierce attached files .

npierce's diffs should merge to woof as they are ! But i would provide these two usability patches thereafter .

Thank you npierce for detecting and fixing these little boogies !
Also to Dougal , xkbconfigmanager i used a lot !

(also because of xorg.conf being created new too many times , but i added
setxkbmap -rules xorg -model pc102 -layout us,de -variant "" -option grp:rwin_toggle,lv3:ralt_switch
to .xinitrc ANDOR delayedrun to restore the keyboard configurations if this happens)

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#436 Post by jemimah »

willem1940NLD wrote:Pidgin 2.7.5w5 works in racy 5.2.2 but the pidgin icon in tray bottom right in screen looks like a document with a red "X".

Tried an older version of Pidgin and the right icon popped in, but that pidgin did not work, could not be opened.

Re-installed pidgin 2.7.5w5 without uninstalling the old one; pidgin working alright but still with the dummy icon.
Pidgin needs to be compiled with --enable-trayicon-compat or you will have this problem.

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#437 Post by npierce »

Hi Karl,

Thanks for looking at my code.
Karl Godt wrote:If i issue

setxkbmap -rules xorg -model pc102 -layout us,de -variant ",alt-intl" -option grp:rwin_toggle,lv3:ralt_switch
in terminal
i get
Error loading new keyboard description
The order of the variant list is important. It needs to be in the same order as the layout list. The initial comma in ",alt-intl" indicates that the first field is empty. So no variant is assigned to the first layout. The second variant is assigned to the second layout.

So setxkbmap tries to assign the alt-intl variant to the de layout. But there is no such variant defined for the de layout, so you get an error message.
Karl Godt wrote:setxkbmap -rules xorg -model pc102 -layout us,de -variant "alt-intl" -option grp:rwin_toggle,lv3:ralt_switch
works ok .
Yes. Now setxkbmap tries to assign the alt-intl variant to the us layout, which is a valid combination, so it succeeds.

Using -layout de,us -variant ",alt-intl" is also legal.


Karl Godt wrote:+++ new/XkbLayoutConfig

probably needs to be

Code: Select all

+        VARIANTS=`echo "$VARIANTS" | sed 's/^,//;s/,$//'`
The purpose of that line is only to remove a trailing comma that gets added as a result of the echo command in the previous line. This code is adapted from a line in XkbVariantConfig. In theory, I could have eliminated the need for this line by using echo -n instead of echo, but the original author left a warning in the code:
#the last sed is since we need to cut off the last , (echo -n doesn't work well)
So I decided to heed that warning.

Anyway, no extra comma is added at the start of the list, so there is no need for the s/^,// here.


Karl Godt wrote:
EXPECTED RESULTS:

"intl" variant should have been removed from "XkbVariant" line.

Don't know if it should have been removed
The steps listed for reproducing bug #3, using the original XkbLayoutConfig results in these lines being placed in xorg.conf:

Code: Select all

	Option      "XkbLayout" "be" #xkeymap0
	Option      "XkbVariant" "intl,"
The intl variant was assigned to the us layout, but the us layout has been removed, so its variant should be removed as well. When XkbApplyNow passes those two lists to setxkbmap, that utility will be unhappy with the trailing comma because this makes the variant list have two fields while the layout list has only one field. No variant will be loaded.

Even if setxkbmap wasn't unhappy with that comma, it would be unhappy with trying to assign a variant named "intl" to the layout named "be", because there is no "intl" variant for the "be" layout.


Karl Godt wrote:but to toggle
Option "XkbOptions" "lv3:ralt_switch,grp:rwin_toggle"

the keyboard layout
Option "XkbLayout" "de,us" #xkeymap0

does not work having two variants here
Option "XkbVariant" "deadgraveacute,alt-intl"
Oh, that's interesting.

I haven't been able to test with grp:rwin_toggle, since I don't have a right Windows key on my laptop, but when I test with grp:lwin_toggle I do have trouble.

For me it loads the German layout OK, and pressing the left Windows key does, in fact, switch to the US layout. But it will not switch back again if I press the key again. Is that the same symptom that you had?

Anyway, the symptom I see doesn't seem to be related to the variants. It acts the same if I don't load any variants at all.

The funny thing is that it is happy if I reverse the order of the layouts and variants, like so:

Code: Select all

        Option      "XkbLayout" "us,de" #xkeymap0             
        Option      "XkbVariant" "alt-intl,deadgraveacute"         
        Option          "XkbOptions"   "lv3:ralt_switch,grp:lwin_toggle"
Also, setting the left Ctrl+Shift keys for toggling the group works with the original order:

Code: Select all

        Option      "XkbLayout" "de,us" #xkeymap0             
        Option      "XkbVariant" "deadgraveacute,alt-intl"    
        Option          "XkbOptions"   "lv3:ralt_switch,grp:ctrl_shift_toggle"
And using the left Windows key as a temporary switch, not a toggle, also responds properly:

Code: Select all

	Option      "XkbLayout" "de,us" #xkeymap0
	Option      "XkbVariant" "deadgraveacute,alt-intl"
	Option 		"XkbOptions"   "lv3:ralt_switch,grp:lwin_switch"
(Rember to switch your keyboard group back to the first layout before removing a group toggle. If you don't you will be stuck in another layout until you add a new group toggle.)

Things are a bit flaky. When I first tried grp:lwin_switch, it worked fine. When I tried later it didn't work until I tried grp:win_switch. Then grp:lwin_switch worked again. And grp:lwin_toggle no longer lets me toggle even once, as it did when I first tried it.

Anyway, you have clearly found a bug (assuming I am seeing the same symptom as you). Since I am able to reproduce it by using setxkbmap without involving the XKB Configuration Manager, it would seem that the bug is not in the XKB Configuration Manager, but further downstream (possibly in xkbcomp, the keyboard definition files, or the X server itself).

Thanks again for taking the time for looking at this.

P.S. Karl, I just saw a new reply from you come in. Thanks for testing. Glad the diffs worked for you. I'll read your new message over and get back to you later.

willem1940NLD
Posts: 205
Joined: Wed 07 Jul 2010, 01:07
Location: Sittard, Limburg, The Netherlands

#438 Post by willem1940NLD »

jemimah wrote:
willem1940NLD wrote:Pidgin 2.7.5w5 works in racy 5.2.2 but the pidgin icon in tray bottom right in screen looks like a document with a red "X".

Tried an older version of Pidgin and the right icon popped in, but that pidgin did not work, could not be opened.

Re-installed pidgin 2.7.5w5 without uninstalling the old one; pidgin working alright but still with the dummy icon.
Pidgin needs to be compiled with --enable-trayicon-compat or you will have this problem.
Great consolation to a non-technical user.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#439 Post by Karl Godt »

Things are a bit flaky. When I first tried grp:lwin_switch, it worked fine. When I tried later it didn't work until I tried grp:win_switch. Then grp:lwin_switch worked again. And grp:lwin_toggle no longer lets me toggle even once, as it did when I first tried it.
npierce,

that's true !

setxkbmap worked setting it for geany once but not typing into sakura terminal emulator .

Then i changed a lot and next time it worked perfectly .

Most of the times it worked ok as i can remember .

As a side note : Maybe xkbconfigmanager coded with arrays
instead of many ^ echo "$LIST" | grep "$WHATEVER" ^
would work also .

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#440 Post by Karl Godt »

That's my XkbVariantConfig of today :

Detected there was a fault in my previous diff in case several country layouts with same layoutvariant name like 'nodeadkeys' .

I added two more tags to the TMPLIST=/tmp/XkbVariantList
+ echo "\"${SINDEX}: $ALAY ${INDEX}: $TAG\" \""$INFO"\""
which would stand for SuperINDEX and ALAYOUT .

Code: Select all

--- /Downloads/XkbVariantConfig	2012-02-04 10:04:03.000000000 -0100
+++ /usr/local/apps/XkbConfigurationManager/XkbVariantConfig	2012-02-05 14:52:40.000000000 -0100
@@ -6,6 +6,8 @@
 #20120201 npierce: Corrected calculation of $POS.
 #20120202 npierce: Pad $OLD to give it same number of fields as $LAYOUTS.
 #20120203 npierce: Corrected window title.
+#20120205 Karl Reimer Godt : added possibility to use one variantname like nodeadkeys for several country layouts .
+#20120205 Karl Reimer Godt : changed the original code by Dougal to create lists to be easier to debug .
 
 ##--------variables---------->>
 INFILE='/etc/X11/xorg.conf'
@@ -21,49 +23,62 @@ LIST="/etc/X11/xkb/rules/xorg.lst"
 ORIGINAL=`fgrep '"XkbVariant"' $INFILE | grep -v '^#'`
 LAYOUTSLINE=`fgrep '"XkbLayout"' $INFILE | grep -v '^#'`
 [ "$ORIGINAL" = "" ] && NEWLINE="yes"
-
 #find current variants and layouts:
 CURRENT=`echo "$ORIGINAL" | cut -d'"' -f4`
 OLD="$CURRENT" #needed if line exists but nothing in it
 LAYOUTS=`echo "$LAYOUTSLINE" | cut -d'"' -f4`
 
 # create list of variants available for our layouts:
-if [ ! `echo "$CURRENT" | tr -d ','` = "" ]; then
-	EXIST=$(echo "$CURRENT" | tr ',' '\n' | while read AVAR ;do
+POS=0
+VARLIST=`echo "$CURRENT" |tr ',' '\n' | sed 's/^$/NONE/'`
+for AVAR in $VARLIST;do
 POS=$(( $POS + 1 ))   #20120201
-[ "$AVAR" = "" ] && continue
-MYLAY=`echo "$LAYOUTS" | cut -d',' -f$POS`
-fgrep " $AVAR " $LIST | fgrep -w "$MYLAY:"
-done)
-	MESSAGE="You are currently using the following variants:
-"$EXIST"
+if [ "$AVAR" = "" ];then
+AVAR=' (not set yet)'
+elif [ "$AVAR" = 'NONE' ];then
+AVAR=' (not set yet)'
+fi
+MYLAY=`echo "$LAYOUTS" | cut -d',' -f $POS 2>/dev/null`
+[ ! "$MYLAY" ] && MYLAY='ERROR'
+DESCRIPTION=`grep " $AVAR " $LIST | grep -w "${MYLAY}:" |cut -f2 -d:`
+[ ! "$DESCRIPTION" ] && DESCRIPTION=' (none)'
+EXIST="$EXIST
+$POS $MYLAY $AVAR : $DESCRIPTION"
+done
+
+MESSAGE="You are currently using the following variants:
+$EXIST
 
 To remove a variant, select it in the list below and press OK.
 To add a new one, select it and press OK.
 
 NOTE: if you select a variant for a layout that already has one,
  the new one will replace the old."
-else
-	OLD=`echo "$LAYOUTS" | tr -d 'a-zA-Z_/'`
-	MESSAGE='Please select the variant you would like to add, then press OK.'
-fi
 
 # Pad $OLD to give it same number of fields as $LAYOUTS.   #20120202
-LAYOUTCOUNT=`echo "$LAYOUTS" | tr ',' '\n' | wc -l #grep -c ".*"`
-VARIANTCOUNT=`echo "$OLD" | tr ',' '\n' | grep -c ".*"`
+LAYOUTCOUNT=`echo "$LAYOUTS" | tr ',' '\n' | wc -l`
+VARIANTCOUNT=`echo "$OLD" | tr ',' '\n' | wc -l`
 DIFFERENCE=$(( $LAYOUTCOUNT - $VARIANTCOUNT ))
+
 while test "$DIFFERENCE" -gt "0" ; do
 	OLD="${OLD},"
 	DIFFERENCE=$(( $DIFFERENCE - 1 ))
 done
 
 # create list of available variants:
-INDEX=1
+rm $TMPLIST
+INDEX=1;SINDEX=0
 echo "$LAYOUTS" | tr ',' '\n' | while read ALAY;
-do fgrep " $ALAY:" $LIST | tr -s ' ' ; done | while read AVAR ; do
+do
+SINDEX=`expr $SINDEX + 1`
+fgrep " $ALAY:" $LIST | tr -s ' ' | while read AVAR
+do
 	TAG=`echo "$AVAR" |cut -d' ' -f1`
 	INFO=`echo "$AVAR" |cut -d' ' -f2-`
-	echo "\"$INDEX: $TAG\" \""$INFO"\""; INDEX=`expr $INDEX + 1` ; done > $TMPLIST
+	echo "\"${SINDEX}: $ALAY ${INDEX}: $TAG\" \""$INFO"\""
+	INDEX=`expr $INDEX + 1`
+done >> $TMPLIST
+done
 
 # create dialog with all options (in temp file)
 echo -n '#!/bin/sh
@@ -75,19 +90,22 @@ chmod 755 $TMPDIALOG
 # run dialog and get choice
 CHOICE=`eval $TMPDIALOG`
 [ "$CHOICE" = "" ] && echo "cancelled" && exit
-echo "$CHOICE"
+echo "CHOICE='$CHOICE'"
 
 # find the variant chosen and its position
-NEWVAR=`fgrep "$CHOICE" $TMPLIST | cut -d'"' -f2 | cut -d' ' -f2`
-ITSLAY=`fgrep "$CHOICE" $TMPLIST | cut -d'"' -f4 | cut -d: -f1`
-ITSPOS=`echo "$LAYOUTS" | tr ',' '\n' | fgrep -n "$ITSLAY" | cut -d: -f1`
-
+#KARL REIMER GODT :commented the lines by npierce ,
+#using more tags for this SINDEX and ALAY
+#NEWVAR=`fgrep -w "$CHOICE" $TMPLIST | cut -d'"' -f2 | cut -d' ' -f2`
+NEWVAR=`echo "$CHOICE" |awk '{print $4}'`
+#ITSLAY=`fgrep -w -m1 "$CHOICE" $TMPLIST | cut -d'"' -f4 | cut -d: -f1`
+ITSLAY=`echo "$CHOICE" |awk '{print $2}'`
+#ITSPOS=`echo "$LAYOUTS" | tr ',' '\n' | fgrep -n "$ITSLAY" | cut -d: -f1`
+ITSPOS=`echo "$CHOICE" |awk '{print $1}'| tr -d ':'`
 
 #the last sed is since we need to cut off the last , (echo -n doesn't work well)
-NEW=`echo "$OLD" | tr ',' '\n' | sed "${ITSPOS}s/.*/$NEWVAR/" | tr '\n' ',' | sed 's/,$//'`
-
+NEW=`echo "$OLD" | tr ',' '\n' | sed "${ITSPOS} s/.*/$NEWVAR/" | tr '\n' ',' | sed 's/,$//'`
 # if old is same as new: remove
-[ "$NEW" = "$OLD" ] && NEW=`echo "$OLD" | tr ',' '\n' | sed "${ITSPOS}s/.*//" | tr '\n' ',' | sed 's/,$//'`
+[ "$NEW" = "$OLD" ] && NEW=`echo "$OLD" | tr ',' '\n' | sed "${ITSPOS} s/.*//" | tr '\n' ',' | sed 's/,$//'`
 
 # add new variant to line, or entire line, if it doesn't exist:
 if [ "$NEWLINE" = "yes" ] ;then
@@ -107,4 +125,4 @@ else
 	mv -f $OUTFILE $INFILE
 	eval $SUCCESS
 fi
-exit
\ No newline at end of file
+exit
Attachments
XkbVariantGUI.png
some may like it some may think it is too much information :-P
(42.32 KiB) Downloaded 1049 times

Post Reply