Browse Source

Minor changes and svg source for layer added.

master
Olaf Schulz 2 years ago
parent
commit
c660404b3e
  1. 3
      Makefile
  2. 72
      assets/svg/convert_svg.py
  3. 7
      assets/svg/info.txt
  4. 18065
      assets/svg/tastatur_neo_alle_Ebenen.svg
  5. 2
      release
  6. 2
      src/main.vala
  7. 2
      src/neo-window.vala

3
Makefile

@ -35,7 +35,8 @@ UBUNTU ?= 0
DISTDIR = dist
TMPDIR = tmp
ARCHS = amd64 # i386 # armhf arm64
# ARCHS = amd64 # i386 # armhf arm64
ARCHS = amd64 i386 # armhf arm64
BASETGZ_DIR = /var/cache/pbuilder
ifeq ($(UBUNTU),1)

72
assets/svg/convert_svg.py

@ -0,0 +1,72 @@
#!/usr/bin/python3
#
# Helper script to generate images of all layers.
# Note that the svg file contain all layers, but they
# are hidden.
#
import os
import os.path
import sys
SIZE = r"-resize 2000\!x" # Fixed width
INPUT_SVG = "tastatur_neo_alle_Ebenen.svg"
CONVERT_ARGS = "-background transparent"
LAYER_NAMES = "Ebene 1|Ebene 2|Ebene 3|Ebene 4|Ebene 5|Ebene 6".split("|")
def gen_pngs():
try:
if not os.path.isdir("out"):
os.mkdir("out")
except Exception as e:
print(e)
for layer_name in LAYER_NAMES:
print(layer_name)
cmd1 = r'''\
sed "/inkscape:label=\"{layer_name}\"/ {{ \
N; s/display:none/display:inline/ }} " \
"{input_svg}" > tmp.svg'''.format(
layer_name=layer_name,
input_svg=INPUT_SVG,
)
print(cmd1)
os.system(cmd1)
cmd2 = r'''\
convert {convert_args} "tmp.svg" {size} \
"out/tastatur_neo_{l}.png"'''.format(
convert_args=CONVERT_ARGS,
size=SIZE,
l=layer_name.replace(" ", ""),
)
print(cmd2)
os.system(cmd2)
break
def update_pngs():
# Put symbols on cursor keys and block above cursors
# Use keys from layer 3/4 with the same character/function.
for layer_name in LAYER_NAMES:
break
# TODO Hm, im map_viewer schauen, wie man Bilder zusammensetzt.
def clean():
if os.path.isfile("tmp.svg"):
os.unlink("tmp.svg")
if __name__ == "__main__":
# gen_pngs()
update_pngs()
clean()

7
assets/svg/info.txt

@ -0,0 +1,7 @@
convert_svg.sh erstellt PNGs, aber diese enthalten keine
Reihe mit Funktionstasten.
Quelle:
https://github.com/neo-layout/neo-layout/grafik/tastatur3d

18065
assets/svg/tastatur_neo_alle_Ebenen.svg
File diff suppressed because it is too large
View File

2
release

@ -168,7 +168,7 @@ perform_release() {
git commit -m "[release] Prepare next development version" --allow-empty && \
git push && \
git push origin $new_version_tag && \
gh_upload_release $new_version_tag dist/* && \
gh_upload_release $new_version_tag dist/*$new_version* && \
rm release_info
#TODO: Provide changelog to gh_upload_release
} || {

2
src/main.vala

@ -62,7 +62,7 @@ namespace NeoLayoutViewer{
var monitor_shortcut = configm.getConfig().get("monitor_shortcut").strip();
string tmp = "";
if (show_shortcut == monitor_shortcut && false) {
if (show_shortcut == monitor_shortcut) {
tmp = "Monitor wechseln/Ausblenden - %s".printf(show_shortcut);
} else {
tmp = """Ein-/Ausblenden - %s

2
src/neo-window.vala

@ -539,7 +539,7 @@ namespace NeoLayoutViewer {
}
public Gdk.Pixbuf open_image (int layer) {
var bildpfad = @"$(config.get("asset_folder"))/neo2.0/tastatur_neo_Ebene$(layer).png";
var bildpfad = @"$(config.get("asset_folder"))/neo2.0_hires/tastatur_neo_Ebene$(layer).png";
return open_image_str(bildpfad);
}

Loading…
Cancel
Save