mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-11 03:33:03 +03:00
upd
This commit is contained in:
parent
30219f8ec1
commit
a83efdaec5
17 changed files with 534 additions and 17 deletions
35
.tmuxp/digital.yaml
Executable file
35
.tmuxp/digital.yaml
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
session_name: digital
|
||||
start_directory: ~/Code/Digital_Schedule
|
||||
windows:
|
||||
- window_name: vifm
|
||||
layout: main-horizontal
|
||||
shell_command_before:
|
||||
- conda activate traject
|
||||
panes:
|
||||
- shell_command:
|
||||
- cd ~/Code/Digital_Schedule
|
||||
- vifm .
|
||||
- window_name: deploy
|
||||
layout: main-vertical
|
||||
focus: true
|
||||
shell_command_before:
|
||||
- conda activate traject
|
||||
panes:
|
||||
- shell_command:
|
||||
- cd ~/Code/Digital_Schedule
|
||||
- cd ~/Code/Digital_Schedule/digital-schedule-backend
|
||||
- git pull
|
||||
- yarn run debug
|
||||
- shell_command:
|
||||
- cd ~/Code/Digital_Schedule/digital-schedule-frontend
|
||||
- git pull
|
||||
- npm run dev
|
||||
- shell_command:
|
||||
- cd ~/Code/Digital_Schedule
|
||||
- docker-compose up
|
||||
- window_name: emacs
|
||||
panes:
|
||||
- shell_command:
|
||||
- cd ~/Code/Digital_Schedule/digital-schedule-backend
|
||||
- conda activate traject
|
||||
- emacs
|
||||
37
.tmuxp/traject.yaml
Executable file
37
.tmuxp/traject.yaml
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
session_name: traject
|
||||
start_directory: ~/Code/Digital_Trajectories
|
||||
windows:
|
||||
- window_name: vifm
|
||||
layout: main-horizontal
|
||||
shell_command_before:
|
||||
- conda activate traject
|
||||
panes:
|
||||
- shell_command:
|
||||
- cd ~/Code/Digital_Trajectories
|
||||
- vifm .
|
||||
- window_name: deploy
|
||||
layout: main-vertical
|
||||
shell_command_before:
|
||||
- conda activate traject
|
||||
panes:
|
||||
- shell_command:
|
||||
- cd ~/Code/Digital_Trajectories/digital-trajectories-backend
|
||||
- git pull
|
||||
- cd ~/Code/Digital_Trajectories
|
||||
- cd ~/Code/Digital_Trajectories/digital-trajectories-backend
|
||||
- yarn run debug
|
||||
- shell_command:
|
||||
- cd ~/Code/Digital_Trajectories/digital-trajectories-frontend
|
||||
- git pull
|
||||
- yarn run serve
|
||||
- shell_command:
|
||||
- cd ~/Code/Digital_Trajectories
|
||||
- docker-compose up
|
||||
- shell_command:
|
||||
- vue-devtools
|
||||
- window_name: emacs
|
||||
panes:
|
||||
- shell_command:
|
||||
- cd ~/Code/Digital_Trajectories/digital-trajectories-backend
|
||||
- conda activate traject
|
||||
- emacs
|
||||
182
bin/anbox-bridge.sh
Executable file
182
bin/anbox-bridge.sh
Executable file
|
|
@ -0,0 +1,182 @@
|
|||
#!/bin/sh
|
||||
# Copyright (C) 2016 The Linux Containers Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Taken from https://github.com/lxc/lxd-pkg-ubuntu/blob/dpm-xenial/lxd-bridge/lxd-bridge
|
||||
# but modified for the use within anbox.
|
||||
|
||||
varrun="/run/anbox"
|
||||
|
||||
if [ -n "$SNAP_DATA" ]; then
|
||||
varrun="$SNAP_DATA"/network
|
||||
fi
|
||||
|
||||
BRIDGE="anbox0"
|
||||
|
||||
# IPv4
|
||||
IPV4_ADDR="192.168.250.1"
|
||||
IPV4_NETMASK="255.255.255.0"
|
||||
IPV4_NETWORK="192.168.250.1/24"
|
||||
IPV4_BROADCAST="0.0.0.0"
|
||||
IPV4_NAT="true"
|
||||
|
||||
if [ -n "$SNAP" ]; then
|
||||
snap_ipv4_address=$(snapctl get bridge.address)
|
||||
snap_ipv4_netmask=$(snapctl get bridge.netmask)
|
||||
snap_ipv4_network=$(snapctl get bridge.network)
|
||||
snap_ipv4_broadcast=$(snapctl get bridge.broadcast)
|
||||
snap_enable_nat=$(snapctl get bridge.nat.enable)
|
||||
if [ -n "$snap_ipv4_address" ]; then
|
||||
IPV4_ADDR="$snap_ipv4_address"
|
||||
fi
|
||||
if [ -n "$snap_ipv4_netmask" ]; then
|
||||
IPV4_NETMASK="$snap_ipv4_netmask"
|
||||
fi
|
||||
if [ -n "$snap_ipv4_network" ]; then
|
||||
IPV4_NETWORK="$snap_ipv4_network"
|
||||
fi
|
||||
if [ -n "$snap_ipv4_broadcast" ]; then
|
||||
IPV4_BROADCAST="$snap_ipv4_broadcast"
|
||||
fi
|
||||
if [ "$snap_enable_nat" = false ]; then
|
||||
IPV4_NAT="false"
|
||||
fi
|
||||
fi
|
||||
|
||||
use_iptables_lock="-w"
|
||||
iptables -w -L -n > /dev/null 2>&1 || use_iptables_lock=""
|
||||
|
||||
_netmask2cidr () {
|
||||
# Assumes there's no "255." after a non-255 byte in the mask
|
||||
local x=${1##*255.}
|
||||
set -- "0^^^128^192^224^240^248^252^254^" "$(( (${#1} - ${#x})*2 ))" "${x%%.*}"
|
||||
x=${1%%${3}*}
|
||||
echo $(( ${2} + (${#x}/4) ))
|
||||
}
|
||||
|
||||
ifdown() {
|
||||
ip addr flush dev "${1}"
|
||||
ip link set dev "${1}" down
|
||||
}
|
||||
|
||||
ifup() {
|
||||
[ "${HAS_IPV6}" = "true" ] && [ "${IPV6_PROXY}" = "true" ] && ip addr add fe80::1/64 dev "${1}"
|
||||
if [ -n "${IPV4_NETMASK}" ] && [ -n "${IPV4_ADDR}" ]; then
|
||||
MASK=$(_netmask2cidr ${IPV4_NETMASK})
|
||||
CIDR_ADDR="${IPV4_ADDR}/${MASK}"
|
||||
ip addr add "${CIDR_ADDR}" broadcast "${IPV4_BROADCAST}" dev "${1}"
|
||||
fi
|
||||
ip link set dev "${1}" up
|
||||
}
|
||||
|
||||
start() {
|
||||
[ ! -f "${varrun}/network_up" ] || { echo "anbox-bridge is already running"; exit 1; }
|
||||
|
||||
if [ -d /sys/class/net/${BRIDGE} ]; then
|
||||
stop force 2>/dev/null || true
|
||||
fi
|
||||
|
||||
FAILED=1
|
||||
|
||||
cleanup() {
|
||||
set +e
|
||||
if [ "${FAILED}" = "1" ]; then
|
||||
echo "Failed to setup anbox-bridge." >&2
|
||||
stop force
|
||||
fi
|
||||
}
|
||||
|
||||
trap cleanup EXIT HUP INT TERM
|
||||
set -e
|
||||
|
||||
# set up the anbox network
|
||||
[ ! -d "/sys/class/net/${BRIDGE}" ] && ip link add dev "${BRIDGE}" type bridge
|
||||
|
||||
# if we are run from systemd on a system with selinux enabled,
|
||||
# the mkdir will create /run/anbox as init_var_run_t which dnsmasq
|
||||
# can't write its pid into, so we restorecon it (to var_run_t)
|
||||
if [ ! -d "${varrun}" ]; then
|
||||
mkdir -p "${varrun}"
|
||||
if which restorecon >/dev/null 2>&1; then
|
||||
restorecon "${varrun}"
|
||||
fi
|
||||
fi
|
||||
|
||||
ifup "${BRIDGE}" "${IPV4_ADDR}" "${IPV4_NETMASK}"
|
||||
|
||||
IPV4_ARG=""
|
||||
if [ -n "${IPV4_ADDR}" ] && [ -n "${IPV4_NETMASK}" ] && [ -n "${IPV4_NETWORK}" ]; then
|
||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
if [ "${IPV4_NAT}" = "true" ]; then
|
||||
iptables "${use_iptables_lock}" -t nat -A POSTROUTING -s "${IPV4_NETWORK}" ! -d "${IPV4_NETWORK}" -j MASQUERADE -m comment --comment "managed by anbox-bridge"
|
||||
fi
|
||||
fi
|
||||
|
||||
iptables "${use_iptables_lock}" -I INPUT -i "${BRIDGE}" -p udp --dport 67 -j ACCEPT -m comment --comment "managed by anbox-bridge"
|
||||
iptables "${use_iptables_lock}" -I INPUT -i "${BRIDGE}" -p tcp --dport 67 -j ACCEPT -m comment --comment "managed by anbox-bridge"
|
||||
iptables "${use_iptables_lock}" -I INPUT -i "${BRIDGE}" -p udp --dport 53 -j ACCEPT -m comment --comment "managed by anbox-bridge"
|
||||
iptables "${use_iptables_lock}" -I INPUT -i "${BRIDGE}" -p tcp --dport 53 -j ACCEPT -m comment --comment "managed by anbox-bridge"
|
||||
iptables "${use_iptables_lock}" -I FORWARD -i "${BRIDGE}" -j ACCEPT -m comment --comment "managed by anbox-bridge"
|
||||
iptables "${use_iptables_lock}" -I FORWARD -o "${BRIDGE}" -j ACCEPT -m comment --comment "managed by anbox-bridge"
|
||||
iptables "${use_iptables_lock}" -t mangle -A POSTROUTING -o "${BRIDGE}" -p udp -m udp --dport 68 -j CHECKSUM --checksum-fill -m comment --comment "managed by anbox-bridge"
|
||||
|
||||
touch "${varrun}/network_up"
|
||||
FAILED=0
|
||||
}
|
||||
|
||||
stop() {
|
||||
[ -f "${varrun}/network_up" ] || [ "${1}" = "force" ] || { echo "anbox-bridge isn't running"; exit 1; }
|
||||
|
||||
if [ -d /sys/class/net/${BRIDGE} ]; then
|
||||
ifdown ${BRIDGE}
|
||||
iptables ${use_iptables_lock} -D INPUT -i ${BRIDGE} -p udp --dport 67 -j ACCEPT -m comment --comment "managed by anbox-bridge"
|
||||
iptables ${use_iptables_lock} -D INPUT -i ${BRIDGE} -p tcp --dport 67 -j ACCEPT -m comment --comment "managed by anbox-bridge"
|
||||
iptables ${use_iptables_lock} -D INPUT -i ${BRIDGE} -p udp --dport 53 -j ACCEPT -m comment --comment "managed by anbox-bridge"
|
||||
iptables ${use_iptables_lock} -D INPUT -i ${BRIDGE} -p tcp --dport 53 -j ACCEPT -m comment --comment "managed by anbox-bridge"
|
||||
iptables ${use_iptables_lock} -D FORWARD -i ${BRIDGE} -j ACCEPT -m comment --comment "managed by anbox-bridge"
|
||||
iptables ${use_iptables_lock} -D FORWARD -o ${BRIDGE} -j ACCEPT -m comment --comment "managed by anbox-bridge"
|
||||
iptables ${use_iptables_lock} -t mangle -D POSTROUTING -o ${BRIDGE} -p udp -m udp --dport 68 -j CHECKSUM --checksum-fill -m comment --comment "managed by anbox-bridge"
|
||||
|
||||
if [ -n "${IPV4_NETWORK}" ] && [ "${IPV4_NAT}" = "true" ]; then
|
||||
iptables ${use_iptables_lock} -t nat -D POSTROUTING -s ${IPV4_NETWORK} ! -d ${IPV4_NETWORK} -j MASQUERADE -m comment --comment "managed by anbox-bridge"
|
||||
fi
|
||||
|
||||
# if ${BRIDGE} has attached interfaces, don't destroy the bridge
|
||||
ls /sys/class/net/${BRIDGE}/brif/* > /dev/null 2>&1 || ip link delete "${BRIDGE}"
|
||||
fi
|
||||
|
||||
rm -f "${varrun}/network_up"
|
||||
}
|
||||
|
||||
# See how we were called.
|
||||
case "${1}" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
|
||||
restart|reload|force-reload)
|
||||
${0} stop
|
||||
${0} start
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: ${0} {start|stop|restart|reload|force-reload}"
|
||||
exit 2
|
||||
esac
|
||||
|
||||
exit $?
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash
|
||||
afk_event=$(curl -s -X GET "http://localhost:5600/api/0/buckets/aw-watcher-afk_pntk/events?limit=1" -H "accept: application/json")
|
||||
afk_event=$(curl -s -X GET "http://localhost:5600/api/0/buckets/aw-watcher-afk_$(hostname)/events?limit=1" -H "accept: application/json")
|
||||
status=$(echo ${afk_event} | jq -r '.[0].data.status')
|
||||
afk_time=$(echo "${afk_event}" | jq -r '.[0].duration' | xargs -I ! date -u -d @! +"%H:%M")
|
||||
|
||||
|
|
|
|||
|
|
@ -7,3 +7,4 @@ fi
|
|||
ip_info=$(curl -s http://api.ipstack.com/${ip}?access_key=${API_KEY})
|
||||
emoji=$(echo $ip_info | jq -r '.location.country_flag_emoji')
|
||||
echo "$emoji $ip"
|
||||
echo "$emoji"
|
||||
|
|
|
|||
2
bin/scripts/vmd-sep
Executable file
2
bin/scripts/vmd-sep
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
/home/pavel/Programs/miniconda3/bin/vmd $1 &
|
||||
44
config/.emacs.d/elfeed.el
Normal file
44
config/.emacs.d/elfeed.el
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
(defun elfeed-open-current-with-qutebrowser ()
|
||||
"Open current link with qutebrowser."
|
||||
(interactive)
|
||||
(let ((browse-url-generic-program "/usr/bin/qutebrowser"))
|
||||
(elfeed-show-visit t)))
|
||||
|
||||
(defun elfeed-browse-url-with-qutebrowser ()
|
||||
"Open current link with qutebrowser."
|
||||
(interactive)
|
||||
(let ((browse-url-generic-program "/usr/bin/qutebrowser"))
|
||||
(elfeed-search-browse-url t)))
|
||||
|
||||
(defun elfeed-open-current-with-chromium ()
|
||||
"Open current link with qutebrowser."
|
||||
(interactive)
|
||||
(let ((browse-url-generic-program "/usr/bin/chromium"))
|
||||
(elfeed-show-visit t)))
|
||||
|
||||
(defun elfeed-browse-url-with-chromium ()
|
||||
"Open current link with qutebrowser."
|
||||
(interactive)
|
||||
(let ((browse-url-generic-program "/usr/bin/chromium"))
|
||||
(elfeed-search-browse-url t)))
|
||||
|
||||
|
||||
(general-define-key
|
||||
:keymaps 'elfeed-search-mode-map
|
||||
"f" 'elfeed-search-update--force
|
||||
"o" 'elfeed-browse-url-with-qutebrowser
|
||||
"S-o" 'elfeed-browse-url-with-chromium)
|
||||
|
||||
(general-define-key
|
||||
:keymaps 'elfeed-show-mode-map
|
||||
"o" 'elfeed-open-current-with-qutebrowser
|
||||
"S-o" 'elfeed-browse-url-with-chromium
|
||||
)
|
||||
|
||||
(general-define-key
|
||||
:keymaps '(elfeed-search-mode-map elfeed-show-mode-map)
|
||||
"g" nil
|
||||
"gN" 'quit-window
|
||||
"q" 'quit-window
|
||||
"j" 'next-line
|
||||
"k" 'previous-line)
|
||||
|
|
@ -96,12 +96,21 @@
|
|||
(use-package htmlize
|
||||
:straight t)
|
||||
|
||||
(use-package better-jumper
|
||||
:straight t
|
||||
:config
|
||||
(better-jumper-mode +1)
|
||||
(setq better-jumper-add-jump-behavior 'replace))
|
||||
|
||||
(use-package jupyter
|
||||
:straight t
|
||||
:config
|
||||
;; (add-to-list 'evil-emacs-state-modes 'jupyter-repl-mode)
|
||||
)
|
||||
|
||||
;; (use-package ob-typescript
|
||||
;; :straight t)
|
||||
|
||||
;; (use-package smart-backspace
|
||||
;; :straight t)
|
||||
|
||||
|
|
@ -142,10 +151,10 @@
|
|||
(use-package all-the-icons
|
||||
:straight t)
|
||||
|
||||
(use-package solaire-mode
|
||||
:straight t
|
||||
:config
|
||||
(solaire-global-mode +1))
|
||||
;; (use-package solaire-mode
|
||||
;; :straight t
|
||||
;; :config
|
||||
;; (solaire-global-mode +1))
|
||||
|
||||
(use-package highlight-indent-guides
|
||||
:straight t
|
||||
|
|
@ -157,6 +166,14 @@
|
|||
(setq highlight-indent-guides-method 'bitmap)
|
||||
(setq highlight-indent-guides-bitmap-function 'highlight-indent-guides--bitmap-line))
|
||||
|
||||
(use-package auto-dim-other-buffers
|
||||
:straight t
|
||||
:config
|
||||
(set-face-attribute 'auto-dim-other-buffers-face nil
|
||||
:background "#212533")
|
||||
(auto-dim-other-buffers-mode t)
|
||||
)
|
||||
|
||||
(use-package doom-themes
|
||||
:straight t
|
||||
:config
|
||||
|
|
@ -390,6 +407,25 @@
|
|||
:straight t
|
||||
:commands lsp-treemacs-errors-list)
|
||||
|
||||
;; DAP
|
||||
(use-package dap-mode
|
||||
:straight t
|
||||
:init
|
||||
(setq lsp-enable-dap-auto-configure nil)
|
||||
:config
|
||||
|
||||
(require 'dap-node)
|
||||
(dap-node-setup)
|
||||
|
||||
(require 'dap-chrome)
|
||||
(dap-chrome-setup)
|
||||
|
||||
(dap-mode 1)
|
||||
(dap-ui-mode 1)
|
||||
(dap-tooltip-mode 1)
|
||||
(tooltip-mode 1)
|
||||
(dap-ui-controls-mode 1))
|
||||
|
||||
;; Misc
|
||||
(use-package magit
|
||||
:straight t
|
||||
|
|
@ -706,10 +742,8 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
|||
; (general-imap [(shift backspace)] 'backward-delete-char)
|
||||
|
||||
;; Helm
|
||||
(define-key evil-ex-map "b" 'helm-buffers-list)
|
||||
(general-define-key "M-x" 'helm-M-x)
|
||||
(general-define-key "C-s" 'helm-occur)
|
||||
(general-define-key "C-h a" 'helm-apropos)
|
||||
;; (general-define-key "C-s" 'helm-occur)
|
||||
|
||||
;; Buffer switch
|
||||
(general-define-key "C-<right>" 'evil-window-right)
|
||||
|
|
@ -727,7 +761,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
|||
:keymaps '(normal override global)
|
||||
"C-n" 'treemacs)
|
||||
|
||||
(general-nmap "C-o" 'lsp-treemacs-symbols)
|
||||
;; (general-nmap "C-o" 'lsp-treemacs-symbols)
|
||||
|
||||
(general-define-key
|
||||
:keymaps '(treemacs-mode-map) [mouse-1] #'treemacs-single-click-expand-action)
|
||||
|
|
@ -739,6 +773,11 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
|||
(general-nmap "gn" 'tab-new)
|
||||
(general-nmap "gN" 'tab-close)
|
||||
|
||||
;; Jumper
|
||||
(general-nmap
|
||||
"go" 'better-jumper-jump-forward
|
||||
"gp" 'better-jumper-jump-backward)
|
||||
|
||||
;; Org-mode
|
||||
(general-define-key
|
||||
:keymaps 'org-mode-map
|
||||
|
|
@ -785,6 +824,25 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
|||
"la" 'helm-lsp-code-actions
|
||||
"le" 'list-flycheck-errors)
|
||||
|
||||
;; DAP
|
||||
(my-leader-def
|
||||
:infix "d"
|
||||
"d" 'dap-debug
|
||||
"b" 'dap-breakpoint-toggle
|
||||
"c" 'dap-breakpoint-condition
|
||||
"wl" 'dap-ui-locals
|
||||
"wb" 'dap-ui-breakpoints
|
||||
"wr" 'dap-ui-repl
|
||||
"ws" 'dap-ui-sessions
|
||||
"we" 'dap-ui-expressions
|
||||
)
|
||||
|
||||
(my-leader-def
|
||||
:infix "d"
|
||||
:keymaps 'dap-mode-map
|
||||
"h" 'dap-hydra
|
||||
)
|
||||
|
||||
;; Apps
|
||||
(my-leader-def
|
||||
:infix "a"
|
||||
|
|
@ -792,7 +850,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
|||
;; "e" 'elfeed
|
||||
"r" 'jupyter-run-repl
|
||||
"w" 'eww
|
||||
"d" 'dired)
|
||||
"d" 'dired
|
||||
"o" 'org-switchb
|
||||
)
|
||||
|
||||
;; EWW
|
||||
|
||||
|
|
@ -832,9 +892,18 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
|||
"fc" 'helm-show-kill-ring
|
||||
"fa" 'helm-do-ag-project-root
|
||||
"fm" 'helm-bookmarks
|
||||
"ff" 'project-find-file)
|
||||
"ff" 'project-find-file
|
||||
"fe" 'conda-env-activate)
|
||||
|
||||
(my-leader-def "s" 'helm-occur)
|
||||
(my-leader-def "SPC" 'helm-resume)
|
||||
|
||||
(general-define-key
|
||||
:keymaps 'helm-map
|
||||
"C-j" 'helm-next-line
|
||||
"C-k" 'helm-previous-line)
|
||||
(general-imap
|
||||
"C-y" 'helm-show-kill-ring)
|
||||
|
||||
(general-nmap "C-p" 'project-find-file)
|
||||
|
||||
|
|
@ -842,9 +911,6 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
|||
"tw" 'treemacs-switch-workspace
|
||||
"te" 'treemacs-edit-workspaces)
|
||||
|
||||
(my-leader-def
|
||||
"e" 'conda-env-activate)
|
||||
|
||||
(my-leader-def
|
||||
"u" 'undo-tree-visualize)
|
||||
|
||||
|
|
@ -937,9 +1003,11 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
|||
'org-babel-load-languages
|
||||
'((emacs-lisp . t)
|
||||
(python . t)
|
||||
;; (typescript .t)
|
||||
(jupyter . t)))
|
||||
|
||||
(org-babel-jupyter-override-src-block "python")
|
||||
;; (org-babel-jupyter-override-src-block "typescript")
|
||||
|
||||
(add-hook 'org-babel-after-execute-hook 'org-redisplay-inline-images)
|
||||
|
||||
|
|
@ -956,7 +1024,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
|||
'("c83c095dd01cde64b631fb0fe5980587deec3834dc55144a6e78ff91ebc80b19" "bf387180109d222aee6bb089db48ed38403a1e330c9ec69fe1f52460a8936b66" "e074be1c799b509f52870ee596a5977b519f6d269455b84ed998666cf6fc802a" default))
|
||||
'(js-indent-level 2)
|
||||
'(org-agenda-files
|
||||
'("~/Documents/org-mode/Job/dig-traject.org" "~/Documents/org-mode/Personal/look-forward.org" "~/Documents/org-mode/ETU/sem-9.org"))
|
||||
'("~/Documents/org-mode/Personal/misc.org" "~/Documents/org-mode/Job/dig-traject.org" "~/Documents/org-mode/Personal/look-forward.org" "~/Documents/org-mode/ETU/sem-9.org"))
|
||||
'(sgml-basic-offset 2)
|
||||
'(wakatime-cli-path "/usr/bin/wakatime")
|
||||
'(wakatime-python-bin nil))
|
||||
|
|
|
|||
60
config/.emacs.d/org-tangle.el
Normal file
60
config/.emacs.d/org-tangle.el
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
(defun org-babel-tangle-collect-blocks-handle-tangle-list (&optional language tangle-file)
|
||||
"Can be used as :override advice for `org-babel-tangle-collect-blocks'.
|
||||
Handles lists of :tangle files."
|
||||
(let ((counter 0) last-heading-pos blocks)
|
||||
(org-babel-map-src-blocks (buffer-file-name)
|
||||
(let ((current-heading-pos
|
||||
(org-with-wide-buffer
|
||||
(org-with-limited-levels (outline-previous-heading)))))
|
||||
(if (eq last-heading-pos current-heading-pos) (cl-incf counter)
|
||||
(setq counter 1)
|
||||
(setq last-heading-pos current-heading-pos)))
|
||||
(unless (org-in-commented-heading-p)
|
||||
(let* ((info (org-babel-get-src-block-info 'light))
|
||||
(src-lang (nth 0 info))
|
||||
(src-tfiles (cdr (assq :tangle (nth 2 info))))) ; Tobias: accept list for :tangle
|
||||
(unless (consp src-tfiles) ; Tobias: unify handling of strings and lists for :tangle
|
||||
(setq src-tfiles (list src-tfiles))) ; Tobias: unify handling
|
||||
(dolist (src-tfile src-tfiles) ; Tobias: iterate over list
|
||||
(unless (or (string= src-tfile "no")
|
||||
(and tangle-file (not (equal tangle-file src-tfile)))
|
||||
(and language (not (string= language src-lang))))
|
||||
;; Add the spec for this block to blocks under its
|
||||
;; language.
|
||||
(let ((by-lang (assoc src-lang blocks))
|
||||
(block (org-babel-tangle-single-block counter)))
|
||||
(setcdr (assoc :tangle (nth 4 block)) src-tfile) ; Tobias:
|
||||
(if by-lang (setcdr by-lang (cons block (cdr by-lang)))
|
||||
(push (cons src-lang (list block)) blocks)))))))) ; Tobias: just ()
|
||||
;; Ensure blocks are in the correct order.
|
||||
(mapcar (lambda (b) (cons (car b) (nreverse (cdr b)))) blocks)))
|
||||
|
||||
(defun org-babel-tangle-single-block-handle-tangle-list (oldfun block-counter &optional only-this-block)
|
||||
"Can be used as :around advice for `org-babel-tangle-single-block'.
|
||||
If the :tangle header arg is a list of files. Handle all files"
|
||||
(let* ((info (org-babel-get-src-block-info))
|
||||
(params (nth 2 info))
|
||||
(tfiles (cdr (assoc :tangle params))))
|
||||
(if (null (and only-this-block (consp tfiles)))
|
||||
(funcall oldfun block-counter only-this-block)
|
||||
(cl-assert (listp tfiles) nil
|
||||
":tangle only allows a tangle file name or a list of tangle file names")
|
||||
(let ((ret (mapcar
|
||||
(lambda (tfile)
|
||||
(let (old-get-info)
|
||||
(cl-letf* (((symbol-function 'old-get-info) (symbol-function 'org-babel-get-src-block-info))
|
||||
((symbol-function 'org-babel-get-src-block-info)
|
||||
`(lambda (&rest get-info-args)
|
||||
(let* ((info (apply 'old-get-info get-info-args))
|
||||
(params (nth 2 info))
|
||||
(tfile-cons (assoc :tangle params)))
|
||||
(setcdr tfile-cons ,tfile)
|
||||
info))))
|
||||
(funcall oldfun block-counter only-this-block))))
|
||||
tfiles)))
|
||||
(if only-this-block
|
||||
(list (cons (cl-caaar ret) (mapcar #'cadar ret)))
|
||||
ret)))))
|
||||
|
||||
(advice-add 'org-babel-tangle-collect-blocks :override #'org-babel-tangle-collect-blocks-handle-tangle-list)
|
||||
(advice-add 'org-babel-tangle-single-block :around #'org-babel-tangle-single-block-handle-tangle-list)
|
||||
9
config/.emacs.d/snippets/latex-mode/float listing
Normal file
9
config/.emacs.d/snippets/latex-mode/float listing
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# key: flst
|
||||
# name: float listing
|
||||
# --
|
||||
\begin{listing}[h]
|
||||
\frame${1:text}file[fontsize=\small]{$2}
|
||||
\caption{$3}%
|
||||
\label{lst:$4}
|
||||
\end{listing}
|
||||
$0
|
||||
6
config/.emacs.d/snippets/latex-mode/floatbarrier
Normal file
6
config/.emacs.d/snippets/latex-mode/floatbarrier
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: floatbarrier
|
||||
# key: fb
|
||||
# --
|
||||
\FloatBarrier{}
|
||||
$0
|
||||
11
config/.emacs.d/snippets/latex-mode/lfig
Normal file
11
config/.emacs.d/snippets/latex-mode/lfig
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# key: lfig
|
||||
# name: lfig
|
||||
# --
|
||||
\begin{figure}[h]
|
||||
\centering
|
||||
\includegraphics[${1:width=\textwidth}]{${2:`(shell-command-to-string "find -name \"*.png\" -type f -print0 | xargs -0 stat --format '%Y :%y %n' | sort -nr | head -n 1 | awk '{ printf $5 }'
|
||||
")`}}
|
||||
\caption{$3}%
|
||||
\label{fig:${4:label}}
|
||||
\end{figure}
|
||||
$0
|
||||
|
|
@ -2,4 +2,4 @@
|
|||
# name: рис
|
||||
# key: рис
|
||||
# --
|
||||
рис.~\ref{fig:$1} $0
|
||||
рис.~\ref{fig:$1}$0
|
||||
|
|
@ -116,7 +116,7 @@ assign [class="Postman"] $w4
|
|||
assign [class="Chromium-browse"] $w4
|
||||
assign [class="chromium"] $w4
|
||||
assign [class="google-chrome"] $w4
|
||||
assign [class="Electron"] $w4
|
||||
assign [title="Vue Developer Tools"] $w4
|
||||
assign [class="Google Play Music Desktop Player"] $w9
|
||||
assign [class="jetbrains-datagrip"] $w4
|
||||
assign [class="zoom"] $w7
|
||||
|
|
@ -266,6 +266,7 @@ mode "apps" {
|
|||
bindsym c exec "copyq toggle"; mode default
|
||||
bindsym k exec "keepassxc"; mode default
|
||||
bindsym e exec mailspring; mode default
|
||||
bindsym a exec emacs; mode default
|
||||
}
|
||||
|
||||
bindsym $mod+p exec "copyq menu"
|
||||
|
|
@ -339,6 +340,7 @@ exec --no-startup-id pulseeffects --gapplication-service
|
|||
|
||||
# Screenshots
|
||||
bindsym --release Print exec "flameshot gui"
|
||||
bindsym --release Shift+Print exec "xfce4-screenshooter"
|
||||
|
||||
# Sudo
|
||||
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||
|
|
|
|||
|
|
@ -25,6 +25,13 @@ instance=Master
|
|||
interval=once
|
||||
signal=2
|
||||
command=~/bin/i3blocks/volume 5 pulse
|
||||
separator=false
|
||||
|
||||
[mpd]
|
||||
label=
|
||||
interval=1
|
||||
color=#FFA000
|
||||
command=~/bin/i3blocks/mpd
|
||||
|
||||
[cpu_usage]
|
||||
label=
|
||||
|
|
|
|||
|
|
@ -6,10 +6,53 @@
|
|||
|
||||
config_version: 2
|
||||
settings:
|
||||
colors.webpage.darkmode.enabled:
|
||||
global: false
|
||||
content.javascript.enabled:
|
||||
'*://*.gitlab.etu.ru/*': true
|
||||
'*://*.mega.nz/*': true
|
||||
'*://*.my.vultr.com/*': true
|
||||
'*://*.pandas.pydata.org/*': true
|
||||
'*://*.sqrtminusone.ddns.net/*': true
|
||||
'*://*.www.newscientist.com/*': false
|
||||
'*://*.www.youtube.com/*': true
|
||||
'*://code.visualstudio.com/*': true
|
||||
'*://datalore.jetbrains.com/*': true
|
||||
'*://docs.google.com/*': true
|
||||
'*://drive.google.com/*': true
|
||||
'*://github.com/*': true
|
||||
'*://gitlab.etu.ru/*': false
|
||||
'*://rasbt.github.io/*': true
|
||||
'*://trello.com/*': true
|
||||
'*://us02web.zoom.us/*': true
|
||||
'*://vk.com/*': true
|
||||
'*://wakatime.com/*': true
|
||||
'*://www.reddit.com/*': true
|
||||
'*://www.windy.com/*': true
|
||||
'*://x-extends.github.io/*': true
|
||||
content.media.audio_capture:
|
||||
https://sqrtminusone.ddns.net:1984: true
|
||||
content.media.audio_video_capture:
|
||||
https://sqrtminusone.ddns.net:1984: true
|
||||
content.media.video_capture:
|
||||
https://sqrtminusone.ddns.net:1984: true
|
||||
content.notifications:
|
||||
https://demo.freshrss.org: false
|
||||
https://original-films.com: false
|
||||
https://sqrtminusone.ddns.net: false
|
||||
https://sqrtminusone.ddns.net:1985: false
|
||||
https://thepiratebay.org: false
|
||||
https://www.reddit.com: false
|
||||
content.register_protocol_handler:
|
||||
https://mail.google.com?extsrc=mailto&url=%25s: false
|
||||
fonts.default_family:
|
||||
global: monospace
|
||||
fonts.default_size:
|
||||
global: 12pt
|
||||
fonts.web.family.fixed:
|
||||
global: monospace
|
||||
fonts.web.size.default_fixed:
|
||||
global: 16
|
||||
statusbar.widgets:
|
||||
global:
|
||||
- keypress
|
||||
|
|
@ -34,3 +77,5 @@ settings:
|
|||
- utm_campaign
|
||||
- utm_term
|
||||
- utm_content
|
||||
zoom.default:
|
||||
global: '125'
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ c.fonts.web.size.default_fixed = 13
|
|||
# config.unbind('T', mode='normal')
|
||||
# config.bind('T', 'set-cmd-text -s :buffer')
|
||||
|
||||
c.content.javascript.enabled = False
|
||||
|
||||
config.bind('\\t', 'set-cmd-text -s :buffer')
|
||||
config.bind('\\b', 'set-cmd-text -s :bookmark-load')
|
||||
config.bind('\\ww', ':open file:///home/pavel/MEGAsync/Sync/vimwiki-html/index.html')
|
||||
|
|
@ -23,6 +25,12 @@ config.bind('\\ww', ':open file:///home/pavel/MEGAsync/Sync/vimwiki-html/index.h
|
|||
config.bind('\\z1', 'set zoom.default 100 ;; set fonts.default_size 10pt')
|
||||
config.bind('\\z2', 'set zoom.default 125 ;; set fonts.default_size 12pt')
|
||||
|
||||
if c.colors.webpage.darkmode.enabled:
|
||||
config.bind('\\d', 'set colors.webpage.darkmode.enabled False ;; restart')
|
||||
else:
|
||||
config.bind('\\d', 'set colors.webpage.darkmode.enabled True ;; restart')
|
||||
|
||||
|
||||
# config.unbind('<Escape>', mode='insert')
|
||||
config.bind('<Shift-Escape>', 'fake-key <Escape>', mode='insert')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue