Compare commits
25 Commits
main-mac
...
b260e411f0
Author | SHA1 | Date | |
---|---|---|---|
b260e411f0
|
|||
1dc978f1c1
|
|||
d8d0c9ba2e
|
|||
60d6583472
|
|||
6a8f73450c
|
|||
1a938fbeb3
|
|||
3c99b8cb34
|
|||
a665006836
|
|||
9737f6cdab
|
|||
4f578e0bb0
|
|||
9051f04328
|
|||
98073783bf
|
|||
08ee9f8b0e
|
|||
068db0c3c8
|
|||
7f4d93f4d2
|
|||
621832506c
|
|||
36376a2e34
|
|||
6269463d7b
|
|||
34dd9f4b01
|
|||
5c4a9851e6
|
|||
3495c81c49
|
|||
5dd77c49a0
|
|||
15be72893c
|
|||
43d220be01
|
|||
8210faf9ce
|
@ -2,9 +2,10 @@
|
||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||
alias gitdotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"'
|
||||
# enable color support of ls and also add handy aliases
|
||||
alias ls='ls -pQFh --group-directories-first'
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
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 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\/ §/'
|
||||
}
|
||||
|
||||
alias §ls='ls -pQFh --group-directories-first'
|
||||
alias §less='less -R -S'
|
||||
|
||||
alias §cd.='clear;§ls'
|
||||
§cd..(){ cd $(eval printf '../'%.0s {1..$1}); }
|
||||
§cd(){
|
||||
[[ "$1" == '--help' ]] && echo -e "
|
||||
Usage: §cd NUMBER|PATH
|
||||
See: dirs -v
|
||||
" && return 0
|
||||
[[ -z "$1" ]] && dirs -v | sed 1d && return 0
|
||||
[[ $1 =~ ^[0-9]+$ ]] && cd "$(dirs -l +$1)" && dirs -v | sed 1d && return 0
|
||||
builtin pushd "$1" >/dev/null && pushd .
|
||||
m(){
|
||||
if [[ -z "$1" ]]; then
|
||||
printenv | grep -e '^m'
|
||||
return 0
|
||||
fi
|
||||
if [[ "--help" == "$1" ]]; then
|
||||
echo 'm [--help]'
|
||||
echo ' Lists all marks or print this help.'
|
||||
echo 'm <name> [path]'
|
||||
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 -`'
|
||||
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 pdftk='java -jar $HOME/bin/pdftk-all.jar'
|
||||
bw-session(){
|
||||
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_CLIENTID=`echo "$login" | jq -r .id`
|
||||
bw login --apikey --raw
|
||||
|
@ -1,58 +1,59 @@
|
||||
function setPromt {
|
||||
if [ "$color_prompt" != yes ]; then
|
||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||
return
|
||||
fi
|
||||
case "$TERM" in
|
||||
xterm*|rxvt*)
|
||||
;;
|
||||
*)
|
||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||
return
|
||||
;;
|
||||
esac
|
||||
PROMPT_COMMAND=updatePromt
|
||||
PS2="|"
|
||||
if [ "$color_prompt" != yes ]; then
|
||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||
return
|
||||
fi
|
||||
case "$TERM" in
|
||||
xterm*|rxvt*)
|
||||
;;
|
||||
*)
|
||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||
return
|
||||
;;
|
||||
esac
|
||||
PROMPT_COMMAND=updatePromt
|
||||
PS2="|"
|
||||
}
|
||||
function updatePromt {
|
||||
local prev_exit="$?"
|
||||
# color_helper_>>color<< (Note: \[\]= escaping)
|
||||
local chR="\[\e[1;91m\]" #red
|
||||
local chW="\[\033[00m\]" #white
|
||||
local chG="\[\033[01;32m\]" #green
|
||||
local chB="\[\033[0;34m\]" #blue
|
||||
local chP="\[\033[0;35m\]" #purple
|
||||
local chY="\[\033[0;33m\]" #yellow
|
||||
PS1=""
|
||||
if [ $prev_exit == 0 ]; then
|
||||
PS1+="$chG✓ $chW"
|
||||
else
|
||||
PS1+="$chR✗ $chW"
|
||||
fi
|
||||
local jobs="$(jobs | wc -l)"
|
||||
if [ $jobs != 0 ]; then
|
||||
PS1+="${chY}≡$jobs$chW"
|
||||
fi
|
||||
PS1+="${debian_chroot:+($debian_chroot)}"
|
||||
PS1+=" At ${chG}\A${chW}"
|
||||
PS1+=" by ${chP}\u${chW}"
|
||||
if sudo -n true 2>/dev/null; then
|
||||
PS1+="${chR} (sudo)${chW}"
|
||||
fi
|
||||
PS1+=" in "
|
||||
if \git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
local branch="$(\git symbolic-ref -q HEAD)"
|
||||
PS1+="[${branch#refs/heads/}"
|
||||
local status="$(git for-each-ref --format='%(upstream:trackshort)' refs/heads | awk '!seen[$1]++ {printf $1}')"
|
||||
status+="$(git status --porcelain | awk '!seen[$1]++ {printf $1}')"
|
||||
if [ "$statua"s ]; then
|
||||
PS1+="|$chY$status$chW"
|
||||
fi
|
||||
PS1+="] "
|
||||
fi
|
||||
PS1+="${chB}\w${chW}"
|
||||
PS1+="\n:"
|
||||
history -a
|
||||
local prev_exit="$?"
|
||||
# history -n; history -w; history -c; history -r;
|
||||
# color_helper_>>color<< (Note: \[\]= escaping)
|
||||
local chR="\[\e[1;91m\]" #red
|
||||
local chW="\[\033[00m\]" #white
|
||||
local chG="\[\033[01;32m\]" #green
|
||||
local chB="\[\033[0;34m\]" #blue
|
||||
local chP="\[\033[0;35m\]" #purple
|
||||
local chY="\[\033[0;33m\]" #yellow
|
||||
PS1=""
|
||||
if [ $prev_exit == 0 ]; then
|
||||
PS1+="$chG✓ $chW"
|
||||
else
|
||||
PS1+="$chR✗ $chW"
|
||||
fi
|
||||
local jobs="$(jobs | wc -l)"
|
||||
if [ $jobs != 0 ]; then
|
||||
PS1+="${chY}≡$jobs$chW"
|
||||
fi
|
||||
PS1+="${debian_chroot:+($debian_chroot)}"
|
||||
PS1+=" At ${chG}\A${chW}"
|
||||
PS1+=" by ${chP}\u${chW}"
|
||||
if sudo -n true 2>/dev/null; then
|
||||
PS1+="${chR} (sudo)${chW}"
|
||||
fi
|
||||
PS1+=" in "
|
||||
if \git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
local branch="$(\git symbolic-ref -q HEAD)"
|
||||
PS1+="[${branch#refs/heads/}"
|
||||
local status="$(git for-each-ref --format='%(upstream:trackshort)' refs/heads | awk '!seen[$1]++ {printf $1}')"
|
||||
status+="$(git status --porcelain | awk '!seen[$1]++ {printf $1}')"
|
||||
if [ "$statua"s ]; then
|
||||
PS1+="|$chY$status$chW"
|
||||
fi
|
||||
PS1+="] "
|
||||
fi
|
||||
PS1+="${chB}\w${chW}"
|
||||
PS1+="\n:"
|
||||
history -a
|
||||
}
|
||||
setPromt
|
||||
unset color_prompt
|
||||
|
@ -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/
|
@ -32,7 +32,7 @@
|
||||
"model_hash_override": null,
|
||||
"local_indexing": null,
|
||||
"heartbeat_interval_seconds": null,
|
||||
"last_service_level": "Cloud",
|
||||
"last_service_level": "FreeCloudRegistered",
|
||||
"override_beams": null,
|
||||
"override_context_length": null,
|
||||
"onboarding": null,
|
||||
|
@ -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
|
||||
<!DOCTYPE html>
|
||||
<!-- ${0}DEL IE https://www.paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
|
||||
@ -50,6 +25,9 @@ endsnippet
|
||||
snippet cmt "comment"
|
||||
<!-- ${0} -->
|
||||
endsnippet
|
||||
snippet cmt.js "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"/>
|
||||
|
@ -1,25 +1,37 @@
|
||||
# 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
|
||||
extends html
|
||||
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
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1 +1,124 @@
|
||||
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
|
@ -1,8 +1,3 @@
|
||||
[TabBox]
|
||||
DesktopLayout=org.kde.breeze.desktop
|
||||
DesktopListLayout=org.kde.breeze.desktop
|
||||
LayoutName=org.kde.breeze.desktop
|
||||
|
||||
[Windows]
|
||||
Placement=Centered
|
||||
|
||||
|
@ -32,6 +32,22 @@
|
||||
"--help",
|
||||
"--version"
|
||||
]
|
||||
},
|
||||
"§time.mjs": {
|
||||
"npx": false,
|
||||
"completions": {
|
||||
"diff": [
|
||||
"--unit"
|
||||
],
|
||||
"?": "diff",
|
||||
"zone": [
|
||||
"--z"
|
||||
]
|
||||
},
|
||||
"completions_all": [
|
||||
"--help",
|
||||
"--version"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@ -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 */
|
||||
globalThis.cyclicLoop= function*(items){
|
||||
if(!items) items= 'win32'===process.platform ? '|/-\\' : "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏";
|
||||
@ -16,3 +11,18 @@ globalThis.cyclicLoop= function*(items){
|
||||
Reflect.defineProperty($, "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
4
.config/xremap.yml
Normal file
@ -0,0 +1,4 @@
|
||||
keymap:
|
||||
- name: Ctrl+tab alias
|
||||
remap:
|
||||
C-KEY_KPSLASH: C-KEY_TAB
|
2
.inputrc
2
.inputrc
@ -17,7 +17,7 @@ set menu-complete-display-prefix on
|
||||
"\e[A":history-search-backward
|
||||
"\e[B":history-search-forward
|
||||
|
||||
"\e\C-e": history-and-alias-expand-line
|
||||
"OM": history-and-alias-expand-line
|
||||
|
||||
set colored-stats On
|
||||
|
||||
|
@ -3,7 +3,7 @@ AntiAliasFonts=true
|
||||
BoldIntense=true
|
||||
ColorScheme=DarkPastels
|
||||
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
|
||||
|
||||
[General]
|
||||
@ -12,4 +12,5 @@ Name=Můj
|
||||
Parent=FALLBACK/
|
||||
|
||||
[Scrolling]
|
||||
HistoryMode=2
|
||||
ScrollBarPosition=2
|
||||
|
153
.newsboat/urls
153
.newsboat/urls
@ -15,11 +15,11 @@ https://www.youtube.com/feeds/videos.xml?channel_id=UCKlOmM_eB0nzTNiDFZibSSA !
|
||||
https://www.mall.tv/rssfeed/mikyrova-uzasna-pout-internetem ! video
|
||||
"query:📹:tags # \"video\""
|
||||
|
||||
https://nitter.cz/spreadmastodon/rss
|
||||
|
||||
https://www.mfcr.cz/cs/rss/vydali-jsme-k-hospodareni-statu ! 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://poladprahu.cz/category/novinky/feed/ ! stát
|
||||
https://sdilenedomy.cz/feed/ ! stát
|
||||
@ -33,12 +33,13 @@ https://www.investigace.cz/feed/ ! news
|
||||
https://denikn.cz/veda/feed?ref=inc ! news/science
|
||||
"query:Petr Koubský:author = \"Petr Koubský\"" news/science
|
||||
https://vedator.org/feed/ ! news/science
|
||||
# TODO: https://www.threads.net/@vedator_cz
|
||||
http://feeds.feedburner.com/Backreaction ! news/science
|
||||
https://www.osel.cz/rss/rss.php ! news/science
|
||||
https://news.mit.edu/rss/feed ! news/science
|
||||
https://news.mit.edu/rss/research ! 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\""
|
||||
|
||||
https://www.lupa.cz/rss/clanky/ ! news/tech
|
||||
@ -66,88 +67,45 @@ https://lemmy.ml/feeds/c/kde.xml?sort=Active ! lemmy
|
||||
"query:📰👋💻💡 – Lemmy:tags # \"lemmy\""
|
||||
|
||||
https://github.com/jordwalke.atom ! twitter/α
|
||||
# https://nitter.cz/ell2cz/rss ! twitter/α
|
||||
# https://nitter.cz/fieldsofmoab/rss ! twitter/α
|
||||
# https://nitter.cz/cztomsik/rss ! twitter/α
|
||||
# https://nitter.cz/sw_samuraj/rss ! twitter/α
|
||||
# https://nitter.cz/AndroidDev/rss ! twitter/α
|
||||
# https://nitter.cz/EduardStula/rss ! twitter/α
|
||||
# https://nitter.cz/ubuntu_unity/rss ! twitter/α → ?https://ubuntuunity.org/blog/
|
||||
https://gts.eilhart.cz/@kayla.rss ! twitter/α
|
||||
# TODO: https://www.threads.net/@annie.tumova
|
||||
# TODO: https://www.threads.net/@filip.titlbach
|
||||
https://www.youtube.com/feeds/videos.xml?channel_id=UCVHFbqXqoYvEWM1Ddxl0QDg ! twitter/α_hide
|
||||
"query:#TheAndroidShow:title =~ \"^#TheAndroidShow\" and rssurl == \"https://www.youtube.com/feeds/videos.xml?channel_id=UCVHFbqXqoYvEWM1Ddxl0QDg\"" twitter/α
|
||||
# TODO: https://ubuntuunity.org/blog/
|
||||
https://blog.neon.kde.org/feed/ ! twitter/α
|
||||
https://undinealmani.com/feed/ ! twitter/α
|
||||
# https://nitter.cz/erikengheim/rss ! twitter/α
|
||||
# https://nitter.cz/LeaVerou/rss ! twitter/α
|
||||
# https://nitter.cz/jpschroeder/rss ! twitter/α
|
||||
# https://nitter.cz/machal/rss ! twitter/α
|
||||
# https://nitter.cz/devgirlFL/rss ! twitter/α
|
||||
# https://nitter.cz/maxiorel/rss ! twitter/α
|
||||
# https://nitter.cz/firt/rss ! twitter/α
|
||||
https://techhub.social/@erikengheim ! twitter/α
|
||||
https://bird.makeup/users/jpschroeder.rss ! twitter/α
|
||||
# TODO: @jpschroeder@fosstodon.org
|
||||
https://mastodon.social/@firt.rss ! twitter/α
|
||||
https://princiya.com/newblog/feeds/all.atom.xml ! twitter/α
|
||||
https://davidwalsh.name/feed ! twitter/α
|
||||
# https://nitter.cz/jakubvrana/rss ! twitter/α
|
||||
https://jecas.cz/rss ! twitter/α
|
||||
# JanKoWeb geekovo zdrojak
|
||||
"query:📰👋💻💡 – Twitter/α:tags # \"twitter/α\""
|
||||
|
||||
# https://nitter.cz/Zeptej_se_vedce/rss ! twitter/mixed
|
||||
# https://nitter.cz/Olinium42/rss ! twitter/mixed
|
||||
#
|
||||
https://nitter.cz/narodnitymzen/rss ! twitter/mixed
|
||||
# https://nitter.cz/Julianne_SF/rss ! twitter/α
|
||||
#!
|
||||
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
|
||||
# TODO: https://www.threads.net/@Zeptej_se_vedce
|
||||
# TODO: https://www.threads.net/@oliniumchemistry
|
||||
# TODO: https://www.threads.net/@narodnitymzen
|
||||
https://mindly.social/@adrianacerna.rss ! twitter/mixed
|
||||
https://olgarichterova.cz/feed/ ! twitter/mixed
|
||||
https://faktaoklimatu.cz/feed.xml ! twitter/mixed
|
||||
#?
|
||||
https://nitter.cz/anna_gumplova/rss ! twitter/mixed
|
||||
#?
|
||||
https://nitter.cz/DearAbbyHansen/rss ! twitter/mixed
|
||||
# https://nitter.cz/FZU_AVCR/rss ! twitter/mixed
|
||||
#!
|
||||
https://nitter.cz/_A_d_e_l_k_a_/rss ! twitter/mixed
|
||||
#!
|
||||
https://nitter.cz/TGuthJarkovsky/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.youtube.com/feeds/videos.xml?channel_id=UCtYxnvekc2-3P74TdLx0srQ ! twitter/mixed
|
||||
https://kill-the-newsletter.com/feeds/c6e1z94wpw0eds67.xml ! twitter/mixed
|
||||
https://kill-the-newsletter.com/feeds/39xfn7p1cvf8dif4.xml ! twitter/mixed
|
||||
https://kill-the-newsletter.com/feeds/5tww0ecg9y4twnxz.xml ! twitter/mixed
|
||||
https://mastodonczech.cz/@ewajelinek ! twitter/mixed
|
||||
# TODO: https://www.threads.net/@claireklingenberg
|
||||
# TODO: https://www.threads.net/@pavlahubalkova
|
||||
# TODO: https://www.threads.net/@popdetective
|
||||
https://zpravobot.news/@dan_prokop.rss ! 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://nitter.cz/MarieHermanova/rss ! twitter/mixed
|
||||
# https://nitter.cz/NKC_CZ/rss ! 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
|
||||
# TODO: https://www.threads.net/@mariehermanova
|
||||
https://kill-the-newsletter.com/feeds/xmub9gn72ecekvbi.xml ! twitter/mixed
|
||||
https://www.mimoagendu.cz/rss/ ! twitter/mixed
|
||||
# https://nitter.cz/malyvedec/rss ! twitter/mixed
|
||||
#!
|
||||
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
|
||||
# TODO: https://www.threads.net/@barasoukup
|
||||
# PulseofEuropeCZ KohoVolitEU
|
||||
"query:📰👋💻💡 – Twitter/mixed:tags # \"twitter/mixed\""
|
||||
|
||||
@ -159,21 +117,13 @@ https://denikn.cz/tag/vylety-n/feed/ ! newsletters
|
||||
https://denikn.cz/tag/evropska-unie/feed/ ! 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://github.com/evanw/esbuild/releases.atom ! dev/servises
|
||||
https://bun.sh/rss.xml ! 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://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://www.mozilla.cz/feed/ ! twitter/α
|
||||
#! https://nitter.cz/janovsky/rss ! twitter/α
|
||||
# https://www.githubstatus.com/history.rss ! dev/servises
|
||||
"query:⌨🖱:tags # \"dev/servises\""
|
||||
|
||||
@ -223,3 +173,42 @@ http://casopisargument.cz/?feed=rss2 ! news/rest
|
||||
|
||||
https://www.seznamzpravy.cz/rss ! 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
|
||||
|
@ -12,6 +12,7 @@ let g:user_tips_list= [
|
||||
\ 'packadd cfilter',
|
||||
\ 'Next word location → ]I [I ]<c-I> [<c-I> … <leader>]I <leader>[I',
|
||||
\ ':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''*',
|
||||
\ 'q: q? q/ … @: ?<cr> /<cr> :&<cr> , ;',
|
||||
\ '<c-n><c-p> <c-x><c-l> <c-x><c-f> … :h ins-completion',
|
||||
|
4
.vimrc
4
.vimrc
@ -250,10 +250,6 @@
|
||||
nnoremap <s-k> a<cr><esc>
|
||||
for l in [ 'y', 'p', 'P', 'd' ] | for m in [ 'n', 'v' ]
|
||||
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
|
||||
command! -nargs=0 SETFOLDregions set foldmethod=marker
|
||||
command! -nargs=1 SETFOLDindent set foldmethod=indent | let &foldlevel=<q-args> | let &foldnestmax=<q-args>+1
|
||||
|
69
README.md
69
README.md
@ -25,7 +25,7 @@ see for example [How to Store Dotfiles - A Bare Git Repository \| Atlassian Git
|
||||
## On a new machine
|
||||
1. install git
|
||||
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. `alias gitdotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"'`
|
||||
1. `gitdotfiles config --local status.showUntrackedFiles no`
|
||||
@ -34,23 +34,47 @@ see for example [How to Store Dotfiles - A Bare Git Repository \| Atlassian Git
|
||||
1. `gitdotfiles checkout -f`
|
||||
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)
|
||||
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] 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)
|
||||
{DONE <2022-10-25 17:21> *mail* *hud* *klíčenka* agenda}$
|
||||
|
||||
@ -80,9 +104,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).
|
||||
|
||||
### kwin-tiling
|
||||
- https://gitlab.com/faho/kwin-tiling/
|
||||
|
||||
### 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), 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>
|
||||
<summary>`{… cmd}$` explanation</summary>
|
||||
|
@ -7,9 +7,9 @@
|
||||
"file_name": "github-desktop",
|
||||
"exec": "yes",
|
||||
"description": "Fork of GitHub Desktop to support various Linux distributions",
|
||||
"last_update": "2023-12-20T15:25:06Z",
|
||||
"last_update": "2024-02-04T22:31:22Z",
|
||||
"downloads": "/home/jaandrle/bin/github-desktop",
|
||||
"version": "release-3.3.6-linux3"
|
||||
"version": "release-3.3.8-linux2"
|
||||
},
|
||||
{
|
||||
"repository": "jaandrle/jaaCSS-cli",
|
||||
@ -29,9 +29,9 @@
|
||||
"group": "nondev",
|
||||
"file_name": "youtube-music",
|
||||
"exec": "yes",
|
||||
"last_update": "2024-01-05T14:44:27Z",
|
||||
"last_update": "2024-02-20T12:07:29Z",
|
||||
"downloads": "/home/jaandrle/bin/youtube-music",
|
||||
"version": "v3.2.2"
|
||||
"version": "v3.3.2"
|
||||
},
|
||||
{
|
||||
"repository": "ArchGPT/insomnium",
|
||||
@ -93,8 +93,8 @@
|
||||
{
|
||||
"repository": "dynobo/normcap",
|
||||
"name": "NormCap",
|
||||
"description": "OCR powered screen-capture tool to capture information instead of images",
|
||||
"group": "nondev",
|
||||
"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",
|
||||
@ -108,9 +108,9 @@
|
||||
"group": "nondev",
|
||||
"file_name": "upscayl",
|
||||
"exec": "yes",
|
||||
"last_update": "2024-01-16T09:54:25Z",
|
||||
"last_update": "2024-02-29T16:31:09Z",
|
||||
"downloads": "/home/jaandrle/bin/upscayl",
|
||||
"version": "v2.9.8"
|
||||
"version": "v2.10.0"
|
||||
},
|
||||
{
|
||||
"repository": "RasmusLindroth/tut",
|
||||
@ -152,9 +152,9 @@
|
||||
"group": "nondev",
|
||||
"file_name": "fedistar",
|
||||
"exec": "yes",
|
||||
"last_update": "2024-01-29T10:29:58Z",
|
||||
"last_update": "2024-02-29T11:08:37Z",
|
||||
"downloads": "/home/jaandrle/bin/fedistar",
|
||||
"version": "v1.8.3"
|
||||
"version": "v1.9.0"
|
||||
},
|
||||
{
|
||||
"repository": "ollama/ollama",
|
||||
@ -163,9 +163,9 @@
|
||||
"group": "ai",
|
||||
"file_name": "ollama",
|
||||
"exec": "yes",
|
||||
"last_update": "2024-01-26T18:19:36Z",
|
||||
"last_update": "2024-03-10T02:24:04Z",
|
||||
"downloads": "/home/jaandrle/bin/ollama",
|
||||
"version": "v0.1.22"
|
||||
"version": "v0.1.29"
|
||||
},
|
||||
{
|
||||
"repository": "neovim/neovim",
|
||||
@ -186,9 +186,9 @@
|
||||
"group": "dev",
|
||||
"file_name": "escrcpy",
|
||||
"exec": "yes",
|
||||
"last_update": "2023-12-27T01:18:21Z",
|
||||
"last_update": "2024-03-13T03:05:48Z",
|
||||
"downloads": "/home/jaandrle/bin/escrcpy",
|
||||
"version": "v1.16.8"
|
||||
"version": "v1.17.3"
|
||||
},
|
||||
{
|
||||
"repository": "drovp/drovp",
|
||||
@ -208,9 +208,17 @@
|
||||
"group": "ai",
|
||||
"file_name": "jan",
|
||||
"exec": "yes",
|
||||
"last_update": "2024-01-29T05:19:22Z",
|
||||
"last_update": "2024-03-11T06:34:40Z",
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
78
bin/kde6-workarounds.mjs
Executable file
78
bin/kde6-workarounds.mjs
Executable 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();
|
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env nodejsscript
|
||||
/* 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";
|
||||
$.api()
|
||||
.command("add-md")
|
||||
@ -9,7 +10,7 @@ $.api()
|
||||
|
||||
const res= await fetch(url_api, {
|
||||
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"
|
||||
},
|
||||
method: "post"
|
||||
|
@ -2,7 +2,37 @@
|
||||
/* jshint esversion: 11,-W097, -W040, module: true, node: true, expr: true, undef: true *//* global echo, $, pipe, s, fetch, cyclicLoop */
|
||||
|
||||
$.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.")
|
||||
.alias("tii")
|
||||
.option("--pointsize", "Text size", "62")
|
||||
|
@ -68,7 +68,6 @@ $.api("", true)
|
||||
.map(pipe(
|
||||
j=> j.choices[0].text.trim(),
|
||||
convertToArray,
|
||||
j=> (console.log(j), j),
|
||||
format==="regular" ? i=> i : i=> gitmoji(i, format==="git3moji"),
|
||||
a=> a.join("\n")
|
||||
))
|
||||
|
157
bin/§kwallet.mjs
Executable file
157
bin/§kwallet.mjs
Executable 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
86
bin/§time.mjs
Executable 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
14
bin/§ultisnips.mjs
Executable 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);
|
||||
})
|
@ -153,7 +153,11 @@ async function actionUpdate(){
|
||||
}).then(f=> s.echo(f).to(dirs.one_files+fileName(url)));
|
||||
}));
|
||||
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());
|
||||
|
||||
$.exit(0);
|
||||
|
@ -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")
|
||||
.then(res=> {
|
||||
let body= "";
|
||||
res.on("data", chunk=> body+= chunk);
|
||||
res.on("end", ()=> pipe(data, update)(body));
|
||||
let body= "";
|
||||
res.on("data", chunk=> body+= chunk);
|
||||
res.on("end", ()=> pipe(data, update)(body));
|
||||
})
|
||||
.catch(e=> console.error(String(e)));
|
||||
|
||||
function update(data){
|
||||
if(data===null) return false;
|
||||
Promise.allSettled(data.map(({ url, copyright }, id)=> getImage_(url, id ? "prev" : "now", copyright)))
|
||||
.then(res=> {
|
||||
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));
|
||||
})
|
||||
.catch(e=> console.error(String(e)));
|
||||
if(data===null) return false;
|
||||
Promise.allSettled(data.map(({ url, copyright }, id)=> getImage_(url, id ? "prev" : "now", copyright)))
|
||||
.then(res=> {
|
||||
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));
|
||||
})
|
||||
.catch(e=> console.error(String(e)));
|
||||
}
|
||||
function getImage_(url, name, desc){
|
||||
const description= desc.replace("(©", "<br>(©");
|
||||
return get_(url_main+url)
|
||||
.then(res=> {
|
||||
const fs= createWriteStream(folder+name+'.jpg');
|
||||
res.pipe(fs);
|
||||
return new Promise(res=> fs.on("finish", ()=> {
|
||||
fs.close();
|
||||
res({ name, description });
|
||||
}));
|
||||
});
|
||||
const description= desc.replace("(©", "<br>(©");
|
||||
return get_(url_main+url)
|
||||
.then(res=> {
|
||||
const fs= createWriteStream(folder+name+'.jpg');
|
||||
res.pipe(fs);
|
||||
return new Promise(res=> fs.on("finish", ()=> {
|
||||
fs.close();
|
||||
res({ name, description });
|
||||
}));
|
||||
});
|
||||
}
|
||||
function data(body){
|
||||
try { return JSON.parse(body).images; }
|
||||
catch (_) { return null; }
|
||||
try { return JSON.parse(body).images; }
|
||||
catch (_) { return null; }
|
||||
}
|
||||
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)); }
|
||||
|
Reference in New Issue
Block a user