new key name

Help
2011-09-30
2013-05-22
  • Constantin Lacatus

    Is it possible to change the name displayed on F1 key to something else (SUS for example)?

     
  • Francois Agrech

    Francois Agrech - 2011-10-01

    Sure, it is.
    Edit file /usr/share/florence/styles/default/symbols.xml.
    Look for something like :

    <symbol>
                    <name>F1</name>
                    <label>F1</label>
    </symbol>
    

    and just change the label to whatever you want.
    You can customize any key you want just like that.

     
  • Gorstak

    Gorstak - 2011-11-15

    How about changing symbols of special keys, Super key for example? The syntax is not so simple for me to understand.

     
  • Francois Agrech

    Francois Agrech - 2011-11-15

    The symbol element takes either a <label> or a <svg> element.
    If you just want to use a label, then you can change the Super key to look like this:

    <symbol>
             <name>Super_[LR]</name>
             <label>Super</label>
    </symbol>
    

    Note this will change both super keys (right and left).
    You could change them independently like this:

    <symbol>
             <name>Super_L</name>
             <label>Super Left</label>
    </symbol>
    <symbol>
             <name>Super_R</name>
             <label>Super Right</label>
    </symbol>
    

    Now if you want to use a drawing instead of a label, you need to use a svg element, like the one used in the original symbol.xml file:

    <symbol>
             <name>Super_[LR]</name>
             <svg xmlns="http://www.w3.org/2000/svg" width="100" viewBox="0 0 100 100" version="1.1" height="100">
                            <path d="M 50,22.5 C 34.841781,22.5 22.5,34.841781 22.5,50 22.5,65.158219 34.841781,77.5 50,77.5 65.158219,77.5 77.5,65.158219 77.5,50 77.5,34.841781 65.158219,22.5 50,22.5 z m 0,5 C 62.456018,27.5 72.5,37.543982 72.5,50 72.5,62.456018 62.456018,72.5 50,72.5 37.543982,72.5 27.5,62.456018 27.5,50 27.5,37.543982 37.543982,27.5 50,27.5 z" class="symbol"/>
                            <ellipse transform="matrix(0.83333331,0,0,1,8.0000011,0)" ry="4" rx="6" cy="42" cx="42" class="symbol"/>
                            <ellipse transform="matrix(0.83333334,0,0,1,8.6666665,0)" ry="4" rx="6" cy="42" cx="58" class="symbol"/>
                            <path d="m 36.96875,55.46875 a 2.50025,2.50025 0 0 0 -1.75,4.3125 C 39.004424,63.566924 44.666667,64.5 50,64.5 c 5.333333,0 10.995576,-0.933076 14.78125,-4.71875 a 2.5190679,2.5190679 0 1 0 -3.5625,-3.5625 C 59.004424,58.433076 54.666667,59.5 50,59.5 c -4.666667,0 -9.004424,-1.066924 -11.21875,-3.28125 a 2.50025,2.50025 0 0 0 -1.8125,-0.75 z" class="symbol"/>
             </svg>
    </symbol>
    

    And indeed, the svg syntax is not simple. The full documentation for svg can be found here: http://www.w3.org/TR/SVG11/
    But don't worry, there is no need to read this. You can just install inkscape: http://inkscape.org/ (or install it from your distro repository). Inkscape is a WYSIWYG editor to create svg files. Edit your symbol with inkscape and save it as simple svg. Then you can view your svg file with a text editor and copy it in the symbol element of the symbol.xml file.
    In inkscape, you can select the class of the drawing elements. Elements that have the "symbol" class will use the color selected in the configuration dialog of Florence. That is because Florence uses a css that is generated from the /usr/share/florence/florence.css template. This template file looks like this:

    .shape {
        fill: @SHAPE_COLOR@;
        stroke: @BORDER_COLOR@;
        stroke-opacity: 35%;
        stroke-width: 4px;
    }
    .symbol {
        fill: @SYM_COLOR@;
        stroke: @SYM_OUTLINE_COLOR@;
        stroke-width: 2px;
    }
    

    As you can see, the elements that have the symbol class are filled with the symbol color and outlined with the symbol outline color (2 pixels wide).

    I understand the process is not so simple, as it requires some knowledge and is not documented enough. A style editor is planned for the future and that should make it a lot easier to customize the symbols. The problem is that there are a lot of features that have a higher priority and I have little time to do it. I'm afraid it won't be implemented before 2013 or so. Please understand I'm alone on this project as of now and I am not very good at recruiting new volonteers so bear with me.

    Anyway, I hope this helps a bit.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks