Announcement

Collapse
No announcement yet.

.XCompose file not working as expected? What's wrong with my config?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    .XCompose file not working as expected? What's wrong with my config?

    Hi there -- I want to enter an arbitrary unicode string with the compose key (I have mine as shift-lock), but apparently Kubuntu can not do this.

    Since I only need this for two symbols (this and this), I am using ~/.XCompose as:

    Code:
    include "%L"
    <Multi_key> <numbersign> <bracketleft> : "\0x1D106" # measure repeat symbol start
    <Multi_key> <numbersign> <bracketright> : "\0x1D107" # measure repeat symbol end
    ...but it's not working. If I do this just for testing:

    Code:
    include "%L"
    <Multi_key> <numbersign> <bracketleft> : "p"
    <Multi_key> <numbersign> <bracketright> : "q"
    ...it works as expected. So there is apparently something wrong with my hex specification of the key code to be sent. The man file for xcompose says "Strings may be direct text encoded in the locale for which the compose file is to be used, or an escaped octal or hexadecimal character code. Octal codes are specified as "\123" and hexadecimal codes as "\0x123a"." I tried with the octal equivalent as well and it did not work.

    I can copy and past the symbols into the apps I want to do this with, and that works fine. Those code pages linked above show the hex codes (1D106 and 1D107) but lots of other varieties of codes as well... maybe I should be using one of those?

    Thanks for any tips.
    Last edited by chconnor; Jan 18, 2020, 07:12 PM.

    #2
    Just a quick thought. Since you can copy/paste the chars, why don't you copy/paste them to your .XCompose (also makes your config a bit more readable)?
    Code:
    <Multi_key> <numbersign> <bracketleft> : "��" # measure repeat symbol start
    <Multi_key> <numbersign> <bracketright> : "��" # measure repeat symbol end
    EDIT: The chars don't seem to appear correctly here after posting (could be the forum software), but tested it on my xcompose and works, just replace the �� and �� with the actual chars.
    Last edited by kubicle; Jan 12, 2020, 01:03 AM.

    Comment


      #3
      Test: 𝄆 𝄇
      (they look correct to me)...

      Comment


        #4
        Testing again �� ��

        EDIT: Hmm, maybe it's the code tags
        Code:
        �� ��
        EDIT2: Nope, go figure

        EDIT3: And now they are gone again, seems to glitch after editing a post with code tags
        Last edited by kubicle; Jan 12, 2020, 01:44 AM.

        Comment


          #5
          Works well after first post anyway 𝄆 𝄇

          Comment


            #6
            Wha... didn't realize you could do that. :-) Thanks, it works now!

            I still wonder what was wrong with the other approach, but I've learned not to look too hard in to Unicode if I value my sanity. .:-)

            Comment


              #7
              Hrm, so, what does anyone make of this: given the above .XCompose as described, if I open libreoffice writer I can type the combination and it spits out a 𝄇 just as expected.

              If I open GIMP and make a text item, it does not work. If I then copy the 𝄇 from libreoffice and paste in to the GIMP field, it works...

              I thought it might be a font thing... e.g. libreoffice is defaulting to a font that has that character and I'm pasting that metadata into the GIMP text box along with the character... but that doesn't seem to be the case as the GIMP fonts have the character present (e.g. I can select and change the font around, etc, and the character remains, though styled differently, etc.)

              Does this sound like a GIMP bug, then?

              Comment


                #8
                Originally posted by chconnor View Post
                Does this sound like a GIMP bug, then?
                Could be. What input method is gimp using (and does changing it get better results...I'd suggest trying "X input method" first if it is not already in use). You can see/select the input method by right-clicking on the text field in gimp and selecting "Input Methods".

                Comment


                  #9
                  Thanks -- for Input Methods I see "System (Simple)" and "None". They both have the same result. I looked around in KDE settings and through the keyboard config stuff and didn't find anything applicable (well a few things that sounded good but didn't change the behavior?)

                  (I should maybe add that I'm using an AppImage of GIMP.)
                  Last edited by Snowhog; Jan 13, 2020, 06:28 PM.

                  Comment


                    #10
                    Originally posted by chconnor
                    (I should maybe add that I'm using an AppImage of GIMP.)
                    Don't know if that explains the issue, but it could explain why there are no other input methods (like xim) available...and makes this a bit trickier to troubleshoot.

                    You could try exporting GTK_IM_MODULE into your environment, ~/.profile should do, just add
                    Code:
                    export GTK_IM_MODULE=xim
                    in your ~/.profile, logout and then log back in and start your gimp to see if the "system" method has changed to Xim.

                    for a quick test, you could run simply run:
                    export GTK_IM_MODULE=xim; /path/to/the/gimp.appimage
                    (but I'm not sure how appimages handle that )

                    Comment


                      #11
                      Thanks -- neither method changed the available input methods. I wonder if AppImages have their own contained environment? I did some quick googling and didn't come up with a way to pass that stuff in...

                      I also tried

                      env GTK_IM_MODULE=xim gimp_AppImage

                      Comment


                        #12
                        In my gimp, 2.10.8, if I right-click in a text box, the pop-up menu has "Input methods >" at the bottom. When I choose this, I get a bunch of choices:

                        Click image for larger version

Name:	xim.png
Views:	1
Size:	19.6 KB
ID:	644498

                        If I use the last one, the .XCompose key sequences work.

                        I found this testing a work-around using KDE menu items to put 𝄆 and 𝄇 into the X selection, so that I could paste them in Gimp. With a menu item one can add it to the panel, or set a short-cut key. Gimp uses middle-click for something, but one can right-click and choose Paste, or press ctrl-V. If you want to try that, use the KDE Menu Editor by right-clicking the K menu and choosing "Edit Applications". Then for the command I used
                        Code:
                        bash -c "echo -n $'\U1d106' | xsel -i"
                        Regards, John Little

                        Comment


                          #13
                          Thanks very much, John, good tips!

                          Comment


                            #14
                            Originally posted by chconnor View Post
                            I wonder if AppImages have their own contained environment?
                            I think this is the one of the drawbacks of appimage "sandboxing", only tested it on the repository version.

                            The gtk "simple" IM doesn't seem to honor user compose recipes. Is there a specific reason to use the appimage version (like a newer version that has features you absolutely need)?
                            Last edited by kubicle; Jan 14, 2020, 02:16 AM.

                            Comment


                              #15
                              Thanks kubicle -- sorry for extremely delayed response.

                              Yeah I use the AppImage for the usual kinds of reasons; ease of upgrading and testing latest releases for bugs, pre-installed companion software (G'MIC, etc), etc. Also I'm on an older version of linux that doesn't get updates, etc.

                              I asked about the input methods in the appimage on the gimp dev list and didn't hear anything.

                              Thanks anyway for the brainstorming.

                              Comment

                              Working...
                              X