Compare commits

...

33 Commits

Author SHA1 Message Date
0f1a1146ff remove install-release 2024-05-12 10:31:36 +02:00
bf5ee3437d WIP new github-releases 2024-05-12 10:26:24 +02:00
7e64148005 🔤 updated KDE Plasma 6 fixes 2024-05-12 10:25:03 +02:00
219caa08af vim+coc+ultisnips 2024-05-12 10:24:34 +02:00
a7dd1a8521 🔤 newsboat 2024-05-12 10:23:25 +02:00
ee94361f1a 🐛 better fzf/compose jaaENV
- `§ck-grep`: find combination for symbol
- `fzf`: typo
- `jaaENV`: switch java support and enhancements
2024-05-12 10:21:19 +02:00
f02723bdc6 🐛 ai commit (correct regular/conventional) 2024-05-12 10:19:02 +02:00
352632e5a5 use wikimedia Potd as HTML wallpaper
[Commons:Picture of the day - Wikimedia Commons](https://commons.wikimedia.org/wiki/Commons:Picture_of_the_day)
2024-05-12 10:16:48 +02:00
b260e411f0 Hl. hledání náhrad za nitter 2024-03-30 12:31:50 +01:00
1dc978f1c1 m instead of cd. + §time.mjs completion 2024-03-28 11:36:28 +01:00
d8d0c9ba2e §time.mjs better time + allow ref 2024-03-27 19:01:29 +01:00
60d6583472 gcalendar/§time.mjs/shift-enter=history-and-alias-expand-line 2024-03-27 18:44:03 +01:00
6a8f73450c 🔤 updates (partially) fixes wayland 2024-03-27 14:18:56 +01:00
1a938fbeb3 config files nodejsscript and github-releases 2024-03-27 14:15:58 +01:00
3c99b8cb34 rm unused cd aliases in favou cd.
…quickly create cd aliases on demand
2024-03-27 14:14:42 +01:00
a665006836 🐛 color for ls alias 2024-03-27 14:14:28 +01:00
9737f6cdab kwallet and nocodb 2024-03-21 10:35:30 +01:00
4f578e0bb0 🔤 event calendar update 2024-03-20 22:16:41 +01:00
9051f04328 🔤 just sorting todo list 2024-03-20 22:06:55 +01:00
98073783bf 🔤 KDE6 updates 2024-03-20 21:50:24 +01:00
08ee9f8b0e modified: .config/kdedefaults/kwinrc 2024-03-20 21:50:02 +01:00
068db0c3c8 cleaning unused vimrc + updated tips bar 2024-03-20 21:49:11 +01:00
7f4d93f4d2 utils/bin updates (socky, njs, github-releases) 2024-03-20 21:48:17 +01:00
621832506c 🐛 ultisnips includes hotfixed by script 2024-03-20 21:46:40 +01:00
36376a2e34 konsole/bash 2024-03-12 12:54:48 +01:00
6269463d7b silicon create code screenshots 2024-03-07 13:28:52 +01:00
34dd9f4b01 kwallet from cli 2024-03-06 09:39:06 +01:00
5c4a9851e6 *§ls→ls* and KDE Neon 6 and njs 2024-03-06 09:36:21 +01:00
3495c81c49 xremap, terminal UI+UX 2024-03-01 18:00:42 +01:00
5dd77c49a0 Logout dialog (dbus autorun still not working) 2024-02-29 20:14:33 +01:00
15be72893c 🐛 KDE Neon 6.0 2024-02-29 15:12:14 +01:00
43d220be01 👮 Remove console.log 2024-02-28 14:21:35 +01:00
8210faf9ce 🔤 varinat termux 2024-02-28 12:49:32 +01:00
38 changed files with 3851 additions and 319 deletions

View File

@ -2,9 +2,10 @@
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
alias gitdotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"' alias gitdotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"'
# enable color support of ls and also add handy aliases # enable color support of ls and also add handy aliases
alias ls='ls -pQFh --group-directories-first'
if [ -x /usr/bin/dircolors ]; then if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto' alias ls='ls --color=auto -pQFh --group-directories-first'
alias dir='dir --color=auto' alias dir='dir --color=auto'
alias vdir='vdir --color=auto' alias vdir='vdir --color=auto'
@ -42,29 +43,39 @@ history_most_used(){ LC_ALL=C cat ~/.bash_history | cut -d ';' -f 2- | §awk 1 |
ls ~/bin | grep -P "^§" | sed 's/^§/~\/bin\/ §/' ls ~/bin | grep -P "^§" | sed 's/^§/~\/bin\/ §/'
} }
alias §ls='ls -pQFh --group-directories-first'
alias §less='less -R -S' alias §less='less -R -S'
alias §cd.='clear;§ls' m(){
§cd..(){ cd $(eval printf '../'%.0s {1..$1}); } if [[ -z "$1" ]]; then
§cd(){ printenv | grep -e '^m'
[[ "$1" == '--help' ]] && echo -e " return 0
Usage: §cd NUMBER|PATH fi
See: dirs -v if [[ "--help" == "$1" ]]; then
" && return 0 echo 'm [--help]'
[[ -z "$1" ]] && dirs -v | sed 1d && return 0 echo ' Lists all marks or print this help.'
[[ $1 =~ ^[0-9]+$ ]] && cd "$(dirs -l +$1)" && dirs -v | sed 1d && return 0 echo 'm <name> [path]'
builtin pushd "$1" >/dev/null && pushd . echo ' Sets mark <name> to current directory or [path].'
echo ' The mark is just a bash variable, use `$m<name>`.'
return 0
fi
local n="m$1"
[[ -z "${!n}" ]] || return 1
[[ -z "$2" ]] && local p="$(pwd)" || local p="$(readlink -f $2)"
export $n="$p"
} }
alias cd-vifm='cd `vifm --choose-dir -`' alias cd-vifm='cd `vifm --choose-dir -`'
mkcd(){ mkdir -p -- "$1" && cd -P -- "$1"; } mkcd(){ mkdir -p -- "$1" && cd -P -- "$1"; }
alias gcalendar-dovolené='gcalendar --account "práce" --calendar "Dovolené"'
alias gcalendar-události='gcalendar --account "default" --calendar "Události"'
alias §find.='find . -maxdepth 1' alias §find.='find . -maxdepth 1'
alias pdftk='java -jar $HOME/bin/pdftk-all.jar' alias pdftk='java -jar $HOME/bin/pdftk-all.jar'
bw-session(){ bw-session(){
bw logout bw logout
login=`kwallet-query kdewallet -f accounts -r Bitwarden 2> /dev/null` # login=`kwallet-query kdewallet -f accounts -r Bitwarden 2> /dev/null`
login=$(§kwallet.mjs --wallet kdewallet readPassword accounts bw-json)
export BW_CLIENTSECRET=`echo "$login" | jq -r .secret` export BW_CLIENTSECRET=`echo "$login" | jq -r .secret`
export BW_CLIENTID=`echo "$login" | jq -r .id` export BW_CLIENTID=`echo "$login" | jq -r .id`
bw login --apikey --raw bw login --apikey --raw
@ -78,6 +89,7 @@ alias §psmem='§psmem_all | head -n 10'
alias §pscpu_all='ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu' alias §pscpu_all='ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu'
alias §pscpu='§pscpu_all | head -n 10' alias §pscpu='§pscpu_all | head -n 10'
alias §psnet_all='lsof -P -i -n' alias §psnet_all='lsof -P -i -n'
alias §ck-grep='cat /usr/share/X11/locale/en_US.UTF-8/Compose ~/.XCompose | grep -i'
§ping-test(){ # Pings ip address of noip.com and www.google.com. §ping-test(){ # Pings ip address of noip.com and www.google.com.
ping -c 1 -q 8.23.224.107 | grep --color=never -A 1 -i '\---' ping -c 1 -q 8.23.224.107 | grep --color=never -A 1 -i '\---'
@ -105,7 +117,8 @@ alias npx-wca='npx -y web-component-analyzer'
alias npx-qnm='npx -y qnm' alias npx-qnm='npx -y qnm'
alias npx-hint='npx -y hint' alias npx-hint='npx -y hint'
alias npx-markdown='nohup npx markserv' alias npx-markdown='nohup npx markserv'
alias zfz=fzf-carroarmato0.fzf
alias fzf=fzf-carroarmato0.fzf
§url-curl(){ curl --silent -I "$1" | grep -i location; } §url-curl(){ curl --silent -I "$1" | grep -i location; }

View File

@ -38,17 +38,21 @@ function jaaENV {
do do
case "$1" in case "$1" in
nodejs|node) nodejs|node)
local nodejs_version=`node --version` local nodejs_version=$(node --version)
echo "nodejs=${nodejs_version:1}" >> .jaaENV echo "nodejs=${nodejs_version:1}" >> .jaaENV
;; ;;
gradle) gradle)
local gradle_version=`gradle --version | head -n 3 | tail -n 1 | §awk 2` local gradle_version=$(gradle --version | head -n 3 | tail -n 1 | §awk 2)
echo "gradle=$gradle_version" >> .jaaENV echo "gradle=$gradle_version" >> .jaaENV
;; ;;
php) php)
local php_version=`php --version | head -n 1 | §awk 2` local php_version=$(php --version | head -n 1 | §awk 2)
echo "php=$php_version" >> .jaaENV echo "php=$php_version" >> .jaaENV
;; ;;
java)
local java_version=$(java -version 2>&1 | head -n 1 | cut -d'"' -f2 | cut -d'.' -f1)
echo "java=$java_version" >> .jaaENV
;;
*) *)
echo "unknown '$1' skipped" echo "unknown '$1' skipped"
;; ;;
@ -73,6 +77,22 @@ function jaaENV {
else else
. ./.jaaENV . ./.jaaENV
fi fi
if [ ! -z ${java+x} ]; then
[[ "$java" == "8" ]] && java=1.8
local java_local=$(java -version 2>&1 | head -n 1 | cut -d'"' -f2)
if [[ "$java_local" != "$java"* ]]; then
[[ "$java" == "1.8" ]] && java=8
echo "java $java$java_local"
local v="/usr/lib/jvm/java-$java-openjdk-amd64/"
[[ "$java" == "8" ]] && local vv="jre/" || local vv=""
sudo update-alternatives --set java ${v}${vv}bin/java
local javac=$(update-alternatives --list javac | grep java-$java)
[ $javac ] && sudo update-alternatives --set javac $javac
sudo -k
fi
export JAVA_HOME=$(update-alternatives --display java | grep momentálně | §awk 5 | cut -d \/ -f1-5)/
echo \$JAVA_HOME=$JAVA_HOME
fi
if [ ! -z ${android_home+x} ]; then export ANDROID_HOME=$ANDROID_HOME_BAK; echo "\$ANDROID_HOME=$ANDROID_HOME"; else unset ANDROID_HOME; echo "\$ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"; fi if [ ! -z ${android_home+x} ]; then export ANDROID_HOME=$ANDROID_HOME_BAK; echo "\$ANDROID_HOME=$ANDROID_HOME"; else unset ANDROID_HOME; echo "\$ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"; fi
if [ ! -z ${android_home_is_sdk+x} ]; then export ANDROID_HOME=$ANDROID_SDK_ROOT; echo "\$ANDROID_HOME=$ANDROID_HOME"; fi if [ ! -z ${android_home_is_sdk+x} ]; then export ANDROID_HOME=$ANDROID_SDK_ROOT; echo "\$ANDROID_HOME=$ANDROID_HOME"; fi
if [ ! -z ${jdk+x} ]; then if [ ! -z ${jdk+x} ]; then
@ -87,7 +107,7 @@ function jaaENV {
if [ ! -z ${nodejs+x} ]; then nvm use $nodejs; fi if [ ! -z ${nodejs+x} ]; then nvm use $nodejs; fi
if [ ! -z ${gradle+x} ]; then sdk use gradle $gradle | tr -d '\n'; echo ; fi if [ ! -z ${gradle+x} ]; then sdk use gradle $gradle | tr -d '\n'; echo ; fi
if [ ! -z ${php+x} ]; then if [ ! -z ${php+x} ]; then
local php_local=`php --version | head -n 1 | §awk 2` local php_local=$(php --version | head -n 1 | §awk 2)
if [[ "$php_local" == "$php"* ]]; then if [[ "$php_local" == "$php"* ]]; then
echo "php $php" echo "php $php"
else else
@ -100,4 +120,5 @@ function jaaENV {
unset nodejs unset nodejs
unset gradle unset gradle
unset php unset php
unset java
} }

View File

@ -1,58 +1,59 @@
function setPromt { function setPromt {
if [ "$color_prompt" != yes ]; then if [ "$color_prompt" != yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
return return
fi fi
case "$TERM" in case "$TERM" in
xterm*|rxvt*) xterm*|rxvt*)
;; ;;
*) *)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
return return
;; ;;
esac esac
PROMPT_COMMAND=updatePromt PROMPT_COMMAND=updatePromt
PS2="|" PS2="|"
} }
function updatePromt { function updatePromt {
local prev_exit="$?" local prev_exit="$?"
# color_helper_>>color<< (Note: \[\]= escaping) # history -n; history -w; history -c; history -r;
local chR="\[\e[1;91m\]" #red # color_helper_>>color<< (Note: \[\]= escaping)
local chW="\[\033[00m\]" #white local chR="\[\e[1;91m\]" #red
local chG="\[\033[01;32m\]" #green local chW="\[\033[00m\]" #white
local chB="\[\033[0;34m\]" #blue local chG="\[\033[01;32m\]" #green
local chP="\[\033[0;35m\]" #purple local chB="\[\033[0;34m\]" #blue
local chY="\[\033[0;33m\]" #yellow local chP="\[\033[0;35m\]" #purple
PS1="" local chY="\[\033[0;33m\]" #yellow
if [ $prev_exit == 0 ]; then PS1=""
PS1+="$chG$chW" if [ $prev_exit == 0 ]; then
else PS1+="$chG$chW"
PS1+="$chR$chW" else
fi PS1+="$chR$chW"
local jobs="$(jobs | wc -l)" fi
if [ $jobs != 0 ]; then local jobs="$(jobs | wc -l)"
PS1+="${chY}$jobs$chW" if [ $jobs != 0 ]; then
fi PS1+="${chY}$jobs$chW"
PS1+="${debian_chroot:+($debian_chroot)}" fi
PS1+=" At ${chG}\A${chW}" PS1+="${debian_chroot:+($debian_chroot)}"
PS1+=" by ${chP}\u${chW}" PS1+=" At ${chG}\A${chW}"
if sudo -n true 2>/dev/null; then PS1+=" by ${chP}\u${chW}"
PS1+="${chR} (sudo)${chW}" if sudo -n true 2>/dev/null; then
fi PS1+="${chR} (sudo)${chW}"
PS1+=" in " fi
if \git rev-parse --is-inside-work-tree >/dev/null 2>&1; then PS1+=" in "
local branch="$(\git symbolic-ref -q HEAD)" if \git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
PS1+="[${branch#refs/heads/}" local branch="$(\git symbolic-ref -q HEAD)"
local status="$(git for-each-ref --format='%(upstream:trackshort)' refs/heads | awk '!seen[$1]++ {printf $1}')" PS1+="[${branch#refs/heads/}"
status+="$(git status --porcelain | awk '!seen[$1]++ {printf $1}')" local status="$(git for-each-ref --format='%(upstream:trackshort)' refs/heads | awk '!seen[$1]++ {printf $1}')"
if [ "$statua"s ]; then status+="$(git status --porcelain | awk '!seen[$1]++ {printf $1}')"
PS1+="|$chY$status$chW" if [ "$statua"s ]; then
fi PS1+="|$chY$status$chW"
PS1+="] " fi
fi PS1+="] "
PS1+="${chB}\w${chW}" fi
PS1+="\n:" PS1+="${chB}\w${chW}"
history -a PS1+="\n:"
history -a
} }
setPromt setPromt
unset color_prompt unset color_prompt

View File

@ -1,16 +0,0 @@
[Behavior]
hideDockIcon=false
hideMainWindowWhenStarted=true
[MainWindow]
pos=@Point(0 0)
size=@Size(640 480)
[RepoTreeView]
expandedCategories-e77d1fb=Moje knihovny\tNed\xe1vno aktualizovan\xe9\tSd\xedleno se skupinama
[Settings]
computerName=TUXEDO-InfinityBook-s15gen6
[UsedServerAddresses]
main=https://seafile.jaandrle.cz/

View File

@ -32,7 +32,7 @@
"model_hash_override": null, "model_hash_override": null,
"local_indexing": null, "local_indexing": null,
"heartbeat_interval_seconds": null, "heartbeat_interval_seconds": null,
"last_service_level": "Cloud", "last_service_level": "FreeCloudRegistered",
"override_beams": null, "override_beams": null,
"override_context_length": null, "override_context_length": null,
"onboarding": null, "onboarding": null,

View File

@ -1,28 +1,3 @@
# A valid snippet should starts with:
#
# snippet trigger_word [ "description" [ options ] ]
#
# and end with:
#
# endsnippet
#
# Snippet options:
#
# b - Beginning of line.
# i - In-word expansion.
# w - Word boundary.
# r - Regular expression
# e - Custom context snippet
# A - Snippet will be triggered automatically, when condition matches.
#
# Basic example:
#
# snippet emitter "emitter properties" b
# private readonly ${1} = new Emitter<$2>()
# public readonly ${1/^_(.*)/$1/}: Event<$2> = this.$1.event
# endsnippet
#
# Online reference: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt
snippet sceleton "HTML5" b snippet sceleton "HTML5" b
<!DOCTYPE html> <!DOCTYPE html>
<!-- ${0}DEL IE https://www.paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> <!-- ${0}DEL IE https://www.paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
@ -50,6 +25,9 @@ endsnippet
snippet cmt "comment" snippet cmt "comment"
<!-- ${0} --> <!-- ${0} -->
endsnippet endsnippet
snippet cmt.js "comment"
/* ${0} */
endsnippet
snippet viewport_cordova "viewport used in cordova apps" snippet viewport_cordova "viewport used in cordova apps"
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"/> <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"/>

View File

@ -0,0 +1 @@
extends javascript

View File

@ -1,25 +1,37 @@
# A valid snippet should starts with: extends html
# snippet sceleton "HTML5" b
# snippet trigger_word [ "description" [ options ] ] <!DOCTYPE html>
# <!-- ${0}DEL IE https://www.paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
# and end with: <html class="no-js" lang="en">
# <head>
# endsnippet <meta charset="utf-8" />
# <!-- DEL IE https://stackoverflow.com/questions/6771258/what-does-meta-http-equiv-x-ua-compatible-content-ie-edge-do -->
# Snippet options: <!-- DEL https://www.vzhurudolu.cz/prirucka/viewport-meta -->
# <meta name="viewport" content="width=device-width, initial-scale=1" />
# b - Beginning of line. <!-- DEL CSP https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP | https://github.com/Prinzhorn/minimal-csp -->
# i - In-word expansion. <!-- DEL https://github.com/jensimmons/cssremedy -->
# w - Word boundary.
# r - Regular expression <!-- DEL meta značky obecně https://www.vzhurudolu.cz/prirucka/meta-open-graph -->
# e - Custom context snippet <title></title>
# A - Snippet will be triggered automatically, when condition matches. <meta name="description" content="">
# <!-- DEL IE https://www.sitepoint.com/html5-older-browsers-and-the-shiv/ -->
# Basic example: <!-- DEL https://www.vzhurudolu.cz/prirucka/checklist -->
# </head>
# snippet emitter "emitter properties" b <body>
# private readonly ${1} = new Emitter<$2>() <!-- DEL -->
# public readonly ${1/^_(.*)/$1/}: Event<$2> = this.$1.event </body>
# endsnippet </html>
# endsnippet
# Online reference: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt
snippet cmt "comment"
<!-- ${0} -->
endsnippet
snippet viewport_cordova "viewport used in cordova apps"
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"/>
endsnippet
snippet csp_cordova "CSP used in cordova"
<meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file: gulp_place('app.url_scheme', 'variable'):; style-src 'self' 'unsafe-inline'; img-src * data: *; script-src 'self' 'unsafe-inline' 'unsafe-eval'"/>
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; img-src 'self' data: android-webview-video-poster:; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
endsnippet
#endextends

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
extends javascript

View File

@ -0,0 +1 @@
extends javascript

View File

@ -1 +1,124 @@
extends javascript, html extends javascript, html
snippet sceleton_node "nodejs" b
#!/usr/bin/env node
/* jshint esversion: 8,-W097, -W040, node: true, expr: true, undef: true */
${0}
endsnippet
snippet sceleton_cli "nodejsscript" b
#!/usr/bin/env nodejsscript
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */
${0}
endsnippet
snippet sceleton_zx "zx" b
#!/usr/bin/env zx
/* jshint esversion: 8,-W097, -W040, node: true, expr: true, undef: true */
${0}
endsnippet
snippet jshint "JSHint header" b
/* jshint esversion: 6,-W097, -W040, browser: true, expr: true, undef: true */
/* global ${0} */
endsnippet
snippet global "JSHint global"
/* global ${0} */
endsnippet
snippet global_ns "JSHint global"
/* ${1} *//* global ${0} */
endsnippet
snippet devel "JSHint devel"
${1}/* jshint devel: true *///gulp.keep.line${0}
endsnippet
snippet log "console.log"
${1}console.log('${0}');
endsnippet
snippet stor "localStorage"
${1}localStorage.${2:g}etItem("${0}");
endsnippet
snippet import "import with backward order"
import ${2:values} from "${1:specifier}";$0
endsnippet
snippet promise "return? new Promise"
${1:return }new Promise(function(resolve, reject){
${0:/* async code */}
});
endsnippet
snippet for "classical loop"
for(${1:let} ${2:i}= 0, ${2}_length= ${3:ITERABLE}.length; ${2}<${2}_length; ${2}++){
${0:/* statement */}
}
endsnippet
snippet foreach "PHP-like name" b
for(${2:const} ${3:element} of ${1:iterable}){
${0:/* statement */}
}
endsnippet
snippet switch "classical switch"
switch (${1}){
case ${2}:
${0}
break;
default:
}
endsnippet
snippet desctr "object destructure"
${1:const} { $0 }= ${2:def};
endsnippet
snippet ready "document ready"
${1}document.addEventListener('DOMContentLoaded', ${0}, false)
endsnippet
snippet readyEvent "vanilla JS content ready event name"
${1}DOMContentLoaded${0}
endsnippet
snippet selid
${1}document.getElementById('${0}')
endsnippet
snippet seltag
${1}getElementsByTagName('${0}')
endsnippet
snippet selclass
${1}getElementsByClassName('${0}')
endsnippet
snippet sel
${1}querySelector('${0}')
endsnippet
snippet selall
${1}querySelectorAll('${0}')
endsnippet
snippet sceleton "HTML5" b
<!DOCTYPE html>
<!-- ${0}DEL IE https://www.paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<!-- DEL IE https://stackoverflow.com/questions/6771258/what-does-meta-http-equiv-x-ua-compatible-content-ie-edge-do -->
<!-- DEL https://www.vzhurudolu.cz/prirucka/viewport-meta -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- DEL CSP https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP | https://github.com/Prinzhorn/minimal-csp -->
<!-- DEL https://github.com/jensimmons/cssremedy -->
<!-- DEL meta značky obecně https://www.vzhurudolu.cz/prirucka/meta-open-graph -->
<title></title>
<meta name="description" content="">
<!-- DEL IE https://www.sitepoint.com/html5-older-browsers-and-the-shiv/ -->
<!-- DEL https://www.vzhurudolu.cz/prirucka/checklist -->
</head>
<body>
<!-- DEL -->
</body>
</html>
endsnippet
snippet cmt "comment"
<!-- ${0} -->
endsnippet
snippet viewport_cordova "viewport used in cordova apps"
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"/>
endsnippet
snippet csp_cordova "CSP used in cordova"
<meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file: gulp_place('app.url_scheme', 'variable'):; style-src 'self' 'unsafe-inline'; img-src * data: *; script-src 'self' 'unsafe-inline' 'unsafe-eval'"/>
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; img-src 'self' data: android-webview-video-poster:; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
endsnippet
#endextends

View File

@ -0,0 +1,245 @@
{
"target": "/home/jaandrle/bin/",
"packages": [
{
"repository": "shiftkey/desktop",
"name": "GitHub Desktop",
"group": "dev",
"file_name": "github-desktop",
"exec": "yes",
"description": "Fork of GitHub Desktop to support various Linux distributions",
"last_update": "2024-03-31T17:49:36Z",
"downloads": "/home/jaandrle/bin/github-desktop",
"version": "release-3.3.12-linux2",
"glare": ".*x86_64.*.AppImage"
},
{
"repository": "jaandrle/jaaCSS-cli",
"name": "jaaCSS",
"description": "EXPERIMENT Helper for managing functional CSS classes",
"group": "dev",
"file_name": "jaaCSS.js",
"exec": "yes",
"downloads": "/home/jaandrle/bin/jaaCSS.js",
"version": "v1.3.2",
"last_update": "2022-09-02T13:33:16Z",
"glare": "jaaCSS.js"
},
{
"repository": "th-ch/youtube-music",
"name": "youtube-music",
"description": "YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader)",
"group": "nondev",
"file_name": "youtube-music",
"exec": "yes",
"last_update": "2024-04-13T14:34:34Z",
"downloads": "/home/jaandrle/bin/youtube-music",
"version": "v3.3.6",
"glare": "AppImage"
},
{
"repository": "ArchGPT/insomnium",
"name": "insomnium",
"description": "Insomnium is a fast local API testing tool that is privacy-focused and 100% local. For testing GraphQL, REST, WebSockets and gRPC. This is a fork of Kong/insomnia",
"group": "dev",
"file_name": "insomnium",
"exec": "yes",
"last_update": "2023-11-13T10:03:28Z",
"downloads": "/home/jaandrle/bin/insomnium",
"tag_name_regex": "core@.*",
"version": "core@0.2.3-a",
"glare": "AppImage"
},
{
"repository": "Kong/insomnia",
"name": "insomnia",
"description": "The open-source, cross-platform API client for GraphQL, REST, and gRPC.",
"group": "skip",
"file_name": "insomnia",
"exec": "yes",
"last_update": "2024-04-17T16:38:03Z",
"downloads": "/home/jaandrle/bin/insomnia",
"tag_name_regex": "core@.*",
"version": "core@9.0.0-beta.4",
"glare": "AppImage"
},
{
"repository": "rvpanoz/luna",
"name": "luna",
"description": "Manage npm dependencies through a modern UI.",
"group": "skip",
"file_name": "luna",
"exec": "yes",
"glare": "AppImage"
},
{
"repository": "angela-d/wifi-channel-watcher",
"name": "wifi-channel-watcher",
"group": "skip",
"file_name": "wifi-channel-watcher",
"exec": "no",
"description": "Monitor channel usage of neighboring routers & get an alert if your active channel is not optimal.\tTroubleshoot wifi without lifting a finger!"
},
{
"repository": "vinceliuice/Tela-circle-icon-theme",
"name": "Tela-circle-icon-theme",
"description": "Tela-circle-icon-theme",
"group": "skip",
"file_name": "tela-circle-icon-theme.zip",
"last_update": "2021-07-19T14:12:05Z",
"exec": "no"
},
{
"repository": "AppImage/AppImageKit",
"name": "AppImageKit",
"group": "skip",
"file_name": "appimagekit",
"exec": "yes",
"description": "Package desktop applications as AppImages that run on common Linux-based operating systems, such as RHEL, CentOS, openSUSE, SLED, Ubuntu, Fedora, debian and derivatives. Join #AppImage on irc.freenode.net",
"glare": ".*x86_64.*.AppImage"
},
{
"repository": "dynobo/normcap",
"name": "NormCap",
"description": "Switched to flatpak version | OCR powered screen-capture tool to capture information instead of images",
"group": "skip",
"file_name": "normcap",
"exec": "yes",
"last_update": "2023-12-12T22:23:37Z",
"downloads": "/home/jaandrle/bin/normcap",
"version": "v0.5.2"
},
{
"repository": "upscayl/upscayl",
"name": "upscayl",
"description": "🆙 Upscayl - Free and Open Source AI Image Upscaler for Linux, MacOS and Windows built with Linux-First philosophy.",
"group": "nondev",
"file_name": "upscayl",
"exec": "yes",
"last_update": "2024-04-25T04:29:38Z",
"downloads": "/home/jaandrle/bin/upscayl",
"version": "v2.11.0",
"glare": "AppImage"
},
{
"repository": "RasmusLindroth/tut",
"name": "tut",
"description": "TUI for Mastodon with vim inspired keys",
"group": "nondev",
"file_name": "tut",
"exec": "yes",
"last_update": "2023-01-26T17:48:00Z",
"downloads": "/home/jaandrle/bin/tut",
"version": "2.0.1",
"glare": "tut-amd64"
},
{
"repository": "sunner/ChatALL",
"name": "ChatALL",
"description": " Concurrently chat with ChatGPT, Bing Chat, bard, Alpaca, Vincuna, Claude, ChatGLM, MOSS, iFlytek Spark, ERNIE and more, discover the best answers",
"group": "skip",
"file_name": "chatall",
"exec": "yes",
"last_update": "2024-04-14T02:09:42Z",
"downloads": "/home/jaandrle/bin/chatall",
"version": "v1.71.100",
"glare": ".*x86_64.*.AppImage"
},
{
"repository": "jaandrle/bs",
"name": "bs",
"description": "The simplest possible build system using executables",
"group": "dev",
"file_name": "bs",
"exec": "yes",
"last_update": "2024-03-28T13:16:41Z",
"downloads": "/home/jaandrle/bin/bs",
"version": "v0.7.4",
"glare": "bs-linux"
},
{
"repository": "h3poteto/fedistar",
"name": "Fedistar",
"description": "Multi-column Mastodon, Pleroma, and Friendica client for desktop",
"group": "nondev",
"file_name": "fedistar",
"exec": "yes",
"last_update": "2024-04-09T14:08:12Z",
"downloads": "/home/jaandrle/bin/fedistar",
"version": "v1.9.3",
"glare": ".*amd64.*.AppImage"
},
{
"repository": "ollama/ollama",
"name": "ollama",
"description": "Get up and running with Llama 2 and other large language models locally",
"group": "ai",
"file_name": "ollama",
"exec": "yes",
"last_update": "2024-04-28T17:51:17Z",
"downloads": "/home/jaandrle/bin/ollama",
"version": "v0.1.33-rc5",
"glare": "linux-amd64"
},
{
"repository": "neovim/neovim",
"name": "neovim",
"tag_name_regex": "v.*",
"description": "Vim-fork focused on extensibility and usability",
"group": "skip",
"file_name": "nvim",
"exec": "yes",
"downloads": "/home/jaandrle/bin/nvim",
"version": "v0.9.5",
"last_update": "2023-12-30T13:31:47Z"
},
{
"repository": "viarotel-org/escrcpy",
"name": "Escrcpy",
"description": "📱 Graphical Scrcpy to display and control Android, devices powered by Electron. | 使用图形化的 Scrcpy 显示和控制您的 Android 设备,由 Electron 驱动。",
"group": "dev",
"file_name": "escrcpy",
"exec": "yes",
"last_update": "2024-04-28T02:36:35Z",
"downloads": "/home/jaandrle/bin/escrcpy",
"version": "v1.18.3",
"glare": ".*x86_64.*.AppImage"
},
{
"repository": "drovp/drovp",
"name": "drovp",
"description": "Desktop app for encoding, converting, upscaling, and much more.",
"group": "dev-test",
"file_name": "drovp",
"exec": "yes",
"last_update": "2023-12-06T11:30:02Z",
"downloads": "/home/jaandrle/bin/drovp",
"version": "0.8.0",
"glare": "x64.AppImage"
},
{
"repository": "janhq/jan",
"name": "Jan",
"description": "Jan is an open source alternative to ChatGPT that runs 100% offline on your computer",
"group": "ai",
"file_name": "jan",
"exec": "yes",
"last_update": "2024-04-25T06:07:39Z",
"downloads": "/home/jaandrle/bin/jan",
"version": "v0.4.12",
"glare": ".*x86_64.*.AppImage"
},
{
"repository": "Bin-Huang/chatbox",
"name": "Chatbox",
"description": "Chatbox is a desktop client for ChatGPT, Claude and other LLMs, available on Windows, Mac, Linux",
"group": "ai",
"file_name": "Chatbox",
"exec": "yes",
"last_update": "2024-04-18T08:15:47Z",
"downloads": "/home/jaandrle/bin/Chatbox",
"version": "v1.3.5",
"glare": ".*x86_64.*.AppImage"
}
]
}

View File

@ -1,8 +1,3 @@
[TabBox]
DesktopLayout=org.kde.breeze.desktop
DesktopListLayout=org.kde.breeze.desktop
LayoutName=org.kde.breeze.desktop
[Windows] [Windows]
Placement=Centered Placement=Centered

View File

@ -32,6 +32,22 @@
"--help", "--help",
"--version" "--version"
] ]
},
"§time.mjs": {
"npx": false,
"completions": {
"diff": [
"--unit"
],
"?": "diff",
"zone": [
"--z"
]
},
"completions_all": [
"--help",
"--version"
]
} }
} }
} }

View File

@ -1,8 +1,3 @@
/* --print/--echo aliases */
Reflect.defineProperty($, "nosed", { get(){ return this.stdin.text(""); }, });
Reflect.defineProperty($, "nojq", { get(){ return this.stdin.json(null); }, });
Reflect.defineProperty($, "noawk", { get(){ return this.stdin.lines([]); }, });
/* deprecated/fallback */ /* deprecated/fallback */
globalThis.cyclicLoop= function*(items){ globalThis.cyclicLoop= function*(items){
if(!items) items= 'win32'===process.platform ? '|/-\\' : "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏"; if(!items) items= 'win32'===process.platform ? '|/-\\' : "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏";
@ -16,3 +11,18 @@ globalThis.cyclicLoop= function*(items){
Reflect.defineProperty($, "clipboard", { Reflect.defineProperty($, "clipboard", {
get(){ return s.$().run`xclip -o -selection clipboard`; } get(){ return s.$().run`xclip -o -selection clipboard`; }
}) })
// /** Custom uncaughtException function */
// export const uncaughtException= console.log;
// /** Place for custom code when script starts */
// export function onscript(){}
/** Place for custom code when REPL starts (`--interactive`) */
export function onrepl(){
Reflect.defineProperty(s, "jq", { get(){ return file=> s.cat(file).xargs(JSON.parse); } });
}
/** Place for custom code when eval starts (`--eval`/`--print`) */
export function oneval(){ /* --print/--echo aliases */
Reflect.defineProperty($, "nosed", { get(){ return this.stdin.text(""); }, });
Reflect.defineProperty($, "nojq", { get(){ return this.stdin.json(null); }, });
Reflect.defineProperty($, "noawk", { get(){ return this.stdin.lines([]); }, });
}

4
.config/xremap.yml Normal file
View File

@ -0,0 +1,4 @@
keymap:
- name: Ctrl+tab alias
remap:
C-KEY_KPSLASH: C-KEY_TAB

View File

@ -17,7 +17,7 @@ set menu-complete-display-prefix on
"\e[A":history-search-backward "\e[A":history-search-backward
"\e[B":history-search-forward "\e[B":history-search-forward
"\e\C-e": history-and-alias-expand-line "OM": history-and-alias-expand-line
set colored-stats On set colored-stats On

View File

@ -3,7 +3,7 @@ AntiAliasFonts=true
BoldIntense=true BoldIntense=true
ColorScheme=DarkPastels ColorScheme=DarkPastels
DimmValue=54 DimmValue=54
Font=Ubuntu Mono,9,-1,5,75,0,0,0,0,0,Bold Font=Ubuntu Mono,9,-1,5,700,0,0,0,0,0,0,0,0,0,0,1,Bold
UseFontLineChararacters=false UseFontLineChararacters=false
[General] [General]
@ -12,4 +12,5 @@ Name=Můj
Parent=FALLBACK/ Parent=FALLBACK/
[Scrolling] [Scrolling]
HistoryMode=2
ScrollBarPosition=2 ScrollBarPosition=2

View File

@ -53,6 +53,7 @@ bind-key U show-urls
unbind-key ^B unbind-key ^B
bind-key m bookmark bind-key m bookmark
# TODO: replace with nocodb
bookmark-cmd "~/bin/pocket-sh-add.sh" bookmark-cmd "~/bin/pocket-sh-add.sh"
bookmark-autopilot yes bookmark-autopilot yes

View File

@ -7,19 +7,17 @@ https://www.youtube.com/feeds/videos.xml?channel_id=UCPeHT7xKjaw_-8hHW0GEXLg ! v
https://www.youtube.com/feeds/videos.xml?channel_id=UCD9L1HvpYpmZ8rrXABARCRQ ! video https://www.youtube.com/feeds/videos.xml?channel_id=UCD9L1HvpYpmZ8rrXABARCRQ ! video
https://www.youtube.com/feeds/videos.xml?channel_id=UCONH73CdRXUjlh3-DdLGCPw ! video https://www.youtube.com/feeds/videos.xml?channel_id=UCONH73CdRXUjlh3-DdLGCPw ! video
https://herohero.co/services/functions/rss-feed?token=eyJhbGciOiJSUzI1NiJ9.eyJ1IjoiYWpzbHV6YnlsdXh1dnlueSIsImMiOiJuYXBvdGl0a3V6d3VhdWhvZCIsInQiOjE2ODU2MDk1ODl9.LfJHvtdm4fPq25NCfoC5ZU6cPmZLRjXO2Xhl6fcG78j-8tjatznyBDQdKwKiMfdQMKK9peOkYAKyIXTBvjBBN9XJ9CKoOnAfIyHiBlyo200TWeG3Ll37U8LRN7So4npT4-Qr_FzZGSMYO_ispVL6Gj2HYfwYORq6-1t78v9k5Ke7up-w4aM4-jUXD3_Zdsu70jJV5-fEAM11pgkfh8HydW9vm_MvkZ1q1DSIRlZR8jQNQZgGWeYMjzF9owD00TQGUGsXGNH0lit-IhFX9_VFqG5so5i6ugv8AyCJK7g3B59YV6TsWVANtWN5NB_B3f-TXSE4Cs7tOZrU0riVxI-4Ew ! video https://herohero.co/services/functions/rss-feed?token=eyJhbGciOiJSUzI1NiJ9.eyJ1IjoiYWpzbHV6YnlsdXh1dnlueSIsImMiOiJuYXBvdGl0a3V6d3VhdWhvZCIsInQiOjE2ODU2MDk1ODl9.LfJHvtdm4fPq25NCfoC5ZU6cPmZLRjXO2Xhl6fcG78j-8tjatznyBDQdKwKiMfdQMKK9peOkYAKyIXTBvjBBN9XJ9CKoOnAfIyHiBlyo200TWeG3Ll37U8LRN7So4npT4-Qr_FzZGSMYO_ispVL6Gj2HYfwYORq6-1t78v9k5Ke7up-w4aM4-jUXD3_Zdsu70jJV5-fEAM11pgkfh8HydW9vm_MvkZ1q1DSIRlZR8jQNQZgGWeYMjzF9owD00TQGUGsXGNH0lit-IhFX9_VFqG5so5i6ugv8AyCJK7g3B59YV6TsWVANtWN5NB_B3f-TXSE4Cs7tOZrU0riVxI-4Ew ! video
https://www.youtube.com/feeds/videos.xml?channel_id=UCKlOmM_eB0nzTNiDFZibSSA !
"query:Sakitech Note/Update:title =~ \"(Note|Phones|phones)\" and title !~ \"(Wallpaper|wallpaper)\" and rssurl == \"https://www.youtube.com/feeds/videos.xml?channel_id=UCKlOmM_eB0nzTNiDFZibSSA\"" video
"exec:~/.newsboat/html2rss-streamCZ.mjs 'Kokoti na neděli' 'https://www.stream.cz/kokoti-na-nedeli'" ! video "exec:~/.newsboat/html2rss-streamCZ.mjs 'Kokoti na neděli' 'https://www.stream.cz/kokoti-na-nedeli'" ! video
"exec:~/.newsboat/html2rss-streamCZ.mjs 'Šťastné pondělí' 'https://www.stream.cz/stastne-pondeli'" ! "exec:~/.newsboat/html2rss-streamCZ.mjs 'Šťastné pondělí' 'https://www.stream.cz/stastne-pondeli'" !
"query:Šťastné pondělí:title =~ \"Šťastné pondělí\" and feedtitle == \"Šťastné pondělí\"" video "query:Šťastné pondělí:title =~ \"Šťastné pondělí\" and feedtitle == \"Šťastné pondělí\"" video
https://www.mall.tv/rssfeed/mikyrova-uzasna-pout-internetem ! video https://www.mall.tv/rssfeed/mikyrova-uzasna-pout-internetem ! video
"query:📹:tags # \"video\"" "query:📹:tags # \"video\""
https://nitter.cz/spreadmastodon/rss
https://www.mfcr.cz/cs/rss/vydali-jsme-k-hospodareni-statu ! stát https://www.mfcr.cz/cs/rss/vydali-jsme-k-hospodareni-statu ! stát
https://www.sporicidluhopisycr.cz/cs/rss/aktuality ! stát https://www.sporicidluhopisycr.cz/cs/rss/aktuality ! stát
https://nitter.cz/gov_cz/rss ! stát http://www.vlada.cz/cs/urad/RSS/rss.xml ! stát
https://mastodonczech.cz/@SpravedlnostCZ ! stát
https://zpravobot.news/@NUKIB_CZ ! stát
https://www.ceskezajmy.eu/feed/ ! stát https://www.ceskezajmy.eu/feed/ ! stát
https://poladprahu.cz/category/novinky/feed/ ! stát https://poladprahu.cz/category/novinky/feed/ ! stát
https://sdilenedomy.cz/feed/ ! stát https://sdilenedomy.cz/feed/ ! stát
@ -33,12 +31,13 @@ https://www.investigace.cz/feed/ ! news
https://denikn.cz/veda/feed?ref=inc ! news/science https://denikn.cz/veda/feed?ref=inc ! news/science
"query:Petr Koubský:author = \"Petr Koubský\"" news/science "query:Petr Koubský:author = \"Petr Koubský\"" news/science
https://vedator.org/feed/ ! news/science https://vedator.org/feed/ ! news/science
# TODO: https://www.threads.net/@vedator_cz
http://feeds.feedburner.com/Backreaction ! news/science http://feeds.feedburner.com/Backreaction ! news/science
https://www.osel.cz/rss/rss.php ! news/science https://www.osel.cz/rss/rss.php ! news/science
https://news.mit.edu/rss/feed ! news/science https://news.mit.edu/rss/feed ! news/science
https://news.mit.edu/rss/research ! news/science https://news.mit.edu/rss/research ! news/science
https://nautil.us/feed/ ! news/science https://nautil.us/feed/ ! news/science
https://nitter.cz/PatrikKorenar/rss ! news/science # ? tw PatrikKorenar → patreon, https://www.instagram.com/patrikkorenar
"query:📰🔬:tags # \"news/science\"" "query:📰🔬:tags # \"news/science\""
https://www.lupa.cz/rss/clanky/ ! news/tech https://www.lupa.cz/rss/clanky/ ! news/tech
@ -66,88 +65,45 @@ https://lemmy.ml/feeds/c/kde.xml?sort=Active ! lemmy
"query:📰👋💻💡 Lemmy:tags # \"lemmy\"" "query:📰👋💻💡 Lemmy:tags # \"lemmy\""
https://github.com/jordwalke.atom ! twitter/α https://github.com/jordwalke.atom ! twitter/α
# https://nitter.cz/ell2cz/rss ! twitter/α https://gts.eilhart.cz/@kayla.rss ! twitter/α
# https://nitter.cz/fieldsofmoab/rss ! twitter/α # TODO: https://www.threads.net/@annie.tumova
# https://nitter.cz/cztomsik/rss ! twitter/α # TODO: https://www.threads.net/@filip.titlbach
# https://nitter.cz/sw_samuraj/rss ! twitter/α https://www.youtube.com/feeds/videos.xml?channel_id=UCVHFbqXqoYvEWM1Ddxl0QDg ! twitter/α_hide
# https://nitter.cz/AndroidDev/rss ! twitter/α "query:#TheAndroidShow:title =~ \"^#TheAndroidShow\" and rssurl == \"https://www.youtube.com/feeds/videos.xml?channel_id=UCVHFbqXqoYvEWM1Ddxl0QDg\"" twitter/α
# https://nitter.cz/EduardStula/rss ! twitter/α # TODO: https://ubuntuunity.org/blog/
# https://nitter.cz/ubuntu_unity/rss ! twitter/α → ?https://ubuntuunity.org/blog/
https://blog.neon.kde.org/feed/ ! twitter/α https://blog.neon.kde.org/feed/ ! twitter/α
https://undinealmani.com/feed/ ! twitter/α https://undinealmani.com/feed/ ! twitter/α
# https://nitter.cz/erikengheim/rss ! twitter/α https://techhub.social/@erikengheim ! twitter/α
# https://nitter.cz/LeaVerou/rss ! twitter/α https://bird.makeup/users/jpschroeder.rss ! twitter/α
# https://nitter.cz/jpschroeder/rss ! twitter/α # TODO: @jpschroeder@fosstodon.org
# https://nitter.cz/machal/rss ! twitter/α https://mastodon.social/@firt.rss ! twitter/α
# https://nitter.cz/devgirlFL/rss ! twitter/α
# https://nitter.cz/maxiorel/rss ! twitter/α
# https://nitter.cz/firt/rss ! twitter/α
https://princiya.com/newblog/feeds/all.atom.xml ! twitter/α https://princiya.com/newblog/feeds/all.atom.xml ! twitter/α
https://davidwalsh.name/feed ! twitter/α https://davidwalsh.name/feed ! twitter/α
# https://nitter.cz/jakubvrana/rss ! twitter/α
https://jecas.cz/rss ! twitter/α https://jecas.cz/rss ! twitter/α
# JanKoWeb geekovo zdrojak # JanKoWeb geekovo zdrojak
"query:📰👋💻💡 Twitter/α:tags # \"twitter/α\"" "query:📰👋💻💡 Twitter/α:tags # \"twitter/α\""
# https://nitter.cz/Zeptej_se_vedce/rss ! twitter/mixed # TODO: https://www.threads.net/@Zeptej_se_vedce
# https://nitter.cz/Olinium42/rss ! twitter/mixed # TODO: https://www.threads.net/@oliniumchemistry
# # TODO: https://www.threads.net/@narodnitymzen
https://nitter.cz/narodnitymzen/rss ! twitter/mixed https://mindly.social/@adrianacerna.rss ! twitter/mixed
# https://nitter.cz/Julianne_SF/rss ! twitter/α https://olgarichterova.cz/feed/ ! twitter/mixed
#!
https://nitter.cz/_Case/rss ! twitter/α
#!
https://nitter.cz/olgarichterova/rss ! twitter/mixed
# https://nitter.cz/eicul/rss ! twitter/mixed
# https://nitter.cz/CO2IN/rss ! twitter/mixed
#
https://nitter.cz/Iluminator_cz/rss ! twitter/mixed
https://faktaoklimatu.cz/feed.xml ! twitter/mixed https://faktaoklimatu.cz/feed.xml ! twitter/mixed
#? https://www.youtube.com/feeds/videos.xml?channel_id=UCtYxnvekc2-3P74TdLx0srQ ! twitter/mixed
https://nitter.cz/anna_gumplova/rss ! twitter/mixed https://kill-the-newsletter.com/feeds/c6e1z94wpw0eds67.xml ! twitter/mixed
#? https://kill-the-newsletter.com/feeds/39xfn7p1cvf8dif4.xml ! twitter/mixed
https://nitter.cz/DearAbbyHansen/rss ! twitter/mixed https://kill-the-newsletter.com/feeds/5tww0ecg9y4twnxz.xml ! twitter/mixed
# https://nitter.cz/FZU_AVCR/rss ! twitter/mixed https://mastodonczech.cz/@ewajelinek ! twitter/mixed
#! # TODO: https://www.threads.net/@claireklingenberg
https://nitter.cz/_A_d_e_l_k_a_/rss ! twitter/mixed # TODO: https://www.threads.net/@pavlahubalkova
#! # TODO: https://www.threads.net/@popdetective
https://nitter.cz/TGuthJarkovsky/rss ! twitter/mixed https://zpravobot.news/@dan_prokop.rss ! twitter/mixed
# https://nitter.cz/ClaireAccendit/rss ! twitter/mixed
# https://nitter.cz/PavlaHub/rss ! twitter/mixed
# https://nitter.cz/laurencikova_k/rss ! twitter/mixed
# https://popculturedetective.tumblr.com/rss twitter/mixed
#!
https://nitter.cz/dan_prokop/rss ! twitter/mixed
https://www.paqresearch.cz/blog-feed.xml ! twitter/mixed https://www.paqresearch.cz/blog-feed.xml ! twitter/mixed
#!
https://nitter.cz/danusenerudova/rss ! twitter/mixed
#!
https://nitter.cz/Akademie_ved_CR/rss ! twitter/mixed
#!
https://nitter.cz/glacier_ecology/rss ! twitter/mixed
https://archetypal.cz/feed/ ! twitter/mixed https://archetypal.cz/feed/ ! twitter/mixed
# https://nitter.cz/MarieHermanova/rss ! twitter/mixed # TODO: https://www.threads.net/@mariehermanova
# https://nitter.cz/NKC_CZ/rss ! twitter/mixed https://kill-the-newsletter.com/feeds/xmub9gn72ecekvbi.xml ! twitter/mixed
#!
https://nitter.cz/lkristoufek/rss ! twitter/mixed
# https://nitter.cz/OSAliance/rss ! twitter/mixed
# https://nitter.cz/Madla_G/rss ! twitter/mixed
# https://nitter.cz/matfyz/rss ! twitter/mixed
#!
https://nitter.cz/Mitokochan/rss twitter/mixed
https://www.mimoagendu.cz/rss/ ! twitter/mixed https://www.mimoagendu.cz/rss/ ! twitter/mixed
# https://nitter.cz/malyvedec/rss ! twitter/mixed # TODO: https://www.threads.net/@barasoukup
#!
https://nitter.cz/kasikp/rss ! twitter/mixed
# https://nitter.cz/CERN/rss ! twitter/mixed
# https://nitter.cz/josefslerka/rss ! twitter/mixed
# https://nitter.cz/hassmanm/rss ! twitter/mixed
#!
https://nitter.cz/marenamat/rss ! twitter/mixed
# https://nitter.cz/traintravels42/rss ! twitter/mixed
https://nitter.cz/JulieMontek/rss ! twitter/mixed
#
https://nitter.cz/bara_soukup/rss ! twitter/mixed
# PulseofEuropeCZ KohoVolitEU # PulseofEuropeCZ KohoVolitEU
"query:📰👋💻💡 Twitter/mixed:tags # \"twitter/mixed\"" "query:📰👋💻💡 Twitter/mixed:tags # \"twitter/mixed\""
@ -159,21 +115,13 @@ https://denikn.cz/tag/vylety-n/feed/ ! newsletters
https://denikn.cz/tag/evropska-unie/feed/ ! newsletters https://denikn.cz/tag/evropska-unie/feed/ ! newsletters
"query:🗞️📰💡 Newsletters:tags # \"newsletters\"" "query:🗞️📰💡 Newsletters:tags # \"newsletters\""
# https://nitter.cz/randomMDN/rss dev/servises
# "exec:randomMDN rss --limit 3" dev/servises
https://botsin.space/@randomMDN.rss dev/servises https://botsin.space/@randomMDN.rss dev/servises
https://github.com/evanw/esbuild/releases.atom ! dev/servises https://github.com/evanw/esbuild/releases.atom ! dev/servises
https://bun.sh/rss.xml ! dev/servises https://bun.sh/rss.xml ! dev/servises
https://www.githubstatus.com/history.rss ! dev/servises https://www.githubstatus.com/history.rss ! dev/servises
# https://nitter.cz/GitHubSecurity/rss ! dev/servises
https://developer.apple.com/news/rss/news.rss "~Apple Dev News" dev/servises https://developer.apple.com/news/rss/news.rss "~Apple Dev News" dev/servises
# https://nitter.cz/JetBrains_Fleet/rss ! dev/servises → ?https://blog.jetbrains.com/feed/
# https://nitter.cz/NativeScript/rss ! dev/servises
# https://nitter.cz/sveltejs/rss ! dev/servises
# https://nitter.cz/github/rss ! dev/servises
https://cordova.apache.org/feed.xml ! twitter/α https://cordova.apache.org/feed.xml ! twitter/α
https://www.mozilla.cz/feed/ ! twitter/α https://www.mozilla.cz/feed/ ! twitter/α
#! https://nitter.cz/janovsky/rss ! twitter/α
# https://www.githubstatus.com/history.rss ! dev/servises # https://www.githubstatus.com/history.rss ! dev/servises
"query:⌨🖱:tags # \"dev/servises\"" "query:⌨🖱:tags # \"dev/servises\""
@ -223,3 +171,42 @@ http://casopisargument.cz/?feed=rss2 ! news/rest
https://www.seznamzpravy.cz/rss ! rest https://www.seznamzpravy.cz/rss ! rest
"query:🗞 💤:tags # \"rest\"" "query:🗞 💤:tags # \"rest\""
# TODO: https://www.threads.net/@pirativanbartos
https://mastodonczech.cz/@jantvrdon.rss ! mastodon/neak
https://mastodonczech.cz/@eliska.rss ! mastodon/neak
https://mastodon.rozhlas.cz/@kristinarohackova.rss ! mastodon/neak
https://mastodon.social/@Prof_Mirya.rss ! mastodon/neak
https://mastodonczech.cz/@NAKIT.rss ! mastodon/neak
https://mastodonczech.cz/@strakovka.rss ! mastodon/neak
https://mastodonczech.cz/@SpravedlnostCZ.rss ! mastodon/neak
https://witter.cz/@petrinfinite.rss ! mastodon/neak
https://mastodonczech.cz/@danusenerudova.rss ! mastodon/neak
# TODO: https://www.threads.net/@danusenerudova
https://witter.cz/@Apolenarychlikova.rss ! mastodon/neak
# TODO: https://www.threads.net/@apolenarychlikova
https://mastodonczech.cz/@marekl.rss ! mastodon/neak
https://mastodon.social/@spreadmastodon.rss ! mastodon/neak
https://mastodon.pirati.cz/@OlgaRichterova.rss ! mastodon/neak
# TODO: https://www.threads.net/@olga_piratka_richterova
https://witter.cz/@zeleni.rss ! mastodon/neak
https://mastodonczech.cz/@Lenislavka.rss ! mastodon/neak
https://witter.cz/@guth.rss ! mastodon/neak
# TODO: https://www.threads.net/@tgjarkovsky
https://mastodonczech.cz/@madla.rss ! mastodon/neak
# TODO: https://www.threads.net/@madla__g
https://witter.cz/@malyvedec.rss ! mastodon/neak
# TODO: https://www.threads.net/@malyvedec
"query:🗞 🐘:tags # \"mastodon/neak\""
# TW bez náhrady:
# fieldsofmoab, machal, devgirlFL,
# jakubvrana, _Case, eicul,
# CO2IN, Iluminator_cz, DearAbbyHansen,
# _A_d_e_l_k_a_, ClaireAccendit, laurencikova_k,
# PopDetective, dan_prokop, danusenerudova,
# glacier_ecology, MarieHermanova, lkristoufek,
# matfyz, Mitokochan, kasikp,
# CERN, josefslerka, traintravels42,
# JulieMontek, bara_soukup, janovsky

View File

@ -12,6 +12,7 @@ let g:user_tips_list= [
\ 'packadd cfilter', \ 'packadd cfilter',
\ 'Next word location → ]I [I ]<c-I> [<c-I> … <leader>]I <leader>[I', \ 'Next word location → ]I [I ]<c-I> [<c-I> … <leader>]I <leader>[I',
\ ':w !sudo tee > /dev/null %', \ ':w !sudo tee > /dev/null %',
\ 'v`]o`[ visual last change — https://www.reddit.com/r/vim/comments/ypt6uf/comment/ivl68xu/?utm_source=share&utm_medium=web2x&context=3',
\ '`0·`"·`.·`` … last exit·edit·change·pre-jump … also g''*', \ '`0·`"·`.·`` … last exit·edit·change·pre-jump … also g''*',
\ 'q: q? q/ … @: ?<cr> /<cr> :&<cr> , ;', \ 'q: q? q/ … @: ?<cr> /<cr> :&<cr> , ;',
\ '<c-n><c-p> <c-x><c-l> <c-x><c-f> … :h ins-completion', \ '<c-n><c-p> <c-x><c-l> <c-x><c-f> … :h ins-completion',

4
.vimrc
View File

@ -250,10 +250,6 @@
nnoremap <s-k> a<cr><esc> nnoremap <s-k> a<cr><esc>
for l in [ 'y', 'p', 'P', 'd' ] | for m in [ 'n', 'v' ] for l in [ 'y', 'p', 'P', 'd' ] | for m in [ 'n', 'v' ]
execute m.'noremap <leader>'.l.' "+'.l | endfor | endfor execute m.'noremap <leader>'.l.' "+'.l | endfor | endfor
" ik ak (last change pseudo-text objects) src: https://www.reddit.com/r/vim/comments/ypt6uf/comment/ivl68xu/?utm_source=share&utm_medium=web2x&context=3
xnoremap ik `]o`[
onoremap ik :<C-u>normal vik<cr>
onoremap ak :<C-u>normal vikV<cr>
" FOLDS " FOLDS
command! -nargs=0 SETFOLDregions set foldmethod=marker command! -nargs=0 SETFOLDregions set foldmethod=marker
command! -nargs=1 SETFOLDindent set foldmethod=indent | let &foldlevel=<q-args> | let &foldnestmax=<q-args>+1 command! -nargs=1 SETFOLDindent set foldmethod=indent | let &foldlevel=<q-args> | let &foldnestmax=<q-args>+1

View File

@ -1,26 +1,27 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bing Image Of The Day</title> <title>Bing Image Of The Day</title>
<style> <style>
body{ display: flex; flex-flow: row nowrap; body{ display: flex; flex-flow: row nowrap;
width: 100vw; height: 100vh; overflow: hidden; margin: 0; width: 100vw; height: 100vh; overflow: hidden; margin: 0;
} }
div{ position: relative; flex: 1; } div{ position: relative; flex: 1; }
img{ height: 100%; width: 100%; object-fit: contain; } img{ height: 100%; width: 100%; object-fit: cover; }
.detail{ position: absolute; bottom: 0; left: 0; padding: .5rem 1rem; .detail{ position: absolute; bottom: 0; left: 0; padding: .5rem 1rem;
text-align: center; background: rgba(0, 0, 0, .35); color: whitesmoke; } max-width: 35ch;
.prev .detail{ left: initial; right: 0; } text-align: center; background: rgba(0, 0, 0, .35); color: whitesmoke; }
@media screen and (max-aspect-ratio: 16/9){ .prev .detail{ left: initial; right: 0; }
.prev{display: none;} @media screen and (max-aspect-ratio: 16/9){
} .prev{display: none;}
</style> }
</style>
</head> </head>
<body> <body>
<div class="now"> <img src="now.jpg"> <div class="detail">::now::</div> </div> <div class="now"> <img src="now.jpg"> <div class="detail">::now::</div> </div>
<div class="prev"> <img src="prev.jpg"> <div class="detail">::prev::</div> </div> <div class="prev"> <img src="prev.jpg"> <div class="detail">::prev::</div> </div>
</body> </body>
</html> </html>

View File

@ -25,7 +25,7 @@ see for example [How to Store Dotfiles - A Bare Git Repository \| Atlassian Git
## On a new machine ## On a new machine
1. install git 1. install git
1. `cd ~` 1. `cd ~`
1. `gd_branch=main` 1. `gd_branch=main` (see also variants `main-termux`)
1. `git clone --bare --branch $gd_branch --depth 1 --recurse-submodules --shallow-submodules git@jaandrle.cz:jaandrle/dotfiles.git ~/.dotfiles` 1. `git clone --bare --branch $gd_branch --depth 1 --recurse-submodules --shallow-submodules git@jaandrle.cz:jaandrle/dotfiles.git ~/.dotfiles`
1. `alias gitdotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"'` 1. `alias gitdotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"'`
1. `gitdotfiles config --local status.showUntrackedFiles no` 1. `gitdotfiles config --local status.showUntrackedFiles no`
@ -34,23 +34,48 @@ see for example [How to Store Dotfiles - A Bare Git Repository \| Atlassian Git
1. `gitdotfiles checkout -f` 1. `gitdotfiles checkout -f`
1. `gitdotfiles submodule update --init --recursive` 1. `gitdotfiles submodule update --init --recursive`
## KDE Neon
- [KDE Plasma5 Fixes](https://zren.github.io/kde/)
- Using HTML Wallpaper (wip)
- [Bing Image Of The Day](./Obrázky/Bing Image Of The Day/index_template.html)
- [GNOME Keyring in KDE Plasma - JWillikers](https://www.jwillikers.com/gnome-keyring-in-kde-plasma)
- `sudo apt install $(check-language-support)`, see [Popup Language support is incomplete](http://unix.stackexchange.com/questions/421066/ddg#421079)
- [KDE Neon does not have an hibernation option? : kde](https://www.reddit.com/r/kde/comments/6n5m49/kde_neon_does_not_have_an_hibernation_option/dk7hd8v/)
- [kde plasma 5 - How to use miracast as an extended desktop on Linux? - Super User](https://superuser.com/questions/1160078/how-to-use-miracast-as-an-extended-desktop-on-linux)
- [Best tiling extensions for kwin? : kde](https://www.reddit.com/r/kde/comments/qgsv2u/best_tiling_extensions_for_kwin/?sort=new)
- [KDE Plasma5 Fixes](https://zren.github.io/kde/)
- [Setup git on the CLI to use 2FA with GitHub](https://gist.github.com/ateucher/4634038875263d10fb4817e5ad3d332f)
- [G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing - Main](https://gmic.eu/)
## PC log (cs) ## PC log (cs)
Sekce obsahuje log změn v Tuxedo laptopu s KDE Neon. Sekce obsahuje log změn v Tuxedo laptopu s KDE Neon.
- [Aloxaf/silicon: Create beautiful image of your source code.](https://github.com/Aloxaf/silicon) {DONE <2024-03-07> *utils* agenda}$
### KDE Neon 6.0 (22.04)
{NEXT <2024-03-20> *tilling* *hud* *html-wallpaper* *virtual-desktop* *klipper* agenda}$
- mostly OK
- [ ] Kup is missing in Settings (only restore files option is available): *investigation → report a bug*
- [ ] !!! Event calendar widget (in progress [ALikesToCode/plasma-applet-eventcalendar at plasma-6](https://github.com/ALikesToCode/plasma-applet-eventcalendar/tree/plasma-6))
- [ ] tilling → try to use native, try to use [zeroxoneafour/polonium: Tiling window manager for KWin 5.27](https://github.com/zeroxoneafour/polonium) (when there will be a new release)
- [ ] WIP: hud ([uszie/plasma-hud), in KDE Plasma.](https://github.com/uszie/plasma-hud)/[Zren/plasma-hud](https://github.com/Zren/plasma-hud) still works on X11), but maybe Ctrl+Alt+i and so on is OK?
- testing to use command palletes in programs and sets shortcuts to `ctr+;` (✓ kde programs, ✓ gimp, ✓ libreoffice, ✓ inkscape, ✓ vscode)
- [ ] [Fingerprint reader support : r/tuxedocomputers](https://www.reddit.com/r/tuxedocomputers/comments/176fscp/fingerprint_reader_support/), still receiving “no match”
- [ ] [Clipboard support in Wayland · Issue #5157 · vim/vim](https://github.com/vim/vim/issues/5157#issuecomment-776008833)
- [ ] partially FIXED by update: Wayland go to sleep even the external monitor is connected (HDMI)
- *→ seems to be this issue [438716 Lid close leads to suspend even when external monitor is attached](https://bugs.kde.org/show_bug.cgi?id=438716)*
- needs to keyboard/mouse imput to intterupt the go sleep process
- [x] [PSA: How to re-enable LibreOffice integration in Plasma 6 : r/kde](https://www.reddit.com/r/kde/comments/1b9k755/psa_how_to_reenable_libreoffice_integration_in/)
- [x] FIXED by update: ~desktop exceptionally freeze for less than a second: *investigation → report a bug*~
- [x] FIXED by update: ~logout/poweroff dialog not showing and not working: *investigation → report a bug* … see below~
- [x] krunner not launching → created `/usr/share/dbus-1/services/org.kde.krunner.service` (see below)
- [x] meta+tab (last virtual desktop) → workaround [./bin/kde6-workarounds.mjs](./bin/kde6-workarounds.mjs)
- [x] klipper (edit last item) → workaround [./bin/kde6-workarounds.mjs](./bin/kde6-workarounds.mjs)
- [x] Active Window Control replaced with Window Title widget and its better
- [x] FIXED by widget update: ~html wallpaper → workaround just concat images (see [./bin/§wallpaper\_BIOTD](./bin/§wallpaper_BIOTD))~
- [x] ctrl+tab using [k0kubun/xremap: Key remapper for X11 and Wayland](https://github.com/k0kubun/xremap) and `sudo crontab -e`+`@reboot` and [./.config/xremap.yml](./.config/xremap.yml)
- [ ] [`npx npmkill` — Why are node_modules SO BIG 🤦‍♂️ #javascript #software #technology #code #webdev - YouTube](https://www.youtube.com/shorts/VgPNtow7fNM?app=desktop&si=Kl7CH3vCoyH7tqFU)
```bash
qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout 1
Cannot find 'org.kde.KSMServerInterface.logout' in object /KSMServer at org.kde.ksmserver
```
[KDE Bugtracking System Main Page](https://bugs.kde.org/)
```ini
[D-BUS Service]
Name=org.kde.krunner
Exec=/usr/bin/krunner
```
### KDE neon 5.26 (22.04) ### KDE neon 5.26 (22.04)
{DONE <2022-10-25 17:21> *mail* *hud* *klíčenka* agenda}$ {DONE <2022-10-25 17:21> *mail* *hud* *klíčenka* agenda}$
@ -80,9 +105,18 @@ Sekce obsahuje log změn v Tuxedo laptopu s KDE Neon.
Postupováno podle návodu [Rename the `~/.local/lib/python3.8/site-packages/pkg_resources` folder to `pkg_resources_back`](https://askubuntu.com/a/1398073). Postupováno podle návodu [Rename the `~/.local/lib/python3.8/site-packages/pkg_resources` folder to `pkg_resources_back`](https://askubuntu.com/a/1398073).
### kwin-tiling ### KDE Neon
- https://gitlab.com/faho/kwin-tiling/ - [KDE Plasma5 Fixes](https://zren.github.io/kde/)
- Using HTML Wallpaper (wip)
- [Bing Image Of The Day](./Obrázky/Bing Image Of The Day/index_template.html)
- [GNOME Keyring in KDE Plasma - JWillikers](https://www.jwillikers.com/gnome-keyring-in-kde-plasma)
- `sudo apt install $(check-language-support)`, see [Popup Language support is incomplete](http://unix.stackexchange.com/questions/421066/ddg#421079)
- [KDE Neon does not have an hibernation option? : kde](https://www.reddit.com/r/kde/comments/6n5m49/kde_neon_does_not_have_an_hibernation_option/dk7hd8v/)
- [kde plasma 5 - How to use miracast as an extended desktop on Linux? - Super User](https://superuser.com/questions/1160078/how-to-use-miracast-as-an-extended-desktop-on-linux)
- [Best tiling extensions for kwin? : kde](https://www.reddit.com/r/kde/comments/qgsv2u/best_tiling_extensions_for_kwin/?sort=new), https://gitlab.com/faho/kwin-tiling/
- [KDE Plasma5 Fixes](https://zren.github.io/kde/)
- [Setup git on the CLI to use 2FA with GitHub](https://gist.github.com/ateucher/4634038875263d10fb4817e5ad3d332f)
- [G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing - Main](https://gmic.eu/)
<details> <details>
<summary>`{… cmd}$` explanation</summary> <summary>`{… cmd}$` explanation</summary>

View File

@ -7,9 +7,9 @@
"file_name": "github-desktop", "file_name": "github-desktop",
"exec": "yes", "exec": "yes",
"description": "Fork of GitHub Desktop to support various Linux distributions", "description": "Fork of GitHub Desktop to support various Linux distributions",
"last_update": "2023-12-20T15:25:06Z", "last_update": "2024-03-31T17:49:36Z",
"downloads": "/home/jaandrle/bin/github-desktop", "downloads": "/home/jaandrle/bin/github-desktop",
"version": "release-3.3.6-linux3" "version": "release-3.3.12-linux2"
}, },
{ {
"repository": "jaandrle/jaaCSS-cli", "repository": "jaandrle/jaaCSS-cli",
@ -29,9 +29,9 @@
"group": "nondev", "group": "nondev",
"file_name": "youtube-music", "file_name": "youtube-music",
"exec": "yes", "exec": "yes",
"last_update": "2024-01-05T14:44:27Z", "last_update": "2024-03-26T10:58:44Z",
"downloads": "/home/jaandrle/bin/youtube-music", "downloads": "/home/jaandrle/bin/youtube-music",
"version": "v3.2.2" "version": "v3.3.5"
}, },
{ {
"repository": "ArchGPT/insomnium", "repository": "ArchGPT/insomnium",
@ -93,8 +93,8 @@
{ {
"repository": "dynobo/normcap", "repository": "dynobo/normcap",
"name": "NormCap", "name": "NormCap",
"description": "OCR powered screen-capture tool to capture information instead of images", "description": "Switched to flatpak version | OCR powered screen-capture tool to capture information instead of images",
"group": "nondev", "group": "skip",
"file_name": "normcap", "file_name": "normcap",
"exec": "yes", "exec": "yes",
"last_update": "2023-12-12T22:23:37Z", "last_update": "2023-12-12T22:23:37Z",
@ -108,9 +108,9 @@
"group": "nondev", "group": "nondev",
"file_name": "upscayl", "file_name": "upscayl",
"exec": "yes", "exec": "yes",
"last_update": "2024-01-16T09:54:25Z", "last_update": "2024-02-29T16:31:09Z",
"downloads": "/home/jaandrle/bin/upscayl", "downloads": "/home/jaandrle/bin/upscayl",
"version": "v2.9.8" "version": "v2.10.0"
}, },
{ {
"repository": "RasmusLindroth/tut", "repository": "RasmusLindroth/tut",
@ -141,9 +141,9 @@
"group": "dev", "group": "dev",
"file_name": "bs", "file_name": "bs",
"exec": "yes", "exec": "yes",
"last_update": "2023-06-30T07:48:58Z", "last_update": "2024-03-28T13:16:41Z",
"downloads": "/home/jaandrle/bin/bs", "downloads": "/home/jaandrle/bin/bs",
"version": "v0.7.3" "version": "v0.7.4"
}, },
{ {
"repository": "h3poteto/fedistar", "repository": "h3poteto/fedistar",
@ -152,9 +152,9 @@
"group": "nondev", "group": "nondev",
"file_name": "fedistar", "file_name": "fedistar",
"exec": "yes", "exec": "yes",
"last_update": "2024-01-29T10:29:58Z", "last_update": "2024-03-29T15:39:36Z",
"downloads": "/home/jaandrle/bin/fedistar", "downloads": "/home/jaandrle/bin/fedistar",
"version": "v1.8.3" "version": "v1.9.2"
}, },
{ {
"repository": "ollama/ollama", "repository": "ollama/ollama",
@ -163,9 +163,9 @@
"group": "ai", "group": "ai",
"file_name": "ollama", "file_name": "ollama",
"exec": "yes", "exec": "yes",
"last_update": "2024-01-26T18:19:36Z", "last_update": "2024-03-10T02:24:04Z",
"downloads": "/home/jaandrle/bin/ollama", "downloads": "/home/jaandrle/bin/ollama",
"version": "v0.1.22" "version": "v0.1.29"
}, },
{ {
"repository": "neovim/neovim", "repository": "neovim/neovim",
@ -186,9 +186,9 @@
"group": "dev", "group": "dev",
"file_name": "escrcpy", "file_name": "escrcpy",
"exec": "yes", "exec": "yes",
"last_update": "2023-12-27T01:18:21Z", "last_update": "2024-03-29T03:30:14Z",
"downloads": "/home/jaandrle/bin/escrcpy", "downloads": "/home/jaandrle/bin/escrcpy",
"version": "v1.16.8" "version": "v1.17.8"
}, },
{ {
"repository": "drovp/drovp", "repository": "drovp/drovp",
@ -208,9 +208,31 @@
"group": "ai", "group": "ai",
"file_name": "jan", "file_name": "jan",
"exec": "yes", "exec": "yes",
"last_update": "2024-01-29T05:19:22Z", "last_update": "2024-03-11T06:34:40Z",
"downloads": "/home/jaandrle/bin/jan", "downloads": "/home/jaandrle/bin/jan",
"version": "v0.4.5" "version": "v0.4.8"
},
{
"repository": "Bin-Huang/chatbox",
"name": "Chatbox",
"description": "Chatbox is a desktop client for ChatGPT, Claude and other LLMs, available on Windows, Mac, Linux",
"group": "ai",
"file_name": "Chatbox",
"exec": "yes",
"last_update": "2024-03-15T15:58:59Z",
"downloads": "/home/jaandrle/bin/Chatbox",
"version": "v1.3.1"
},
{
"repository": "Helium314/HeliBoard",
"name": "HeliBoard",
"description": "Customizable and privacy-conscious open-source keyboard",
"group": "android",
"file_name": "heliboard.apk",
"exec": "no",
"last_update": "2024-03-31T20:11:03Z",
"downloads": "/home/jaandrle/bin/heliboard.apk",
"version": "v1.0"
} }
] ]
} }

231
bin/github-releases.mjs Executable file
View File

@ -0,0 +1,231 @@
#!/usr/bin/env nodejsscript
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */
// "\x1b[38;2;150;150;150m"
// https://talyian.github.io/ansicolors/
/**
* Represents a package record stored locally
*
* @typedef ConfigPackage
* @type {Object}
* @property {string} repository - Repo in the form `<owner>/<repo>`
* @property {string} name - Name/Identifier
* @property {string} description - A description of the repo/package
* @property {string} file_name - The name of the file as stored locally
* @property {"yes"|"no"} exec - Whether the file is executable
* @property {string} last_update - The date and time of the last update
* @property {string} downloads - The path to the file
* @property {string} version - The version of the file
* @property {string} tag_name_regex - Filter only matching releases
* */
/**
* @typedef Config
* @type {{ packages: ConfigPackage[] }}
* */
/**
* Represents a GitHub release information.
*
* @typedef {Object} GitHubRelease
* @property {number} id - The ID of the GitHub release.
* @property {string} url - The URL of the GitHub release.
* @property {string} assets_url - The URL of the assets associated with the GitHub release.
* @property {string} html_url - The HTML URL of the GitHub release.
* @property {string} tag_name - The tag name of the GitHub release.
* @property {string} published_at - The publication date of the GitHub release.
*/
import { join } from "node:path";
const path_config= $.xdg.config`github-releases`;
const path_config_json= join(path_config, "config.json");
const path_config_lock= join(path_config, "lock");
const path_temp= $.xdg.temp`github-releases.json`;
const url_api= "https://api.github.com/repos/";
const url_download= "https://glare.now.sh/"; // https://github.com/Contextualist/glare
const css= echo.css`
.pkg { color: lightcyan; }
.ok { color: lightgreen; }
.err { color: lightred; }
.skip { color: red; color: gray; }
.spin { display: list-item; list-style: --terminal-spin; }
`;
$.api()
.version("2.0.0")
.describe("Helper for working with “packages” stored in GitHub releases.")
.command("config [mode]", [ "Config (file), use `mode` with these options:",
"- `edit`: opens config file in terminal editor using `$EDITOR` (defaults to vim)",
"- `path`: prints path to config file"
])
.action(async function(mode= "path"){
switch(mode){
case "path": echo(path_config_json); break;
case "edit":
const editor= $.env.EDITOR || "vim";
await s.runA`${editor} ${path_config_json}`.pipe(process.stdout);
break;
default:
echo(`Unknown mode: '${mode}'. See '--help' for details.`);
}
$.exit(0);
})
.command("ls", [ "Lists registered packages",
"Repositories marked with `-` signifies that the package is in the 'skip' group.",
"These are registered by this script but not managed by it (updates, etc).",
"Repositories marked with `+` signify that updates of the package are checked."
])
.option("--group, -G", "Filter by group")
.option("--repository, -R", "Filter by repository")
.action(function(filter){
const config = readConfig();
for(const { repository, version, description, group } of grepPackages(config, filter))
if(group!=="skip")
echo(`+ %c${repository}%c@${version ? version : "—"}: %c${description}`, css.pkg, css.unset, css.skip);
else
echo(`- %c${repository}: ${description}`, css.skip);
$.exit(0);
})
.command("check", "Shows/checks updates for registered packages")
.option("--group, -G", "Filter by group")
.option("--repository, -R", "Filter by repository")
.option("--cache", "Use cache [yes, no]", "yes")
.action(async function({ cache, ...filter }){
const config = readConfig();
const results= await check(grepPackages(config, filter), cache);
for(const { status, value } of results)
echoPkgStatus(status, value);
if(!results.length) echo("Nothing to do.");
$.exit(0);
})
.command("update", "Updates registered packages")
.option("--group, -G", "Filter by group")
.option("--repository, -R", "Filter by repository")
.action(async function(filter){
if(s.test("-f", path_config_lock))
return $.error(`The lock file '${path_config_lock}' already exists! Check if some other instance is running.`);
s.touch(path_config_lock);
const config = readConfig();
const results= await check(grepPackages(config, filter));
const start= Date.now();
let done= 0;
let todo= [];
echo("Collecting packages to update…");
for(const { status, value } of results){
if(status!==3 || value.local.group==="skip") continue;
echo("%c"+value.local.repository, css.pkg);
todo.push(download(
value,
()=> done+= 1,
config.target
));
}
const { length }= todo;
if(!length){
echo("%cAll up-to-date!%c Nothing to do.", css.ok);
} else {
const id= setInterval(()=>
echo.use("-R", `%cUpdating packages (${done}/${length})`, css.spin), 500);
const updates= await Promise.allSettled(todo);
clearInterval(id);
echo("Updating packages completed:");
for (const { status, value, reason } of updates) {
if(status==="rejected"){
echo("%c✗ "+reason.local.repository+": %c"+reason.err, css.err);
continue;
}
const { local, remote }= value;
echo("%c✓ "+local.repository+"%c@"+remote.tag_name, css.ok, css.skip);
}
s.echo(JSON.stringify(config, null, "\t")).to(path_config_json);
}
s.rm(path_config_lock);
$.exit(0);
})
.parse();
import { createWriteStream } from "node:fs";
async function download(value, onprogress, target){
const { repository, glare }= value.local;
const { tag_name }= value.remote;
if(!glare) return Promise.reject({ err: "Missing 'glare' in config.", ...value });
const response= await fetch(url_download+repository+`@${tag_name}/${glare}`);
const buffer= Buffer.from(await response.arrayBuffer());
const downloads= target+value.local.file_name;
const ws= createWriteStream(downloads, { flags: "w" });
ws.write(buffer);
Object.assign(value.local, {
last_update: value.remote.published_at,
version: value.remote.tag_name,
downloads
});
if(value.local.exec==="yes")
s.chmod("+x", downloads);
onprogress();
return value;
}
function grepPackages({ packages }, { group, repository }){
const f= {};
let is_filter= false;
if(group){ is_filter= true; f.group= group; }
if(repository){ is_filter= true; f.repository= repository; }
if(!is_filter) return packages;
return packages.filter(r=> Object.keys(f).every(k=> r[k]===f[k]));
}
function echoPkgStatus(status, { local, remote }){
let status_css, status_text;
if(local.group==="skip"){
status_text= "skipped";
status_css= "skip";
} else {
status_text= status===3 ? "outdated" : "up-to-date";
status_css= status===3 ? "err" : "ok";
}
echo((status_text==="outdated" ? "+" : "-") + " %c"+local.repository + "%c: %c"+status_text+"%c (%c"+remote.tag_name+"%c)",
css.pkg, css.unset, css[status_css], css.unset, css.skip, css.unset);
}
/**
* @param {Config.packages} packages
* @return {{ status: 0|1|2|3, value: { remote: GitHubRelease, local: ConfigPackage } }}
* */
async function check(packages, cache){
return (await pipe(
ps=> ps.map(p=> fetchRelease(p, cache).then(remote=> ({ local: p, remote }))),
ps=> Promise.allSettled(ps)
)(packages))
.map(({ status, ...v })=> status==="rejected" ?
{ status: -1, value: v } :
{ status: packageStatus(v.value.local, v.value.remote), value: v.value })
.filter(({ status, value })=> {
if(status!==-1) return true;
echo("%c"+value.reason, css.err);
});
}
/** @type {(local: ConfigPackage, remote: GitHubRelease)=> 0|1|2|3} */
function packageStatus({ last_update: local }, { published_at: remote }){
if(!remote) return 0;
if(!local) return 3;
if(remote===local) return 1;
return 2+(local<remote);
}
/** @param {ConfigPackage} package */
async function fetchRelease({ repository, tag_name_regex }, cache){
const headers= { 'User-Agent': 'node' };
if(cache==="no") headers['Cache-Control'] = 'no-cache';
const url= url_api+repository+"/releases";
const releases= await fetch(url, { headers }).then(res=> res.json());
if(releases.message) return $.error(url+": "+releases.message);
return releases.find(function ({ draft, published_at, tag_name }){
if(draft||!published_at) return false;
if(!tag_name_regex) return true;
return (new RegExp(tag_name_regex, 'g')).test(tag_name);
});
}
function readConfig(){
if(!s.test("-f", path_config_json)) return { packages: [] };
const out= Object.assign({ target: "~/bin/" },
s.cat(path_config_json).xargs(JSON.parse));
if(out.target.startsWith("~/")) out.target= $.xdg.home(out.target.slice(2));
return out;
}

78
bin/kde6-workarounds.mjs Executable file
View File

@ -0,0 +1,78 @@
#!/usr/bin/env nodejsscript
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */
const pathLastDesktop= ()=> $.xdg.temp`kde6-workarounds-last-desktop.txt`;
const css= echo.css`
.code { color: gray; }
`;
$.api()
.version("2024-02-29")
.describe("Workarounds for KDE6.")
.command("logout")
.action(function(){
$.is_silent= true;
const res= s.run([
"echo ::options::",
"|",
"rofi -dmenu -p 'Logout' -l 4 -theme-str 'window { width: 25ch; }' -normal-window"
].join(" "), {
options: [ "-", "poweroff", "reboot" ].join("\n")
}).trim();
if(res && res!=="-") s.run(res);
$.exit(0);
})
.command("klipper-edit", "Edit last item in klipper.")
.action(async function(){
$.is_silent= true;
const qdbus= "qdbus org.kde.klipper /klipper org.kde.klipper.klipper.";
try{
const candidate= s.run(`${qdbus}getClipboardContents`).trim();
const content= await $.read({ "-p": "Edit", completions: [ candidate ] });
s.run(`${qdbus}setClipboardContents "${content}"`);
$.exit(0);
} catch (_){
$.exit(1);
}
})
.command("desktops-alttab", "Workaround for KDE6 alt-tab between virtual desktops.")
.action(function(){
const path= pathLastDesktop();
// Regarding ★ : this is a workaround for diagonal switching (it duplicates desktop index)
let desktop= s.cat(path).trim() || "1";
if(desktop.length>3){ // ★
const [ _1, _2, ..._3 ]= desktop.slice(-4, desktop.length);
if(_1===_2)
desktop= desktop.slice(0, -4).concat(_1, ..._3);
}
if(desktop.length>2){ // ★
const [ _1, _2 ]= desktop.slice(-2, desktop.length);
if(_1===_2)
desktop= desktop.slice(0, -1);
}
if(desktop.length>2){
desktop= desktop.slice(-2, desktop.length);
s.echo(desktop).to(path);
}
echo(desktop);
s.run`qdbus org.kde.KWin /KWin org.kde.KWin.setCurrentDesktop ${desktop[0]}`;
$.exit(0);
})
.command("desktops-last-dbus")
.action(function(){
echo([
"dbus-monitor",
'"interface=org.kde.KWin.VirtualDesktopManager" "member=currentChanged"',
"|",
'xargs -e -I {} kde6-workarounds.mjs desktops-last-save {}'
].join(" "));
$.exit(0);
})
.command("desktops-last-save <dbus>", "Workaround for KDE6 alt-tab between virtual desktops.")
.action(function(dbus){
if(-1===dbus.indexOf("path=/VirtualDesktopManager; interface=org.kde.KWin.VirtualDesktopManager; member=currentChanged"))
return $.exit(1);
const desktop= s.run`qdbus org.kde.KWin /KWin org.kde.KWin.currentDesktop`.trim();
s.echo(desktop).toEnd(pathLastDesktop());
})
.parse();

View File

@ -1,5 +1,6 @@
#!/usr/bin/env nodejsscript #!/usr/bin/env nodejsscript
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */ /* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */
import { kwallet } from "./§kwallet.mjs";
const url_api= "https://nocodb.jaandrle.cz/api/v1/db/data/v1/Linky/Linky"; const url_api= "https://nocodb.jaandrle.cz/api/v1/db/data/v1/Linky/Linky";
$.api() $.api()
.command("add-md") .command("add-md")
@ -9,7 +10,7 @@ $.api()
const res= await fetch(url_api, { const res= await fetch(url_api, {
body: JSON.stringify({ Popis: title.slice(1), Url: url.slice(0, -1) }), body: JSON.stringify({ Popis: title.slice(1), Url: url.slice(0, -1) }),
headers: { "xc-token": "Js7Qu0oT_wTmGJDFKlIZEBhwk87WF0L1wLmQO01F", headers: { "xc-token": kwallet([ "readPassword", "Passwords", "nocodb-linky" ])[0].toString(),
"accept": "application/json", "Content-Type": "application/json" "accept": "application/json", "Content-Type": "application/json"
}, },
method: "post" method: "post"

View File

@ -2,7 +2,37 @@
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */ /* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */
$.api("") $.api("")
.version("2023-08-11") .version("2024-03-18")
.command("silicon [file]", [
"Generovat obrázek s kódem pro sdílení na sociálních sítích. (alternativa k Carbon)",
"Toto je jen drobný wrapper s mými defaultními parametry.",
"Další nápověda viz `silicon --help`.",
])
.option("--title", "Set window title (default: file name).")
.option("--range", "Select lines from file in the form `start:end`")
.option("--font-size, --fs", "Font size", 25)
.action(function silicon(file, { title= file, range, fs, ["font-size"]: _fs, _, ...args }){
args= Object.assign({
theme: "OneHalfDark",
font: `Ubuntu Mono =${fs}`,
background: "#f06d78",
["shadow-blur-radius"]: 30,
["tab-width"]: 2
}, args);
args= Object.keys(args).flatMap(key=> [ "--"+key, args[key] ]);
let from= file;
const index_ext= file.lastIndexOf(".");
const output= !file ? "silicon.png" : file.slice(0, index_ext+1)+"png";
if(range && typeof range=== "string" && range.includes(":")){
from= $.xdg.temp`silicon-range${file.slice(index_ext)}`;
const content= s.$().cat(file).toString().split(/\r?\n/).slice(...range.split(":").map(n=> parseInt(n)+1));
s.echo(content.join("\n")).to(from);
}
s.run`silicon ${from} --output ${output} --window-title ${title} ${args}`;
echo(`Generated ${output}`);
if(from!== file) s.rm(from);
$.exit(0);
})
.command("textInImage [file]", "Generovat obrázek s textem pro sdílení na sociálních sítích.") .command("textInImage [file]", "Generovat obrázek s textem pro sdílení na sociálních sítích.")
.alias("tii") .alias("tii")
.option("--pointsize", "Text size", "62") .option("--pointsize", "Text size", "62")

View File

@ -68,8 +68,7 @@ $.api("", true)
.map(pipe( .map(pipe(
j=> j.choices[0].text.trim(), j=> j.choices[0].text.trim(),
convertToArray, convertToArray,
j=> (console.log(j), j), format==="regular" || format==="conventional" ? i=> i : i=> gitmoji(i, format==="git3moji"),
format==="regular" ? i=> i : i=> gitmoji(i, format==="git3moji"),
a=> a.join("\n") a=> a.join("\n")
)) ))
.join("\n\n"); .join("\n\n");

157
bin/§kwallet.mjs Executable file
View File

@ -0,0 +1,157 @@
#!/usr/bin/env nodejsscript
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */
const css= echo.css`
.error{ color: lightred; }
.code, .method{ color: lightblue; }
.code::before, .code::after{ content: "\`"; }
.li{ padding-left: 2ch; }
`;
const default_wallet= "kdewallet";
const cmd= "qdbus";
if(!s.which(cmd))
$.exit(1, echo([
`%cError: ${cmd} not found.`,
`%cInstall it with: %csudo apt install ${cmd}`,
].join("\n"), css.error, css.unset, css.code));
import { EventEmitter } from "node:events";
const events= new EventEmitter();
const exit_event= "exit";
if($.isMain(import.meta)){
events.on(exit_event, $.exit);
$.api("", true)
.version("2024-03-05")
.describe([
`KWallet CLI using ${cmd}.`,
"Call with no arguments to list all methods.",
])
.example("--wallet kdewallet folderList")
.example("--wallet kdewallet readPassword folder entry")
.option("--wallet, -w", "Wallet name", default_wallet)
.action(function main({ _, wallet }){
const [ results, is_ls ]= kwallet(_, { wallet });
if(is_ls) echoLs(results);
else echo(results);
events.emit(exit_event);
})
.parse();
}
/**
* @param {string[]} _ Query/arguments for qdbus
* @param {object} [options]
* @param {string} [options.wallet] Wallet name
* @returns {[ string[], true ]|[ string, false ]}
* */
export function kwallet(_, { wallet= default_wallet }= {}){
const qdbus= qdbusGenerator({
service: "org.kde.kwalletd6",
methods: "/modules/kwalletd6",
wallet,
exit_event
});
if(!_.length)
return [ qdbus(), true ];
else{
//TODO: Map (`--literal` in qdbus and decode the result `echoMap`)
const result= qdbus(_);
return [ result, false ];
}
}
function qdbusGenerator({ service, methods, wallet, exit_event }){
const name= getScriptName();
const no_id= [
'allWalletsClosed',
'applicationDisconnected',
'folderListUpdated',
'folderUpdated',
'walletClosed',
'walletCreated',
'walletDeleted',
'walletListDirty',
'walletOpened',
'changePassword',
'close',
'closeAllWallets',
'deleteWallet',
'disconnectApplication',
'folderDoesNotExist',
'isEnabled',
'isOpen',
'keyDoesNotExist',
'localWallet',
'networkWallet',
'open',
'openAsync',
'openPath',
'openPathAsync',
'pamOpen',
'reconfigure',
'users',
'wallets'
];
let id;
const qdbus= (...args)=> s.$().run`${cmd} ${service} ${methods} ${args}`;
events.on(exit_event, ()=>{
if(!id) return;
qdbus("close", id, false, name);
id= null;
});
return function([ method, ...args ]= []){
if(!method) return qdbus();
if(no_id.includes(method)) return qdbus(method, ...args);
if(!id) open();
return qdbus(method, id, ...args, name);
};
function open(){
id= qdbus("open", wallet, 0, name).trim();
return id;
}
}
function echoMap(map){
map= map.slice(1, -1).split(", ").map(n=> Number.parseInt(n));
const ab= new ArrayBuffer(map.length);
const view= new Uint8Array(ab);
for(let i= 0; i<map.length; i++)
view[i]= map[i];
const words= [];
for(let i= 0; i<map.length; i+= 4){
words.push(String.fromCharCode.apply(null, view.subarray(i, i+4)));
}
pipe(
echo
)(words);
}
function echoLs(list){
const ns= "org.kde.KWallet.";
pipe(
list=> list.split("\n").filter(l=> l.startsWith("method") && -1!==l.indexOf(ns)),
list=> list.map(l=> l.slice(l.indexOf(" ")+1)).map(l=> l.replace(ns, "")),
list=> list.reduce((o, l)=> (o[Number(l.indexOf("int handle")!==-1)].push(l), o), [ [], [] ]),
([ no_wallet, wallet ])=> [
"Methods available without wallet:",
...no_wallet.map(formatMethod),
"Methods available with wallet (" + echo.format("%c--wallet", css.code) + " option):",
...wallet.map(formatMethod)
].join("\n"),
echo
)(list);
function formatMethod(line){
const ch_type= line.indexOf(" ")+1;
const ch_name= line.indexOf("(", ch_type);
return echo.format([
"",
line.slice(0, ch_type),
line.slice(ch_type, ch_name),
line.slice(ch_name)
].join("%c"), css.li, css.method, css.unset);
}
}
function getScriptName(){
const { url }= import.meta;
return (new URL(url)).href.slice((new URL("./", url).href.length));
}

86
bin/§time.mjs Executable file
View File

@ -0,0 +1,86 @@
#!/usr/bin/env nodejsscript
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */
const units= {
second: 1000,
get minute(){ return this.second*60; },
get hour(){ return this.minute*60; },
get day(){ return this.hour*24; },
get month(){ return this.day*30; },
get year(){ return this.day*365; }
};
$.api()
.version("2024-03-27")
.command("diff <time> [reference]", [
"Returns remaining time diff <time>.",
"The <time> is argument to bash `date -d <time> +%s`.",
"Optionally, you can specify <reference> (with the same format) to compare with. By default it is current time."
])
.alias("?")
.option("--unit", "Unit, use one of the: "+Object.keys(units).join(", "))
.action(diff)
.command("zone [time]", "Returns times in different time zones.")
.option("-z", "Use multiple times to see time in different time zones.")
.action(zone)
.parse();
function diff(given, reference, { unit }){
const date_now= !reference ? new Date() : date("[reference]", reference);
const date_given= date("<time>", given);
debugger;
const rtf= new Intl.RelativeTimeFormat();
let future= 1;
let diff= date_given - date_now;
if(diff < 0){
future= -1;
diff= -diff;
}
if(unit){
if(unit.endsWith("s")) unit= unit.slice(0, -1);
echo(rtf.format(future*Math.floor(diff/units[unit]), unit));
$.exit(0);
}
diff= echoUnit(future, diff, "year", rtf);
diff= echoUnit(future, diff, "month", rtf);
diff= echoUnit(future, diff, "day", rtf);
diff= echoUnit(future, diff, "hour", rtf);
diff= echoUnit(future, diff, "minute", rtf);
diff= echoUnit(future, diff, "second", rtf);
$.exit(0);
}
function zone(time, { z: zones }){
if(!Array.isArray(zones)) zones= zones ? [ zones ] : [];
if(!zones.length)
return $.error("Please specify at least one zone.");
const date_given= time ? date("[time]", time) : new Date();
if(date_given.toLocaleString() === "Invalid Date")
return $.error(date_given);
const max_length= Math.max(...zones.map(zone=> zone.length));
const dtf= timeZone=> new Intl.DateTimeFormat(undefined, { timeZone, dateStyle: "full", timeStyle: "long", hour12: false });
for(const zone of zones)
echo(zone.padStart(max_length, " "), "—", dtf(zone).format(date_given));
$.exit(0);
}
function date(name, given){
const date_given= new Date(s.$().run`date -d ${given} +%Y-%m-%dT%H:%M:%S%z`.trim());
if(date_given.toLocaleString() === "Invalid Date")
return $.exit(1, echo(name, date_given));
return date_given;
}
/**
* @param {1|-1} future
* @param {number} num
* @param {'year'|'month'|'day'|'hour'|'minute'|'second'} unit
* @param {string} rtf
* */
function echoUnit(future, num, unit, rtf){
if(num <= units[unit]) return num;
echo(rtf.format(future*Math.floor(num/units[unit]), unit));
return num%units[unit];
}

14
bin/§ultisnips.mjs Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env nodejsscript
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */
$.is_fatal= true;
const root= "~/.config/coc/ultisnips/";
const files= Object.fromEntries( s.ls(root).map(fn=> [fn, s.cat(root+fn).trim()]) );
Object.keys(files).forEach(fn=> {
const file= files[fn];
if(!file.startsWith("extends ")) return;
const lines= file.split("\n");
const line_end= pipe( id=> id===-1 ? lines.length : id )( lines.findIndex(l=> l.startsWith("#endextends")) );
const include= lines[0].replace("extends ", "").trim().split(/, ?/g).map(s=> files[s+".snippets"]).join("\n");
lines.splice(1, line_end-1, include);
s.echo(lines.join("\n").trim()).to(root+fn);
})

View File

@ -153,7 +153,11 @@ async function actionUpdate(){
}).then(f=> s.echo(f).to(dirs.one_files+fileName(url))); }).then(f=> s.echo(f).to(dirs.one_files+fileName(url)));
})); }));
echo("One-file plugin(s) updated."); echo("One-file plugin(s) updated.");
s.cd(dirs.bundle).$().run`git commit -m "Update"`; try{
s.cd(dirs.bundle).$().run`git commit -m "Update"`;
} catch(e){
echo(e?.message);
}
updateRepo(dirs.pack, getPack()); updateRepo(dirs.pack, getPack());
$.exit(0); $.exit(0);

6
bin/§wallpaper_BIOTD Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
nm-online -x -q && \
node "/home/jaandrle/.nvm/versions/node/$(node --version)/bin/nodejsscript" /home/jaandrle/bin/§wallpaper_WCPOTD.mjs pull && \
cd "/home/jaandrle/Obrázky/Bing Image Of The Day" && \
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'const d= desktops().filter(d=> d.wallpaperPlugin==="de.unkn0wn.htmlwallpaper")[0];const url= (i= "")=> `file:///home/jaandrle/Obr%C3%A1zky/Bing%20Image%20Of%20The%20Day/index${i}.html`;d.currentConfigGroup= Array("Wallpaper", "de.unkn0wn.htmlwallpaper","General");d.writeConfig("DisplayPage", url("1"));d.writeConfig("DisplayPage", url());'
# convert now.jpg prev.jpg +append horizontally.jpg

View File

@ -9,36 +9,36 @@ const folder= homedir()+"/Obrázky/Bing Image Of The Day/";
get_(url_main+"/HPImageArchive.aspx?format=js&idx=0&n=2&mkt=cs-CZ") get_(url_main+"/HPImageArchive.aspx?format=js&idx=0&n=2&mkt=cs-CZ")
.then(res=> { .then(res=> {
let body= ""; let body= "";
res.on("data", chunk=> body+= chunk); res.on("data", chunk=> body+= chunk);
res.on("end", ()=> pipe(data, update)(body)); res.on("end", ()=> pipe(data, update)(body));
}) })
.catch(e=> console.error(String(e))); .catch(e=> console.error(String(e)));
function update(data){ function update(data){
if(data===null) return false; if(data===null) return false;
Promise.allSettled(data.map(({ url, copyright }, id)=> getImage_(url, id ? "prev" : "now", copyright))) Promise.allSettled(data.map(({ url, copyright }, id)=> getImage_(url, id ? "prev" : "now", copyright)))
.then(res=> { .then(res=> {
let template= readFileSync(folder+"index_template.html").toString(); let template= readFileSync(folder+"index_template.html").toString();
writeFileSync(folder+"index.html", res.reduce((out, { status, value })=> status==="rejected" ? out : out.replace(`::${value.name}::`, value.description), template)); writeFileSync(folder+"index.html", res.reduce((out, { status, value })=> status==="rejected" ? out : out.replace(`::${value.name}::`, value.description), template));
}) })
.catch(e=> console.error(String(e))); .catch(e=> console.error(String(e)));
} }
function getImage_(url, name, desc){ function getImage_(url, name, desc){
const description= desc.replace("(©", "<br>(©"); const description= desc.replace("(©", "<br>(©");
return get_(url_main+url) return get_(url_main+url)
.then(res=> { .then(res=> {
const fs= createWriteStream(folder+name+'.jpg'); const fs= createWriteStream(folder+name+'.jpg');
res.pipe(fs); res.pipe(fs);
return new Promise(res=> fs.on("finish", ()=> { return new Promise(res=> fs.on("finish", ()=> {
fs.close(); fs.close();
res({ name, description }); res({ name, description });
})); }));
}); });
} }
function data(body){ function data(body){
try { return JSON.parse(body).images; } try { return JSON.parse(body).images; }
catch (_) { return null; } catch (_) { return null; }
} }
function get_(url){ return new Promise(function(res,rej){ get(url, res).on("error", rej); }); } function get_(url){ return new Promise(function(res,rej){ get(url, res).on("error", rej); }); }
function pipe(...f){ return Array.prototype.reduce.bind(f, (acc, f)=> f(acc)); } function pipe(...f){ return Array.prototype.reduce.bind(f, (acc, f)=> f(acc)); }

113
bin/§wallpaper_WCPOTD.mjs Executable file
View File

@ -0,0 +1,113 @@
#!/usr/bin/env nodejsscript
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */
const img_params= "?width=1920";
const url_api= "https://commons.wikimedia.org/w/api.php";
const url_image= "https://commons.wikimedia.org/wiki/Special:FilePath/";
import { join } from "node:path";
const path_home= $.xdg.home`Obrázky/Bing Image Of The Day/`;
const path_info= join(path_home, "images.json");
$.api()
.version("2024-05-12")
.command("pull", "Pull new/today image(s)")
.action(async function pull(){
const images= {
now: await getImagePath(0),
prev: await getImagePath(-1)
};
const paths= await downloadImages(images);
updateHTML(images);
convert(paths);
pipe(
images=> Object.entries(images)
.reduce((acc, [ key, { caption } ])=>
Reflect.set(acc, key, caption) && acc,
{}),
images=> JSON.stringify(images, null, "\t"),
s.echo
)(images).to(path_info);
$.exit(0);
})
.command("status")
.action(function status(){
const images= s.cat(path_info).xargs(JSON.parse);
const [ stats ]= s.ls("-l", path_info);
echo({ timestamp: stats.mtime, ...images });
$.exit(0);
})
.parse();
/** @typedef {{ url: string, caption: string }} T_response */
/** @typedef {Record<"now"|"prev",T_response>} T_images */
/** @param {Record<"now"|"prev",string>} paths */
function convert(paths){
const resize_to= "1920x1080";
paths= Object.values(paths);
const target= join(path_home, "horizontally.jpg");
const params= `-resize ${resize_to}^ -gravity center -extent ${resize_to}`.split(" ");
s.run`convert ${paths} ${params} +append ${target}`;
}
import { writeFileSync } from "node:fs";
/** @param {T_images} images */
function updateHTML(images){
let template= s.cat(join(path_home, "index_template.html")).trim();
for(const [ key, image ] of Object.entries(images))
template= template.replace(`::${key}::`, image.caption);
s.echo(template).to(join(path_home, "index.html"));
}
/** @param {T_images} images */
async function downloadImages(images){
const out= {};
for(const [ key, image ] of Object.entries(images))
out[key]= await downloadImage(image, key);
return out;
}
async function getImagePath(shift= 0){
const date= dateISO(shift);
const { expandtemplates: { wikitext: filepath } }= await fetchGet({
action: "expandtemplates",
prop: "wikitext",
text: `{{Potd/${date}}}`,
});
const caption= pipe(
response=> response.expandtemplates.wikitext,
caption=> caption.replace(/\[\[.*?\]\]/g, m=> m.slice(2, -2).split("|").reverse()[0]),
caption=> caption.replace(/''(.*?)''/g, "„$1”"),
)(await fetchGet({
action: "expandtemplates",
prop: "wikitext",
text: `{{Potd/${date} (cs)}}`,
}));
/* TODO?
* action: 'query',
* prop: 'imageinfo',
* iiprop: 'extmetadata',
* iiextmetadatafilter: 'LicenseShortName|Artist|LicenseUrl',
* titles: `Image:${ filename }`
*
* res.data.query.pages[0].imageinfo[0].extmetadata
* */
return {
caption: caption,
url: url_image+encodeURI(filepath+img_params)
};
}
/** @param {T_response} image @param {"prev"|"now"} type */
async function downloadImage({ url }, type){
const filename= join(path_home, `${type}.jpg`);
const response= await fetch(url);
const buffer= await response.arrayBuffer();
writeFileSync(filename, Buffer.from(buffer));
return filename;
}
function dateISO(shift= 0){
const d= new Date();
d.setDate(d.getDate()+shift);
return d.toISOString().substring(0, 10);
}
function fetchGet(params){
if(!params.format) params.format= "json";
return fetch(url_api+"?"+(new URLSearchParams(params)).toString(), { method: "GET" }).then(res=> res.json());
}