⚡ updated
This commit is contained in:
parent
f3bf9e0612
commit
5e7e5b6f33
@ -122,10 +122,12 @@ alias npx-hint='npx -y hint'
|
||||
alias npx-markdown='nohup npx markserv'
|
||||
|
||||
alias fzf=fzf-carroarmato0.fzf
|
||||
alias smerge='/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=sublime_merge --file-forwarding com.sublimemerge.App @@u %u @@'
|
||||
kommit(){ command kommit $* > /dev/null 2>&1 & disown; }
|
||||
|
||||
§url-curl(){ curl --silent -I "$1" | grep -i location; }
|
||||
|
||||
alias bathelp='bat --plain --language=help'
|
||||
alias bathelp='batcat --plain --language=help'
|
||||
|
||||
rpg(){
|
||||
rpg-cli "$@"
|
||||
|
@ -1,5 +1,6 @@
|
||||
# IMPORT IN `$HOME/.profile`
|
||||
export ANDROID_HOME_BAK="$HOME/.local/share/JetBrains/Toolbox/apps/android-studio/"
|
||||
export ANDROID_HOME_BAK2="$HOME/.local/share/JetBrains/Toolbox/apps/android-studio/"
|
||||
export ANDROID_HOME_BAK="$HOME/Android/Sdk"
|
||||
export ANDROID_SDK_ROOT="$HOME/Android/Sdk"
|
||||
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools/
|
||||
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator/
|
||||
|
7
.bashrc
7
.bashrc
@ -12,7 +12,7 @@ shopt -s expand_aliases
|
||||
[ -f $BASH_DOTFILES/.bash_sdkman ] && . $BASH_DOTFILES/.bash_sdkman
|
||||
[ -f $BASH_DOTFILES/.bash_nvm ] && . $BASH_DOTFILES/.bash_nvm
|
||||
export NODE_COMPILE_CACHE=~/.cache/nodejs-compile-cache # https://nolanlawson.com/2024/10/20/why-im-skeptical-of-rewriting-javascript-tools-in-faster-languages/
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
export PATH="$HOME/.local/bin:$PATH:/home/linuxbrew/.linuxbrew/bin"
|
||||
[ -f $BASH_DOTFILES/.bash_completions ] && . $BASH_DOTFILES/.bash_completions # for Vim
|
||||
|
||||
[[ $- != *i* ]] && return # If not running interactively, don't do anything
|
||||
@ -21,7 +21,7 @@ export PATH="$HOME/.local/bin:$PATH"
|
||||
set -o vi # VIM mode for bash
|
||||
bind -m vi-command 'Control-l: clear-screen'
|
||||
bind -m vi-insert 'Control-l: clear-screen'
|
||||
export MANPAGER="/bin/sh -c \"col -b | vim --appimage-extract-and-run --not-a-term -c 'set ft=man ts=8 nomod nolist noma' -\""
|
||||
export MANPAGER="/bin/sh -c \"sed -e 's/\x1B\[[[:digit:]]\+m//g' | col -b | vim --appimage-extract-and-run --not-a-term -c 'set ft=man ts=8 nomod nolist noma' -\""
|
||||
shopt -s checkwinsize # dynamic columns update after every cmd
|
||||
|
||||
## History
|
||||
@ -61,4 +61,5 @@ export GPG_TTY=$(tty)
|
||||
|
||||
# HSTR configuration - add this to ~/.bashrc
|
||||
# if this is interactive shell, then bind hstr to Ctrl-space
|
||||
if [[ $- =~ .*i.* ]]; then bind '"\C-@": "\e^ihstr -- \C-j"'; fi
|
||||
# if [[ $- =~ .*i.* ]]; then bind '"\C-@": "\e^ihstr -- \C-j"'; fi
|
||||
if [[ $- =~ .*i.* ]]; then bind '"\C-@": "\e^I history | grep '\''\e\e^A'\''\e\ei"'; fi
|
||||
|
@ -10,7 +10,7 @@ beep_on_errors=true
|
||||
auto_focus=false
|
||||
sidebar_symbol_visible=true
|
||||
sidebar_openfiles_visible=true
|
||||
editor_font=Ubuntu Mono Bold 9
|
||||
editor_font=Ubuntu Sans Mono Medium 8
|
||||
tagbar_font=Ubuntu Mono 8
|
||||
msgwin_font=Ubuntu Mono Bold 8
|
||||
show_notebook_tabs=false
|
||||
@ -228,7 +228,6 @@ session_file=
|
||||
project_file_path=/home/jaandrle/Dokumenty/Projekty/geany
|
||||
|
||||
[files]
|
||||
recent_files=/home/jaandrle/Vzdálené/GitHub/dcp-fe-container-certifedpassport/src/app/stamps/index.tsx;/home/jaandrle/Vzdálené/GitHub/bs-repo/src/completion.js;/home/jaandrle/.local/share/JetBrains/Toolbox/apps/android-studio/Install-Linux-tar.txt;/media/jaandrle/neon/home/jaandrle/.local/share/umake/android/android-studio/product-info.json;/home/jaandrle/.profile;/home/jaandrle/bin/README.md;/home/jaandrle/Vzdálené/GitHub/deka-dom-el/package.json;/media/jaandrle/neon/home/jaandrle/Vzdálené/ftp/dhlcnetworkcom.ftp;/home/jaandrle/README.md;/home/jaandrle/.config/Seafile/Seafile Client.conf;
|
||||
recent_files=/home/jaandrle/.local/share/krunner-sources/krunner-alias-main/install.sh;/home/jaandrle/.local/share/krunner-sources/kolors/install.sh;/tmp/evolution-jaandrle-RZCWV2/Re: Fwd: 🎃Výstava dýní po mexicku🎃;/home/jaandrle/.vim/bundle/vim-html-template-literals/autoload/htl_syntax.vim;/home/jaandrle/.vim/bundle/vim-html-template-literals/test/example-code-tests/example-code-tests.vader;/home/jaandrle/Stažené/placeholder-sticker.svg;/media/jaandrle/neon/home/jaandrle/Vzdálené/GitHub/dcp-be-proxy-functions(1)/__azurite_db_blob__.json;/home/jaandrle/Vzdálené/GitHub/facilitator-network-cell/src/types/vite-env.d.ts;/media/jaandrle/neon/home/jaandrle/Stažené/.test_snap/wse_yl/test_conf/test.key;/home/jaandrle/Android/Sdk/emulator/NOTICE.txt;
|
||||
recent_projects=/home/jaandrle/Dokumenty/Projekty/geany/Facilitator-App-Native.geany;/home/jaandrle/Dokumenty/Projekty/geany/deka-dom-el.geany;/home/jaandrle/Dokumenty/Projekty/geany/Facilitator-App-Native;/home/jaandrle/Dokumenty/Projekty/geany/deka-dom-el;/home/jaandrle/Dokumenty/Projekty/geany/deka-dom-el/deka-dom-el;/home/jaandrle/Dokumenty/Projekty/geany/.babelrc;
|
||||
current_page=0
|
||||
FILE_NAME_0=1793;TypeScript;0;EUTF-8;1;1;0;%2Fhome%2Fjaandrle%2FVzdálené%2FGitHub%2Fdcp-fe-container-certifedpassport%2Fsrc%2Fapp%2Fstamps%2Findex.tsx;0;4
|
||||
current_page=-1
|
||||
|
@ -225,3 +225,7 @@ convert_selection=
|
||||
set_anchor=
|
||||
select_to_anchor=
|
||||
rect_select_to_anchor=
|
||||
|
||||
[spellcheck]
|
||||
spell_check=
|
||||
spell_toggle_typing=
|
||||
|
@ -11,7 +11,6 @@
|
||||
# * replaced by git-extras
|
||||
aliases = !git config -l | grep ^alias | cut -c 7- | sort # List all aliases. Stolen from here: https://twitter.com/TrevorBramble/status/774292970681937920
|
||||
checkout-default= !git checkout `git branch-default`
|
||||
checkout-default--= !git checkout-default && git branch --delete @{-1} --verbose
|
||||
branch-default = !git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
|
||||
branches = for-each-ref --sort=-committerdate refs --format=\"%(authordate:iso8601)\t%(color:blue)%(refname:short)%(HEAD)\t%(if:notequals="")%(upstream:short)%(then)→ %(upstream:short)%(color:reset)%(else)%(color:yellow)%(objectname:short)%(color:reset)\t%(contents:subject)%(end)\"
|
||||
tags = tag -l --sort=-creatordate --format='%(refname:short): [%(creatordate:short)] %(subject)'
|
||||
@ -19,17 +18,15 @@
|
||||
log-list = log --color --graph --pretty=format:'%Cred%h%Creset %Cgreen[%ad] -%C(yellow)%d%Creset %s %C(bold blue)<%an>%Creset'
|
||||
log-list-nocolors = log --graph --pretty=format:'%h [%ad] -%d %s <%an>'
|
||||
status--= !git fetch && git status && echo && echo Commits unpushed: && git log @{push}..HEAD && echo
|
||||
commit--= !clear && git status -sb | grep -v -e '^ M' & git commit --interactive -v
|
||||
stashpush = !git stash && git pull && git push && git stash pop
|
||||
commit--interactive-v= !clear && git status -sb | grep -v -e '^ M' & git commit --interactive -v
|
||||
pu-shll-stash = !git stash && git pull && git push && git stash pop
|
||||
unstage = reset HEAD --
|
||||
undoall = reset --soft HEAD^
|
||||
diff-dirs = diff --dirstat --find-copies --find-renames --histogram --color
|
||||
status-submodule = !git submodule --quiet foreach 'git fetch' && git submodule foreach 'git status && echo'
|
||||
submodule-foreach-status = !git submodule --quiet foreach 'git fetch' && git submodule foreach 'git status && echo'
|
||||
# * delete-submodule: rm-submodule = !git submodule deinit -f $1 && rm -rf .git/modules/$1 && git rm -rf $1
|
||||
update-submodule = submodule update --remote --merge
|
||||
pull-submodule = submodule foreach 'git pull'
|
||||
diff-submodule = submodule foreach 'git diff'
|
||||
set-upstream = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`
|
||||
submodule-update-merge = submodule update --remote --merge
|
||||
set-upstream-to-current = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`
|
||||
push-new=!git push -u origin `git rev-parse --abbrev-ref HEAD`
|
||||
[core]
|
||||
editor = vim
|
||||
|
@ -124,9 +124,9 @@
|
||||
"group": "dev",
|
||||
"file_name": "bs",
|
||||
"exec": "yes",
|
||||
"last_update": "2024-03-28T13:16:41Z",
|
||||
"last_update": "2024-10-22T12:04:29Z",
|
||||
"downloads": "/home/jaandrle/bin/bs",
|
||||
"version": "v0.7.4",
|
||||
"version": "v0.8.0",
|
||||
"glare": "bs-linux"
|
||||
},
|
||||
{
|
||||
@ -136,9 +136,9 @@
|
||||
"group": "nondev",
|
||||
"file_name": "fedistar",
|
||||
"exec": "yes",
|
||||
"last_update": "2024-09-17T12:12:24Z",
|
||||
"last_update": "2024-10-23T12:45:06Z",
|
||||
"downloads": "/home/jaandrle/bin/fedistar",
|
||||
"version": "v1.9.11",
|
||||
"version": "v1.9.12",
|
||||
"glare": ".*amd64.*.AppImage"
|
||||
},
|
||||
{
|
||||
@ -148,9 +148,9 @@
|
||||
"group": "ai",
|
||||
"file_name": "ollama",
|
||||
"exec": "yes",
|
||||
"last_update": "2024-10-21T05:10:12Z",
|
||||
"last_update": "2024-11-08T19:58:30Z",
|
||||
"downloads": "/home/jaandrle/bin/ollama",
|
||||
"version": "v0.4.0-rc3",
|
||||
"version": "v0.4.1",
|
||||
"glare": "linux-amd64"
|
||||
},
|
||||
{
|
||||
@ -173,8 +173,8 @@
|
||||
"file_name": "vim",
|
||||
"exec": "yes",
|
||||
"downloads": "/home/jaandrle/bin/vim",
|
||||
"version": "v9.1.0794",
|
||||
"last_update": "2024-10-21T01:18:07Z",
|
||||
"version": "v9.1.0857",
|
||||
"last_update": "2024-11-12T01:13:27Z",
|
||||
"glare": "GVim.*x86_64.*.AppImage"
|
||||
},
|
||||
{
|
||||
@ -184,9 +184,9 @@
|
||||
"group": "dev",
|
||||
"file_name": "escrcpy",
|
||||
"exec": "yes",
|
||||
"last_update": "2024-10-21T02:03:58Z",
|
||||
"last_update": "2024-11-08T07:30:51Z",
|
||||
"downloads": "/home/jaandrle/bin/escrcpy",
|
||||
"version": "v1.24.3",
|
||||
"version": "v1.26.3",
|
||||
"glare": ".*x86_64.*.AppImage"
|
||||
},
|
||||
{
|
||||
@ -208,9 +208,9 @@
|
||||
"group": "ai",
|
||||
"file_name": "jan",
|
||||
"exec": "yes",
|
||||
"last_update": "2024-10-17T10:32:20Z",
|
||||
"last_update": "2024-10-24T08:03:18Z",
|
||||
"downloads": "/home/jaandrle/bin/jan",
|
||||
"version": "v0.5.7-rc2-beta",
|
||||
"version": "v0.5.7",
|
||||
"glare": ".*x86_64.*.AppImage"
|
||||
},
|
||||
{
|
||||
@ -220,9 +220,9 @@
|
||||
"group": "ai",
|
||||
"file_name": "Chatbox",
|
||||
"exec": "yes",
|
||||
"last_update": "2024-10-19T04:09:10Z",
|
||||
"last_update": "2024-11-07T15:22:15Z",
|
||||
"downloads": "/home/jaandrle/bin/Chatbox",
|
||||
"version": "v0.10.1",
|
||||
"version": "v0.10.2",
|
||||
"glare": ".*x86_64.*.AppImage"
|
||||
}
|
||||
]
|
||||
|
@ -1,13 +1,3 @@
|
||||
/* deprecated/fallback */
|
||||
globalThis.cyclicLoop= function*(items){
|
||||
if(!items) items= 'win32'===process.platform ? '|/-\\' : "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏";
|
||||
const { length }= items;
|
||||
for(let i=0; true; i++){
|
||||
if(i===length) i= 0;
|
||||
yield items[i];
|
||||
}
|
||||
}
|
||||
|
||||
Reflect.defineProperty($, "clipboard", {
|
||||
get(){
|
||||
if($.env.XDG_SESSION_TYPE === "x11")
|
||||
@ -25,8 +15,4 @@ 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([]); }, });
|
||||
}
|
||||
// export function oneval(){}
|
||||
|
@ -59,7 +59,7 @@ bind ůůl fillcmdline_notrail js document.querySelector("video").currentTime+=
|
||||
bind ůk js (v=> { if(!v) return; v.playbackRate+= 0.25 })(document.querySelector("video"))
|
||||
bind ůj js (v=> { if(!v) return; v.playbackRate-= 0.25 })(document.querySelector("video"))
|
||||
bind ů= js (v=> { if(!v) return; v.playbackRate= 1 })(document.querySelector("video"))
|
||||
bind ůG js (v=> { if(!v) return; v.play(); v.currentTime= v.duration-10; setTimeout(()=> tri.controller.acceptExCmd("pauseVideos"), 5000); })(document.querySelector("video"))
|
||||
bind ůG js (v=> { if(!v) return; v.play(); v.currentTime= ( location.hostname!=="www.disneyplus.com" ? v.duration : (document.querySelector(".time-remaining-label").textContent.split(":").reduce((acc, curr, i)=> (!i ? 60 : 1)*curr+acc, 0)+v.currentTime) )-10; setTimeout(()=> tri.controller.acceptExCmd("pauseVideos"), 5000); })(document.querySelector("video"))
|
||||
|
||||
unbind --mode=normal d
|
||||
bind dd tabclose
|
||||
@ -103,7 +103,7 @@ alias hint_focus hint -;
|
||||
quickmark c moz-extension://616498c0-3916-4f0b-b0a9-ce01ecf2298d/popup.html
|
||||
|
||||
command mastodonUncoverAll composite hint_focus .scrollable ; js (onclick=document.createEvent("Events"), onclick.initEvent("click", true, false), Array.from(document.activeElement.getElementsByClassName("status__content__spoiler-link")).forEach(el=> el.dispatchEvent(onclick)))
|
||||
command mastodonRedirectHome js const parts = location.pathname.split('/'); if(parts.length===2) location.href= `https://fosstodon.org/${parts[1]}@${location.host}`; else location.href= `https://fosstodon.org/authorize_interaction?uri=${location.href}`;
|
||||
command mastodonRedirectHome js const canonicalHref = document.querySelector('link[rel=canonical]')?.href; const parts = (canonicalHref ? new URL(canonicalHref) : location).pathname.split('/'); if(parts.length===2) location.href= `https://fosstodon.org/${parts[1]}@${location.host}`; else location.href= `https://fosstodon.org/authorize_interaction?uri=${location.href}`;
|
||||
bind sm fillcmdline_notrail mastodon
|
||||
|
||||
command data_delall composite hint_focus * ; js document.activeElement.querySelectorAll("input").forEach(el=> el.checked=false)
|
||||
|
@ -280,7 +280,7 @@
|
||||
else
|
||||
fileviewer
|
||||
\*.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm,
|
||||
\ env -u COLORTERM viu-image-viewer.viu %"c -w %pw -t &&
|
||||
\ env -u COLORTERM viu %"c -w %pw -t &&
|
||||
\ echo $(file -b %f)
|
||||
\ %pc
|
||||
fileviewer
|
||||
|
@ -3,8 +3,8 @@ AntiAliasFonts=true
|
||||
BoldIntense=true
|
||||
ColorScheme=DarkPastels
|
||||
DimmValue=54
|
||||
Font=Ubuntu Mono,9,-1,5,700,0,0,0,0,0,0,0,0,0,0,1,Bold
|
||||
UseFontLineChararacters=false
|
||||
Font=Ubuntu Mono,9,-1,5,500,0,0,0,0,0,0,0,0,0,0,1,Medium
|
||||
UseFontLineChararacters=true
|
||||
|
||||
[General]
|
||||
DimWhenInactive=false
|
||||
|
@ -12,6 +12,9 @@ To navigate my secondary editor use [../vscode](../vscode).
|
||||
See [./§vim_plugins_export-v0.json](./§vim_plugins_export-v0.json). Also call `:helptags ~/.vim/bundle/`.
|
||||
|
||||
|
||||
## Removed
|
||||
- [jasonccox/vim-wayland-clipboard](https://github.com/jasonccox/vim-wayland-clipboard) due to https://github.com/vim/vim/issues/5157#issuecomment-1916375710
|
||||
|
||||
## To consider
|
||||
- [yaegassy/coc-html-css-support: HTML id and class attribute "completion" for coc.nvim.](https://github.com/yaegassy/coc-html-css-support): `alpine.js`, `petite-vue`
|
||||
- [vimwiki/vimwiki: Personal Wiki for Vim](https://github.com/vimwiki/vimwiki)
|
||||
|
3
.vimrc
3
.vimrc
@ -168,6 +168,7 @@
|
||||
vnoremap gx :silent exec "!xdg-open '".shellescape(substitute(mini_enhancement#selectedText(), '?', '\\?', ''), 1)."'" \| redraw!<cr>
|
||||
"" #endregion FOS
|
||||
"" #region EN – Editor navigation + search
|
||||
set grepprg=LC_ALL=C\ grep\ -HRIns
|
||||
set hlsearch incsearch " highlight search, start when typing
|
||||
if maparg('<C-L>', 'n') ==# ''
|
||||
nnoremap <silent> <c-l> :nohlsearch<c-r>=has('diff')?'<bar>diffupdate':''<cr><cr><c-l> | endif
|
||||
@ -435,6 +436,8 @@
|
||||
"" #endregion COC
|
||||
let g:codeium_disable_bindings = 1
|
||||
imap <script><silent><nowait><expr> <f3><f3> codeium#Accept()
|
||||
imap <script><silent><nowait><expr> <f3><w> codeium#AcceptNextWord()
|
||||
imap <script><silent><nowait><expr> <f3><j> codeium#AcceptLine()
|
||||
imap <f3>n <Cmd>call codeium#CycleCompletions(1)<CR>
|
||||
imap <f3>N <Cmd>call codeium#CycleCompletions(-1)<CR>
|
||||
imap <f3>d <Cmd>call codeium#Clear()<CR>
|
||||
|
@ -78,7 +78,7 @@ function removePack(path){
|
||||
s.cd(dirs.pack);
|
||||
s.$("-V").rm("-rf", path);
|
||||
const root= dirs.pack+path.split("/")[0];
|
||||
const { code, stdout }= s.$().find(root+"/*/*");
|
||||
const { code, stdout }= s.$("-Sf").find(root+"/*/*");
|
||||
if(!code) echo(stdout);
|
||||
else if(s.test("-d", root))
|
||||
s.$("-V").rm("-rf", root);
|
||||
|
@ -1,6 +1,20 @@
|
||||
#!/bin/bash
|
||||
# heredoc
|
||||
read -r -d '' JS <<JS
|
||||
const dir= '/home/jaandrle/Obrázky/Bing Image Of The Day/';
|
||||
const img= 'horizontally.jpg';
|
||||
desktops()
|
||||
.filter(d=> d.wallpaperPlugin==='org.kde.image')
|
||||
.forEach(d=> {
|
||||
d.currentConfigGroup= ['Wallpaper', 'org.kde.image', 'General'];
|
||||
if(!d.readConfig('Image').endsWith(img)) return;
|
||||
d.writeConfig('Image', 'file://' + dir + 'now.jpg');
|
||||
d.writeConfig('Image', 'file://' + dir + img);
|
||||
});
|
||||
JS
|
||||
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
|
||||
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript "$JS"
|
||||
# plasma-apply-wallpaperimage '/home/jaandrle/Obrázky/Bing Image Of The Day/now.jpg' && plasma-apply-wallpaperimage '/home/jaandrle/Obrázky/Bing Image Of The Day/horizontally.jpg'
|
||||
# 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());' && \
|
||||
|
@ -9,7 +9,7 @@ const path_home= $.xdg.home`Obrázky/Bing Image Of The Day/`;
|
||||
const path_info= join(path_home, "images.json");
|
||||
|
||||
$.api()
|
||||
.version("2024-06-17")
|
||||
.version("2024-11-14")
|
||||
.command("pull", "Pull new/today image(s)")
|
||||
.action(async function pull(){
|
||||
const images= {
|
||||
@ -18,15 +18,19 @@ $.api()
|
||||
};
|
||||
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);
|
||||
const images_save= Object.entries(images)
|
||||
.reduce((acc, [ key, { caption } ])=>
|
||||
Reflect.set(acc, key, caption) && acc,
|
||||
{});
|
||||
convert(paths, images_save);
|
||||
s.echo(JSON.stringify(images_save, null, "\t")).to(path_info);
|
||||
$.exit(0);
|
||||
})
|
||||
.command("redraw")
|
||||
.action(function redraw(){
|
||||
const paths= [ "now", "prev" ].map(key=> join(path_home, `${key}.jpg`));
|
||||
const images= s.cat(path_info).xargs(JSON.parse);
|
||||
convert(paths, images);
|
||||
$.exit(0);
|
||||
})
|
||||
.command("status")
|
||||
@ -40,13 +44,35 @@ $.api()
|
||||
/** @typedef {{ url: string, caption: string }} T_response */
|
||||
/** @typedef {Record<"now"|"prev",T_response>} T_images */
|
||||
/** @param {Record<"now"|"prev",string>} paths */
|
||||
function convert(paths){
|
||||
function convert(paths, images){
|
||||
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(" ");
|
||||
const caption= (position, text)=> [
|
||||
"convert",
|
||||
`"${target}"`,
|
||||
"\\(",
|
||||
"-pointsize", "12",
|
||||
"-background", "transparent",
|
||||
"-fill", "white",
|
||||
"-family", `"Ubuntu Mono"`,
|
||||
"-weight", "Bold",
|
||||
"-gravity", "center",
|
||||
"-bordercolor", '"rgba(0,0,0,0.3)"',
|
||||
"-border", "10",
|
||||
"-size", "500x",
|
||||
`caption:"${text}"`,
|
||||
"\\)",
|
||||
"-gravity", position,
|
||||
"-geometry", "+0+0",
|
||||
"-composite",
|
||||
`"${target}"`,
|
||||
].join(" ");
|
||||
s.run`convert ${paths} ${params} +append ${target}`;
|
||||
s.run(caption("southwest", images.now));
|
||||
s.run(caption("southeast", images.prev));
|
||||
}
|
||||
import { writeFileSync } from "node:fs";
|
||||
/** @param {T_images} images */
|
||||
|
Loading…
Reference in New Issue
Block a user