From f284ce81926056c169be918889aadb1e234fa43c Mon Sep 17 00:00:00 2001 From: Flinner Date: Mon, 6 Sep 2021 09:38:06 +0300 Subject: [PATCH] stuff --- bin/bin/keyboard | 1 + bin/bin/paul-content.sh | 11 ++++++++++ bin/bin/paul.sh | 16 +++++++++++--- bin/bin/wm/lockscreen | 2 +- emacs.mine/.config/emacs.mine/emacs.org | 26 ++++++++++++++++++++--- htop/.config/htop/htoprc | 4 ++-- mpv/.config/mpv/script-opts/subs2srs.conf | 8 +++---- ranger/.config/ranger/rc.conf | 2 +- sxhkd/.config/sxhkd/sxhkdrc | 4 ++-- zsh/.zshrc | 21 +++++++++++++++++- 10 files changed, 78 insertions(+), 17 deletions(-) create mode 100755 bin/bin/paul-content.sh diff --git a/bin/bin/keyboard b/bin/bin/keyboard index 0441edf..a824076 100755 --- a/bin/bin/keyboard +++ b/bin/bin/keyboard @@ -1,4 +1,5 @@ setxkbmap -option ctrl:swapcaps setxkbmap -option altwin:swap_lalt_lwin setxkbmap -model pc105 -layout us,ar -variant ,qwerty -option grp:shifts_toggle +xinput set-prop 18 309 1 diff --git a/bin/bin/paul-content.sh b/bin/bin/paul-content.sh new file mode 100755 index 0000000..0424ddd --- /dev/null +++ b/bin/bin/paul-content.sh @@ -0,0 +1,11 @@ +curl_cache (){ + local cache_path=`echo $1 | sed 's|/|_|g'` + local cache_path="/tmp/$cache_path" + + [ -f "$cache_path" ] || curl -s "$1" -o "$cache_path" + + cat "$cache_path" +} + + +curl_cache "$1" | pup 'body .content text{}' | sed -r '/^\s*$/d' | bat --language=html diff --git a/bin/bin/paul.sh b/bin/bin/paul.sh index 701d2c4..8697ac7 100755 --- a/bin/bin/paul.sh +++ b/bin/bin/paul.sh @@ -39,10 +39,20 @@ solution_url="$domain/$solution_path" # ==== get solution ========= # download if not already downloaded +echo '** Item +:PROPERTIES: +:ANKI_DECK: Math::Calculus-III +:ANKI_NOTE_TYPE: Basic +:END: +' solution_path=`curl_cache "$solution_url"` - +echo '*** Front' echo "$question_text" echo "\n" -cat "$solution_path" | pup 'body .soln-content p text{}' - +echo '*** Back' +cat "$solution_path" | pup 'body .soln-content text{}' | sed -r '/^\s*$/d' +solution_title=`cat "$solution_path" | pup 'title text{}' | sed -r '/^\s*$/d'` +echo "\n" +echo "[[$solution_url][$solution_title]]" +echo "\n" diff --git a/bin/bin/wm/lockscreen b/bin/bin/wm/lockscreen index 4fdebde..eee7122 100755 --- a/bin/bin/wm/lockscreen +++ b/bin/bin/wm/lockscreen @@ -1,7 +1,7 @@ #!/bin/bash #img=$(mktemp /tmp/XXXXXXXXXX.png) qdbus org.keepassxc.KeePassXC.MainWindow /keepassxc org.keepassxc.MainWindow.lockAllDatabases & -img="$HOME/Pictures/wallpapers/arch-linux-dunno.png" +img="$HOME/Pictures/wall.png" # Take a screenshot of current desktop #import -window root $img ## Pixelate the screenshot diff --git a/emacs.mine/.config/emacs.mine/emacs.org b/emacs.mine/.config/emacs.mine/emacs.org index 33c78c3..fede5ed 100644 --- a/emacs.mine/.config/emacs.mine/emacs.org +++ b/emacs.mine/.config/emacs.mine/emacs.org @@ -743,7 +743,7 @@ better sorting for ivy, company.. org-agenda-files (list org-directory (concat org-roam-directory "life.org")) rmh-elfeed-org-files (list "~/Documents/private.el/elfeed.org") elfeed-dashboard-file "~/Documents/private.el/elfeed-dashboard.org" - org-preview-latex-image-directory "/tmp/ltximg" + org-preview-latex-image-directory "~/.cache/ltximg" org-my-anki-file (concat org-roam-directory "anki.org") ) #+end_src @@ -760,7 +760,6 @@ Modes To Start use-package #+begin_src emacs-lisp (use-package org - :defer 3 :hook (org-mode . my/org-mode/org-mode-setup) (org-mode . my/org-mode/load-prettify-symbols); symbols (org-mode . auto-fill-mode) @@ -1020,7 +1019,7 @@ launch with =emacsclient -e '(make-orgcapture-frame)'= :unnarrowed t))) :config ;; side window - (require 'org-roam-protocol) + ;(require 'org-roam-protocol) (add-to-list 'display-buffer-alist '("\\*org-roam\\*" (display-buffer-in-side-window) @@ -1069,6 +1068,13 @@ launch with =emacsclient -e '(make-orgcapture-frame)'= #+end_src +** org-download +#+begin_src emacs-lisp + (use-package org-download + :after org + ) +#+end_src + ** Anki #+begin_src emacs-lisp (use-package anki-editor @@ -1385,6 +1391,12 @@ prettier (use-package prettier) #+end_src +lsp hooks setups +#+begin_src emacs-lisp + (add-hook 'html-mode-hook 'lsp) + (add-hook 'js-mode-hook 'lsp) +#+end_src + *** Markdown Better Diff in header sizes #+begin_src emacs-lisp @@ -1424,6 +1436,14 @@ Better Diff in header sizes (setq parinfer-rust-auto-download t)) #+end_src +*** C and cpp +#+begin_src emacs-lisp + (use-package cc-mode + :hook (cc-mode . lsp) + :hook (c-mode . lsp) + :hook (c++-mode . lsp)) +#+end_src + * Misc ** Restart Emacs #+begin_src emacs-lisp diff --git a/htop/.config/htop/htoprc b/htop/.config/htop/htoprc index d1ae290..038f6a0 100644 --- a/htop/.config/htop/htoprc +++ b/htop/.config/htop/htoprc @@ -1,8 +1,8 @@ # Beware! This file is rewritten by htop when settings are changed in the interface. # The parser is also very primitive, and not human-friendly. fields=0 48 17 18 38 39 40 2 46 47 49 1 -sort_key=47 -sort_direction=1 +sort_key=49 +sort_direction=-1 tree_sort_key=46 tree_sort_direction=1 hide_kernel_threads=1 diff --git a/mpv/.config/mpv/script-opts/subs2srs.conf b/mpv/.config/mpv/script-opts/subs2srs.conf index f0709af..81a37fd 100644 --- a/mpv/.config/mpv/script-opts/subs2srs.conf +++ b/mpv/.config/mpv/script-opts/subs2srs.conf @@ -6,12 +6,12 @@ deck_name=Japanese::Mining # Model names are listed in `Tools -> Manage note types` menu in Anki. -model_name=Japanese sentences +model_name=animecards # Field names as they appear in the selected note type. -sentence_field=SentKanji -audio_field=SentAudio -image_field=Image +sentence_field=Sentence +audio_field=SentenceAudio +image_field=Picture # The tag(s) added to new notes. Spaces separate multiple tags. # Leave nothing after `=` to disable tagging completely. diff --git a/ranger/.config/ranger/rc.conf b/ranger/.config/ranger/rc.conf index 4655de1..ce3eb3a 100644 --- a/ranger/.config/ranger/rc.conf +++ b/ranger/.config/ranger/rc.conf @@ -40,7 +40,7 @@ set show_hidden false # Ask for a confirmation when running the "delete" command? # Valid values are "always", "never", "multiple" (default) # With "multiple", ranger will ask only if you delete multiple files at once. -set confirm_on_delete multiple +set confirm_on_delete always # Use non-default path for file preview script? # ranger ships with scope.sh, a script that calls external programs (see diff --git a/sxhkd/.config/sxhkd/sxhkdrc b/sxhkd/.config/sxhkd/sxhkdrc index 88c9776..cbc879f 100644 --- a/sxhkd/.config/sxhkd/sxhkdrc +++ b/sxhkd/.config/sxhkd/sxhkdrc @@ -37,8 +37,8 @@ super + Return #mlterm -e zsh || alacritty # make sxhkd reload its configuration files: -super + Escape - pkill -usr1 -x sxhkd && notify-send 'sxhkd' 'Reloaded Config' +#super + Escape + #pkill -usr1 -x sxhkd && notify-send 'sxhkd' 'Reloaded Config' # Doom Emacs Capture #super + ctrl + space diff --git a/zsh/.zshrc b/zsh/.zshrc index 7e4ecb2..071b9cd 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -43,7 +43,7 @@ zplugin snippet OMZ::plugins/vi-mode/vi-mode.plugin.zsh zplugin ice wait'1' lucid zplugin load zdharma/fast-syntax-highlighting -zplugin ice wait'1' lucid +zplugin ice wait'0' lucid zplugin load 'flinner/zsh-emacs' zplugin ice wait lucid atload'_zsh_autosuggest_start' @@ -93,6 +93,7 @@ bindkey jk vi-cmd-mode # exit on partianl command with Ctrl-D exit_zsh() { exit } zle -N exit_zsh +bindkey '^v' edit-command-line bindkey '^D' exit_zsh #=============================================================================================== @@ -143,6 +144,17 @@ ip.me () { curl eth0.me ; curl ipv6.icanhazip.com } # or ip.me curl -F "file=@$file" 0x0.st | xclip -sel clip } +# curl with cache +curl_cache(){ + local cache_path=`echo $1 | sed 's|/|_|g'` + local cache_path="/tmp/$cache_path" + + [ -f "$cache_path" ] || curl -s "$1" -o "$cache_path" + + cat "$cache_path" +} + + alias doas='sudo ' alias sudo='sudo ' @@ -166,6 +178,9 @@ alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo alias ip='ip --color=auto' alias ytfzfd='YTFZF_PLAYER="youtube-dl --embed-subs --write-sub --sub-lang en" ytfzf' +alias cargo-doc-server="python -m http.server -d target/doc/ -b 127.0.0.1" +alias sc="bat ~/schedule.org" + #=============================================================================================== #VARS @@ -238,3 +253,7 @@ PS1="> " RPS1=" " #zplugin ice wait'!0' lucid pick"async.zsh" src"pure.zsh"; zplugin light sindresorhus/pure eval "$(starship init zsh)" +[ -f "/home/user/.ghcup/env" ] && source "/home/user/.ghcup/env" # ghcup-env + +#~/bin/dennis +#cutefetch 2> /dev/null