Skip to content

Instantly share code, notes, and snippets.

View kosivantsov's full-sized avatar
🏋️‍♂️
Working hard...

Kos Ivantsov kosivantsov

🏋️‍♂️
Working hard...
View GitHub Profile
@kosivantsov
kosivantsov / playerctrl
Created November 3, 2018 10:09
Linux bash script to control MOC or any MPRIS-enabled player. The script should be placed somewhere in the $PATH (~/bin; /usr/local/bin etc), and a few keyboard shortcuts added in your WM or via xbindkeys (if used). See help for available actions. If several players are running at the same time, MOC is always given priority, and then the MPRIS p…
#!/bin/bash
case $1 in
"help"|"-h"|"?"|"-?")
echo -e "Usage:
$(basename $0) help
show this help
$(basename $0) up
volume up by 5%
$(basename $0) down
/* :name=Activate source text :description=Activate source text on the Editor with keyboard shortcut
*
* The workaround by script for RFE #821:
* Showing cursor on the original segment
* http://sourceforge.net/p/omegat/feature-requests/821/
*
* @author Yu Tang
* @author Kos Ivantsov
* @date 2019-10-25
* @version 1.1.3
@kosivantsov
kosivantsov / customXkbLayout
Created December 24, 2020 20:58
Bash script to enable custom xkb layouts stored somewhere in user's $HOME
#!/bin/bash
######################################################
# In order to use custom xkb layout, create a folder
# under your $HOME (.xkb, for instance), and place
# layouts file there (in this script uk and rus
# are layout files, they need to go to .xkb/symbols).
# This directory will be searched by xkbcomp.
# No need to store custom layouts under /usr/share/X11
######################################################
@kosivantsov
kosivantsov / uk
Created December 24, 2020 21:04
custom Ukrainian xkb layout
//////////////////////////////
// Custom Ukrainian Layout //
/////////////////////////////
partial alphanumeric_keys
xkb_symbols "twunicode"
{
name[Group1] = "Ukraine (twunicode)";
include "level3(ralt_switch)"
key <AB01> { [ Cyrillic_ya, Cyrillic_YA ] }; // я Я
@kosivantsov
kosivantsov / rus
Created December 24, 2020 21:06
Custom Russian xkb layout
///////////////////////////
// Custom Russian Layout //
///////////////////////////
xkb_symbols "twunicode"
{
name[Group1] = "Russia (twunicode)";
key <AB01> { [ Cyrillic_ya, Cyrillic_YA, U0467, U0466 ] }; // я Я ѧ Ѧ
key <AB02> { [ Cyrillic_che, Cyrillic_CHE, Serbian_tshe, Serbian_TSHE ] }; // ч Ч ћ Ћ
key <AB03> { [ Cyrillic_es, Cyrillic_ES, copyright ] }; // с С ©
@kosivantsov
kosivantsov / lipoJRE.sh
Created June 29, 2023 20:11
Bash script to meld x64 and arm64 JREs into a universal JRE for macOS
#!/bin/bash
# Taken from https://incenp.org/notes/2023/universal-java-app-on-macos.html
# with slight modifications to compress the resulting JRE into a tar.gz file (like the original distributed files)
die() {
echo "${0##*/}: $@" >&2
exit 1
}
version=$(ls OpenJDK*-jre_x64_mac_hotspot_*.tar.gz | sed -E "s,OpenJDK.+-jre_x64_mac_hotspot_(.+).tar.gz,\1,")
[ -n "$version" ] || die "Cannot identify JRE version"
#!/bin/bash
### Some permanent variables used for each created project/repository
ORG="capstanlqc-pisa"
THIS_STEP="trend-prepp"
TEAM="translators"
### omegat.project contents is stored in OMTPOJ variable:
IFS='' read -r -d '' OMTPOJ <<"EOF"
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<!DOCTYPE omegat [
@kosivantsov
kosivantsov / gist:dc6e5c6daf4379f356ca1c87394a2278
Created November 17, 2023 22:02
setLatestTranslation.groovy
/* :name = Set Latest Translations :description=
*
* @author Manuel Souto Pico
* @creation 2023.11.06
* @edit 2023.11.17
* @version 0.0.2
*/
import static javax.swing.JOptionPane.*
import static org.omegat.util.Platform.*
@kosivantsov
kosivantsov / DSL.md
Last active May 20, 2026 17:36
Creating DSL dictionary files

Creating DSL Dictionaries

The DSL (Dictionary Specification Language) format is a plain text file structure used by OmegaT to display rich dictionary lookups. Every file must begin with a header specifying the dictionary name, index language, and contents language, followed by the dictionary entries where headwords are flush left and all definitions are indented with at least one tab or space.

Common DSL Tags

Tags in DSL are used to format text and organize definitions into logical sections. They function similarly to HTML tags and must be opened and closed properly around the targeted text.

  • [m1], [m2], etc.: Sets the left margin indentation level for the text block to create visual hierarchy. The closing tag is [/m].
  • [trn]...[/trn]: Wraps the core translation or definition of the given word.
  • [ex]...[/ex]: Indicates an example sentence illustrating how the word is used.