This commit is contained in:
Pavel Korytov 2020-12-11 12:57:42 +03:00
parent 0cf54d68fe
commit bfd415a0dd
11 changed files with 684 additions and 99 deletions

38
bin/polybar.sh Executable file
View file

@ -0,0 +1,38 @@
#!/bin/bash
# TRAY_MONITOR="HDMI-A-0"
TRAY_MONITOR="DVI-D-0"
declare -A FONT_SIZES=(
["DVI-D-0"]="11"
["HDMI-A-0"]="13"
)
declare -A EMOJI_SCALE=(
["DVI-D-0"]="10"
["HDMI-A-0"]="10"
)
declare -A BAR_HEIGHT=(
["DVI-D-0"]="23"
["HDMI-A-0"]="29"
)
declare -A BLOCKS=(
["DVI-D-0"]="pulseaudio SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP sun aw-afk date TSEP"
["HDMI-A-0"]="pulseaudio mpd SEP cpu ram-memory swap-memory SEP network ipstack-vpn SEP xkeyboard SEP sun aw-afk date TSEP"
)
pkill polybar
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
export MONITOR=$m
if [ "$MONITOR" = "$TRAY_MONITOR" ]; then
export TRAY="right"
else
export TRAY="none"
fi
SIZE=${FONT_SIZES[$MONITOR]}
SCALE=${EMOJI_SCALE[$MONITOR]}
export FONT0="pango:monospace:size=$SIZE;1"
export FONT1="NotoEmoji:scale=$SCALE:antialias=false;1"
export FONT2="fontawesome:pixelsize=$SIZE;1"
export FONT3="JetBrains Mono Nerd Font:monospace:size=$SIZE;1"
export HEIGHT=${BAR_HEIGHT[$MONITOR]}
export RIGHT_BLOCKS=${BLOCKS[$MONITOR]}
polybar --reload mybar &
done

12
bin/polybar/aw_afk.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
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")
uptime=$(datediff "$(uptime -s | xargs -I ! date -d ! -Iseconds)" "$(date -Iseconds)" -f '%H:%M' | xargs -I ! date -d ! +"%H:%M")
res="${afk_time} / ${uptime}"
if [[ $status == 'afk' ]]; then
echo "%{u#f07178}%{+u} [AFK] $res %{u-}"
else
echo "%{u#82aaff}%{+u} $res %{u-}"
fi

17
bin/polybar/ipstack-vpn.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/bash
ip=$(dig +short +timeout=1 myip.opendns.com @resolver1.opendns.com)
API_KEY="8948d12cd68a3b7ac60d405ed4118b43"
if [[ -z $ip || $ip == *"timed out"* ]]; then
echo "%{u#f07178}%{+u} ?? %{u-}"
exit
fi
ip_info=$(curl -s http://api.ipstack.com/${ip}?access_key=${API_KEY})
# emoji=$(echo $ip_info | jq -r '.location.country_flag_emoji')
code=$(echo $ip_info | jq -r '.country_code')
vpn=$(pgrep -a openvpn$ | head -n 1 | awk '{print $NF }' | cut -d '.' -f 1)
if [ -n "$vpn" ]; then
echo "%{u#9cc4ff}%{+u}  $code %{u-}"
else
echo "%{u#f07178}%{+u}  $code %{u-}"
fi

11
bin/polybar/ipstack.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/bash
ip=$(dig +short +timeout=1 myip.opendns.com @resolver1.opendns.com)
API_KEY="8948d12cd68a3b7ac60d405ed4118b43"
if [[ -z $ip || $ip == *"timed out"* ]]; then
echo "%{u#f07178}%{+u} ?? %{u-}"
exit
fi
ip_info=$(curl -s http://api.ipstack.com/${ip}?access_key=${API_KEY})
# emoji=$(echo $ip_info | jq -r '.location.country_flag_emoji')
code=$(echo $ip_info | jq -r '.country_code')
echo "%{u#9cc4ff}%{+u} $code $ip %{u-}"

22
bin/polybar/sun.sh Executable file
View file

@ -0,0 +1,22 @@
#1/bin/bash
LAT=59.9375N
LON=30.308611E
time=$(sunwait poll daylight rise ${LAT} $LON)
function send_report {
report="$(sunwait report ${LAT} ${LON} | sed 's/^[[:space:]]*//gm')"
notify-send "Sunwait report" "$report"
}
case $BLOCK_BUTTON in
1) send_report
esac
if [[ ${time} == 'DAY' ]]; then
sunset=$(sunwait list daylight set ${LAT} ${LON})
echo "%{u#ffcb6b}%{+u} $sunset %{u-}"
else
sunrise=$(sunwait list daylight rise ${LAT} ${LON})
echo "%{u#f07178}%{+u} $sunrise %{u-}"
fi

4
bin/polybar/tray-sep.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
if [ ! -z "$TRAY" ] && [ "$TRAY" != "none" ]; then
echo "| "
fi

View file

@ -113,6 +113,7 @@
(general-def :states '(normal motion emacs) "SPC" nil)
(my-leader-def "?" 'which-key-show-top-level)
(my-leader-def "E" 'eval-expression)
#+end_src
*** Editing
#+begin_src emacs-lisp
@ -198,15 +199,16 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
#+end_src
*** Buffer switch
#+begin_src emacs-lisp
(general-define-key "C-<right>" 'evil-window-right)
(general-define-key "C-<left>" 'evil-window-left)
(general-define-key "C-<up>" 'evil-window-up)
(general-define-key "C-<down>" 'evil-window-down)
(general-define-key "C-h" 'evil-window-left)
(general-define-key "C-l" 'evil-window-right)
(general-define-key "C-k" 'evil-window-up)
(general-define-key "C-j" 'evil-window-down)
(general-define-key
:keymaps 'my-intercept-mode-map
"C-<right>" 'evil-window-right
"C-<left>" 'evil-window-left
"C-<up>" 'evil-window-up
"C-<down>" 'evil-window-down
"C-h" 'evil-window-left
"C-l" 'evil-window-right
"C-k" 'evil-window-up
"C-j" 'evil-window-down)
#+end_src
* General editing & setup
** Evil-mode
@ -244,6 +246,11 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
:config
(evil-commentary-mode))
(use-package evil-collection
:straight t
:config
(evil-collection-init '(eww dired dasboard company vterm flycheck)))
(use-package evil-quickscope
:straight t
:config
@ -251,11 +258,39 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(prog-mode . turn-on-evil-quickscope-mode)
(LaTeX-mode . turn-on-evil-quickscope-mode)
))
#+end_src
** Multiple cursors
#+begin_src emacs-lisp
;; (use-package evil-mc
;; :straight t
;; :config
;; (define-key evil-mc-key-map (kbd "C-n") nil)
;; (define-key evil-mc-key-map (kbd "C-p") nil)
;; (define-key evil-mc-key-map (kbd "g") nil)
;; (evil-define-key 'normal evil-mc-key-map
;; (kbd "C-n") nil
;; (kbd "g") nil
;; (kbd "C-p") nil
;; )
;; (evil-define-key 'visual evil-mc-key-map
;; "A" #'evil-mc-make-cursor-in-visual-selection-end
;; "I" #'evil-mc-make-cursor-in-visual-selection-beg
;; (kbd "C-n") nil
;; (kbd "g") nil
;; (kbd "C-p") nil
;; )
;; (global-evil-mc-mode 1))
;;
;; (general-nmap "gr" evil-mc-cursors-map)
#+end_src
(use-package evil-collection
:straight t
:config
(evil-collection-init '(eww dired dasboard company vterm)))
#+begin_src emacs-lisp
;; (use-package multiple-cursors
;; :straight t)
;;
;; (general-vmap
;; "I" #'mc/edit-lines
;; )
#+end_src
** Undo-redo & undo-tree
#+begin_src emacs-lisp
@ -427,20 +462,21 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
:straight t)
(my-leader-def
"m" 'magit)
"m" 'magit
"M" 'magit-file-dispatch)
#+end_src
** Misc editing helpers
*** Better jumplist
#+begin_src emacs-lisp
(use-package better-jumper
:straight t
:config
(better-jumper-mode +1)
(setq better-jumper-add-jump-behavior 'replace))
(general-nmap
"go" 'better-jumper-jump-forward
"gp" 'better-jumper-jump-backward)
;; (use-package better-jumper
;; :straight t
;; :config
;; (better-jumper-mode +1)
;; (setq better-jumper-add-jump-behavior 'replace))
;;
;; (general-nmap
;; "go" 'better-jumper-jump-forward
;; "gp" 'better-jumper-jump-backward)
#+end_src
*** Smart backspace
#+begin_src emacs-lisp
@ -473,6 +509,25 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(setq-default tab-width 4)
(setq-default evil-shift-round nil)
#+end_src
*** Expand region
#+begin_src emacs-lisp
(use-package expand-region
:straight t)
(general-nmap
"+" 'er/expand-region)
#+end_src
*** Winner mode
#+begin_src emacs-lisp
(use-package winner-mode
:ensure nil
:config
(winner-mode)
:bind (:map evil-window-map
("u" . winner-undo)
("U" . winner-redo)
))
#+end_src
** Editorconfig
#+begin_src emacs-lisp
(use-package editorconfig
@ -540,7 +595,13 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(visual-line-mode nil)))
(evil-collection-define-key 'normal 'dired-mode-map
"h" 'dired-single-up-directory
"l" 'dired-single-buffer))
"l" 'dired-single-buffer
"h" 'dired-single-up-directory
"l" 'dired-single-buffer
"=" 'dired-narrow
"-" 'dired-create-empty-file
(kbd "<left>") 'dired-single-up-directory
(kbd "<right>") 'dired-single-buffer))
(use-package dired+
:straight t
@ -558,6 +619,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package dired-open
:straight t)
(use-package dired-narrow
:straight t)
(my-leader-def "ad" 'dired)
(general-define-key
@ -566,6 +630,10 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
[remap dired-mouse-find-file-other-window] 'dired-single-buffer-mouse
[remap dired-up-directory] 'dired-single-up-directory
"M-<return>" 'dired-open-xdg)
(general-define-key
:keymaps 'dired-narrow-map
[escape] 'keyboard-quit)
#+end_src
* Terminal
#+begin_src emacs-lisp
@ -733,6 +801,21 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
"aa" 'org-agenda
"ao" 'org-switchb)
#+end_src
** Copy link
#+begin_src emacs-lisp
(defun my/org-link-copy (&optional arg)
"Extract URL from org-mode link and add it to kill ring."
(interactive "P")
(let* ((link (org-element-lineage (org-element-context) '(link) t))
(type (org-element-property :type link))
(url (org-element-property :path link))
(url (concat type ":" url)))
(kill-new url)
(message (concat "Copied URL: " url))))
(general-nmap :keymaps 'org-mode-map
"C-x C-l" 'my/org-link-copy)
#+end_src
** UI improvements
#+begin_src emacs-lisp
(use-package org-superstar
@ -761,6 +844,10 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(menu-bar-mode -1)
(scroll-bar-mode -1)
;; Transparency
(set-frame-parameter (selected-frame) 'alpha '(90 . 90))
(add-to-list 'default-frame-alist '(alpha . (90 . 90)))
;; Prettify symbols
(global-prettify-symbols-mode)
@ -782,7 +869,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
;; Line numbers
(global-display-line-numbers-mode 1)
(line-number-mode nil)
(setq display-line-numbers-type 'relative)
(setq display-line-numbers-type 'visual)
(column-number-mode)
;; Parenteses
@ -822,6 +909,12 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(setq doom-modeline-minor-modes nil)
(setq doom-modeline-buffer-state-icon nil))
#+end_src
** Emoji
#+begin_src emacs-lisp
(use-package emojify
:straight t
:hook (after-init . global-emojify-mode))
#+end_src
** Icons
#+begin_src emacs-lisp
(use-package all-the-icons
@ -943,11 +1036,13 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(vue-mode . lsp)
(go-mode . lsp)
(svelte-mode . lsp)
(python-mode . lsp))
(python-mode . lsp)
(json-mode . lsp))
:commands lsp
:config
(setq lsp-idle-delay 1)
(setq lsp-eslint-server-command '("node" "/home/pavel/.emacs.d/.cache/lsp/eslint/unzipped/extension/server/out/eslintServer.js" "--stdio"))
(setq lsp-eslint-run "onSave")
(setq lsp-signature-render-documentation nil)
(add-to-list 'lsp-language-id-configuration '(svelte-mode . "svelte"))
)
@ -957,8 +1052,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
:commands lsp-ui-mode
:config
(setq lsp-ui-doc-delay 2)
(setq lsp-ui-sideline-show-hover nil)
)
(setq lsp-ui-sideline-show-hover nil))
#+end_src
*** Integrations
#+begin_src emacs-lisp
@ -1020,6 +1114,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(setq lsp-enable-dap-auto-configure nil)
:config
(setq dap-ui-variable-length 100)
(require 'dap-node)
(dap-node-setup)
@ -1031,6 +1126,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(dap-tooltip-mode 1)
(tooltip-mode 1)
(dap-ui-controls-mode 1))
(my-leader-def
:infix "d"
"d" 'dap-debug
@ -1048,6 +1144,10 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
:keymaps 'dap-mode-map
"h" 'dap-hydra
)
(defun my/dap-yank-value-at-point (node)
(interactive (list (treemacs-node-at-point)))
(kill-new (message (plist-get (button-get node :item) :value))))
#+end_src
* Languages & Formats
** TypeScript
@ -1062,8 +1162,8 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(setq-local lsp-diagnostic-package :none)
(setq-local flycheck-checker 'javascript-eslint))
(add-hook 'typescript-mode-hook
#'set-flycheck-eslint)
;; (add-hook 'typescript-mode-hook
;; #'set-flycheck-eslint)
#+end_src
** Vue.js
@ -1071,8 +1171,8 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package vue-mode
:straight t)
(add-hook 'vue-mode-hook
#'set-flycheck-eslint)
;; (add-hook 'vue-mode-hook
;; #'set-flycheck-eslint)
(add-hook 'vue-mode-hook #'hs-minor-mode)

View file

@ -83,6 +83,7 @@
(general-def :states '(normal motion emacs) "SPC" nil)
(my-leader-def "?" 'which-key-show-top-level)
(my-leader-def "E" 'eval-expression)
(general-def :states '(normal insert visual)
"<home>" 'beginning-of-line
@ -159,15 +160,16 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
minibuffer-local-isearch-map)
[escape] 'minibuffer-keyboard-quit)
(general-define-key "C-<right>" 'evil-window-right)
(general-define-key "C-<left>" 'evil-window-left)
(general-define-key "C-<up>" 'evil-window-up)
(general-define-key "C-<down>" 'evil-window-down)
(general-define-key "C-h" 'evil-window-left)
(general-define-key "C-l" 'evil-window-right)
(general-define-key "C-k" 'evil-window-up)
(general-define-key "C-j" 'evil-window-down)
(general-define-key
:keymaps 'my-intercept-mode-map
"C-<right>" 'evil-window-right
"C-<left>" 'evil-window-left
"C-<up>" 'evil-window-up
"C-<down>" 'evil-window-down
"C-h" 'evil-window-left
"C-l" 'evil-window-right
"C-k" 'evil-window-up
"C-j" 'evil-window-down)
(use-package evil
:straight t
@ -202,6 +204,11 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
:config
(evil-commentary-mode))
(use-package evil-collection
:straight t
:config
(evil-collection-init '(eww dired dasboard company vterm flycheck)))
(use-package evil-quickscope
:straight t
:config
@ -210,10 +217,34 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(LaTeX-mode . turn-on-evil-quickscope-mode)
))
(use-package evil-collection
:straight t
:config
(evil-collection-init '(eww dired dasboard company vterm)))
;; (use-package evil-mc
;; :straight t
;; :config
;; (define-key evil-mc-key-map (kbd "C-n") nil)
;; (define-key evil-mc-key-map (kbd "C-p") nil)
;; (define-key evil-mc-key-map (kbd "g") nil)
;; (evil-define-key 'normal evil-mc-key-map
;; (kbd "C-n") nil
;; (kbd "g") nil
;; (kbd "C-p") nil
;; )
;; (evil-define-key 'visual evil-mc-key-map
;; "A" #'evil-mc-make-cursor-in-visual-selection-end
;; "I" #'evil-mc-make-cursor-in-visual-selection-beg
;; (kbd "C-n") nil
;; (kbd "g") nil
;; (kbd "C-p") nil
;; )
;; (global-evil-mc-mode 1))
;;
;; (general-nmap "gr" evil-mc-cursors-map)
;; (use-package multiple-cursors
;; :straight t)
;;
;; (general-vmap
;; "I" #'mc/edit-lines
;; )
(use-package undo-tree
:straight t
@ -373,17 +404,18 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
:straight t)
(my-leader-def
"m" 'magit)
"m" 'magit
"M" 'magit-file-dispatch)
(use-package better-jumper
:straight t
:config
(better-jumper-mode +1)
(setq better-jumper-add-jump-behavior 'replace))
(general-nmap
"go" 'better-jumper-jump-forward
"gp" 'better-jumper-jump-backward)
;; (use-package better-jumper
;; :straight t
;; :config
;; (better-jumper-mode +1)
;; (setq better-jumper-add-jump-behavior 'replace))
;;
;; (general-nmap
;; "go" 'better-jumper-jump-forward
;; "gp" 'better-jumper-jump-backward)
;; (use-package smart-backspace
;; :straight t)
@ -408,6 +440,21 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(setq-default tab-width 4)
(setq-default evil-shift-round nil)
(use-package expand-region
:straight t)
(general-nmap
"+" 'er/expand-region)
(use-package winner-mode
:ensure nil
:config
(winner-mode)
:bind (:map evil-window-map
("u" . winner-undo)
("U" . winner-redo)
))
(use-package editorconfig
:straight t
:config
@ -460,7 +507,13 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(visual-line-mode nil)))
(evil-collection-define-key 'normal 'dired-mode-map
"h" 'dired-single-up-directory
"l" 'dired-single-buffer))
"l" 'dired-single-buffer
"h" 'dired-single-up-directory
"l" 'dired-single-buffer
"=" 'dired-narrow
"gc" 'dired-create-empty-file
(kbd "<left>") 'dired-single-up-directory
(kbd "<right>") 'dired-single-buffer))
(use-package dired+
:straight t
@ -478,6 +531,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(use-package dired-open
:straight t)
(use-package dired-narrow
:straight t)
(my-leader-def "ad" 'dired)
(general-define-key
@ -486,6 +542,10 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
[remap dired-mouse-find-file-other-window] 'dired-single-buffer-mouse
[remap dired-up-directory] 'dired-single-up-directory
"M-<return>" 'dired-open-xdg)
(general-define-key
:keymaps 'dired-narrow-map
[escape] 'keyboard-quit)
(use-package vterm
:straight t
@ -634,6 +694,19 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
"aa" 'org-agenda
"ao" 'org-switchb)
(defun my/org-link-copy (&optional arg)
"Extract URL from org-mode link and add it to kill ring."
(interactive "P")
(let* ((link (org-element-lineage (org-element-context) '(link) t))
(type (org-element-property :type link))
(url (org-element-property :path link))
(url (concat type ":" url)))
(kill-new url)
(message (concat "Copied URL: " url))))
(general-nmap :keymaps 'org-mode-map
"C-x C-l" 'my/org-link-copy)
(use-package org-superstar
:straight t
:config
@ -655,6 +728,10 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(menu-bar-mode -1)
(scroll-bar-mode -1)
;; Transparency
(set-frame-parameter (selected-frame) 'alpha '(90 . 90))
(add-to-list 'default-frame-alist '(alpha . (90 . 90)))
;; Prettify symbols
(global-prettify-symbols-mode)
@ -676,7 +753,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
;; Line numbers
(global-display-line-numbers-mode 1)
(line-number-mode nil)
(setq display-line-numbers-type 'relative)
(setq display-line-numbers-type 'visual)
(column-number-mode)
;; Parenteses
@ -712,6 +789,10 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(setq doom-modeline-minor-modes nil)
(setq doom-modeline-buffer-state-icon nil))
(use-package emojify
:straight t
:hook (after-init . global-emojify-mode))
(use-package all-the-icons
:straight t)
@ -795,11 +876,13 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(vue-mode . lsp)
(go-mode . lsp)
(svelte-mode . lsp)
(python-mode . lsp))
(python-mode . lsp)
(json-mode . lsp))
:commands lsp
:config
(setq lsp-idle-delay 1)
(setq lsp-eslint-server-command '("node" "/home/pavel/.emacs.d/.cache/lsp/eslint/unzipped/extension/server/out/eslintServer.js" "--stdio"))
(setq lsp-eslint-run "onSave")
(setq lsp-signature-render-documentation nil)
(add-to-list 'lsp-language-id-configuration '(svelte-mode . "svelte"))
)
@ -809,8 +892,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
:commands lsp-ui-mode
:config
(setq lsp-ui-doc-delay 2)
(setq lsp-ui-sideline-show-hover nil)
)
(setq lsp-ui-sideline-show-hover nil))
(use-package helm-lsp
:straight t
@ -863,6 +945,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(setq lsp-enable-dap-auto-configure nil)
:config
(setq dap-ui-variable-length 100)
(require 'dap-node)
(dap-node-setup)
@ -874,6 +957,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(dap-tooltip-mode 1)
(tooltip-mode 1)
(dap-ui-controls-mode 1))
(my-leader-def
:infix "d"
"d" 'dap-debug
@ -891,6 +975,10 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
:keymaps 'dap-mode-map
"h" 'dap-hydra
)
(defun my/dap-yank-value-at-point (node)
(interactive (list (treemacs-node-at-point)))
(kill-new (message (plist-get (button-get node :item) :value))))
(use-package typescript-mode
:straight t)
@ -900,14 +988,14 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(setq-local lsp-diagnostic-package :none)
(setq-local flycheck-checker 'javascript-eslint))
(add-hook 'typescript-mode-hook
#'set-flycheck-eslint)
;; (add-hook 'typescript-mode-hook
;; #'set-flycheck-eslint)
(use-package vue-mode
:straight t)
(add-hook 'vue-mode-hook
#'set-flycheck-eslint)
;; (add-hook 'vue-mode-hook
;; #'set-flycheck-eslint)
(add-hook 'vue-mode-hook #'hs-minor-mode)

View file

@ -74,11 +74,11 @@ bindsym $mod+Shift+A focus child
set $w1 "1 🚀"
set $w2 "2 🌍"
set $w3 "3 💬"
set $w4 "4 "
set $w4 "4 🛠️"
set $w7 "7 🛰️"
set $w8 "8 📝"
set $w9 "9 🎵"
set $w10 "Z 📦"
set $w10 "10 📦"
bindsym $mod+1 workspace $w1
bindsym $mod+2 workspace $w2
@ -274,7 +274,7 @@ bindsym $mod+Shift+x exec "i3lock -f -i /home/pavel/Pictures/lock-wallpaper-2-1.
# Colors
set $bg-color #292d3e
set $inactive-bg-color #434758
set $inactive-bg-color #434758ee
set $text-color #f3f4f5
set $inactive-text-color #aaaaaa
set $urgent-bg-color #f07178
@ -287,39 +287,38 @@ client.unfocused $inactive-bg-color $inactive-bg-color $inactive-text-co
client.focused_inactive $inactive-bg-color $inactive-bg-color $inactive-text-color $bg-color
client.urgent $urgent-bg-color $urgent-bg-color $urgent-text-color $bg-color
# bar
bar {
status_command i3blocks -c ~/.config/i3/i3blocks.conf
i3bar_command i3bar
font pango:monospace 12
output HDMI-A-0
tray_output none
colors {
background $bg-color
separator #757575
# border background text
focused_workspace $bg-color $bg-color $text-color
inactive_workspace $inactive-bg-color $inactive-bg-color $inactive-text-color
urgent_workspace $urgent-bg-color $urgent-bg-color $urgent-text-color
}
}
exec_always --no-startup-id "bash /home/pavel/bin/polybar.sh"
# bar {
# status_command i3blocks -c ~/.config/i3/i3blocks.conf
# i3bar_command i3bar
# font pango:monospace 12
# output HDMI-A-0
# tray_output none
# colors {
# background $bg-color
# separator #757575
# # border background text
# focused_workspace $bg-color $bg-color $text-color
# inactive_workspace $inactive-bg-color $inactive-bg-color $inactive-text-color
# urgent_workspace $urgent-bg-color $urgent-bg-color $urgent-text-color
# }
# }
bar {
status_command i3blocks -c ~/.config/i3/i3blocks.conf
i3bar_command i3bar
font pango:monospace 10
output DVI-D-0
colors {
background $bg-color
separator #757575
# border background text
focused_workspace $bg-color $bg-color $text-color
inactive_workspace $inactive-bg-color $inactive-bg-color $inactive-text-color
urgent_workspace $urgent-bg-color $urgent-bg-color $urgent-text-color
}
}
# bar {
# status_command i3blocks -c ~/.config/i3/i3blocks.conf
# i3bar_command i3bar
# font pango:monospace 10
# output DVI-D-0
# colors {
# background $bg-color
# separator #757575
# # border background text
# focused_workspace $bg-color $bg-color $text-color
# inactive_workspace $inactive-bg-color $inactive-bg-color $inactive-text-color
# urgent_workspace $urgent-bg-color $urgent-bg-color $urgent-text-color
# }
# }
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id "pulseaudio-ctl up && pkill -RTMIN+2 i3blocks"
@ -365,6 +364,7 @@ exec --no-startup-id mpd
# Stuff
exec aw-qt
exec "bash /home/pavel/bin/bukuserver.sh"
exec dunst
exec kde-connect-indicator
exec copyq

View file

@ -152,8 +152,14 @@ focus-exclude = [ "class_g = 'Cairo-clock'" ];
# example:
# opacity-rule = [ "80:class_g = 'URxvt'" ];
#
# opacity-rule = []
opacity-rule = [
"0:_NET_WM_STATE@[0]:32a = '_NET_WM_STATE_HIDDEN'",
"0:_NET_WM_STATE@[1]:32a = '_NET_WM_STATE_HIDDEN'",
"0:_NET_WM_STATE@[2]:32a = '_NET_WM_STATE_HIDDEN'",
"0:_NET_WM_STATE@[3]:32a = '_NET_WM_STATE_HIDDEN'",
"0:_NET_WM_STATE@[4]:32a = '_NET_WM_STATE_HIDDEN'"
];
#################################
# Background-Blurring #

287
config/polybar/config Normal file
View file

@ -0,0 +1,287 @@
[colors]
; Palenight colorscheme https://github.com/JonathanSpeek/palenight-iterm2
black = #292d3e
red = #f07178
green = #c3e88d
yellow = #ffcb6b
blue = #82aaff
magenta = #c792ea
cyan = #89ddff
white = #d0d0d0
black-lighter = #434758
red-lighter = #ff8b92
green-lighter = #ddffa7
yellow-lighter = #ffe585
blue-lighter = #9cc4ff
magenta-lighter = #9cc4ff
cyan-lighter = #9cc4ff
white-lighter = ffffff
background = ${colors.black}
; background = #ee292d3e
foreground = ${colors.white}
[bar/mybar]
monitor = ${env:MONITOR:}
width = 100%
height = ${env:HEIGHT:27}
offset-x = 0
offset-y = 0
radius = 0.0
fixed-center = false
bottom=true
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
padding-left = 0
padding-right = 0
module-margin-left = 1
module-margin-right = 1
font-0 = ${env:FONT0:pango:monospace:size=10;1}
font-1 = ${env:FONT1:NotoEmoji:scale=10:antialias=false;0}
font-2 = ${env:FONT2:fontawesome:pixelsize=10;1}
font-3 = ${env:FONT3:JetBrains Mono Nerd Font:monospace:size=10;1}
modules-left = i3
; modules-center = test
modules-right = ${env:RIGHT_BLOCKS}
tray-position = ${env:TRAY:right}
tray-padding = 0
tray-maxsize = 16
;tray-background = #0063ff
wm-restack = i3
; override-redirect = true
scroll-up = i3wm-wsnext
scroll-down = i3wm-wsprev
; cursor-click = pointer
; cursor-scroll = ns-resize
[module/test]
type = custom/script
exec = echo "%{u#0000ff}%{+u} hello %{u-}"
[module/ipstack]
type = custom/script
exec = /home/pavel/bin/polybar/ipstack.sh
interval = 1200
[module/ipstack-vpn]
type = custom/script
exec = /home/pavel/bin/polybar/ipstack-vpn.sh
interval = 1200
[module/aw-afk]
type = custom/script
exec = /home/pavel/bin/polybar/aw_afk.sh
interval = 60
[module/sun]
type = custom/script
exec = /home/pavel/bin/polybar/sun.sh
interval = 60
[module/SEP]
type = custom/text
content = "|"
content-foreground = ${colors.magenta}
content-padding = 0
content-margin = 0
[module/TSEP]
type = custom/script
exec = /home/pavel/bin/polybar/tray-sep.sh
format-foreground = ${colors.magenta}
interval = 0
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
pin-workspaces = true
label-mode-padding = 1
label-mode-foreground = #000
label-mode-background = ${colors.blue}
; focused = Active workspace on focused monitor
label-focused = %name%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.blue}
label-focused-padding = 1
; unfocused = Inactive workspace on any monitor
label-unfocused = %name%
label-unfocused-padding = 1
; visible = Active workspace on unfocused monitor
label-visible = %name%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}
; urgent = Workspace with urgency hint set
label-urgent = %name%
label-urgent-background = ${colors.red}
label-urgent-foreground = ${colors.black}
label-urgent-padding = 1
; Separator in between workspaces
; label-separator = |
[module/xkeyboard]
type = internal/xkeyboard
format = <label-layout>
format-underline = ${colors.magenta}
label-layout = %icon%
layout-icon-0 = ru;RU
layout-icon-1 = us;US
[module/mpd]
type = internal/mpd
format-playing = <toggle> <label-time> <label-song>
format-paused = <toggle> <label-time> <label-song>
format-stopped = 
label-song = [%album-artist%] %title%
label-time = %elapsed%/%total%
label-song-maxlen = 30
label-song-ellipsis = true
format-playing-underline = ${colors.yellow}
format-paused-underline = ${colors.yellow}
format-stopped-underline = ${colors.yellow}
label-separator = kek
separator-foreground = ${colors.red}
icon-pause = 
icon-play = 
icon-stop = 
icon-prev = 1
icon-next = 2
[module/pulseaudio]
type = internal/pulseaudio
use-ui-max = true
bar-volume-width = 7
bar-volume-foreground-0 = ${colors.white}
bar-volume-foreground-1 = ${colors.yellow}
bar-volume-foreground-2 = ${colors.yellor}
bar-volume-foreground-3 = ${colors.blue}
bar-volume-foreground-4 = ${colors.blue}
bar-volume-foreground-5 = ${colors.green}
bar-volume-foreground-6 = ${colors.green}
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.white-lighter}
format-volume = ♪ <bar-volume> <label-volume>
label-volume = %percentage%%
format-mute = ♪ <label-muted>
label-muted = MUTE
format-volume-underline = ${colors.white}
format-muted-underline = ${colors.black-lighter}
[module/cpu]
type = internal/cpu
format =  <label>
label = %percentage%%
format-underline = ${colors.green-lighter}
[module/ram-memory]
type = internal/memory
interval = 10
ramp-used-0 = ▁
ramp-used-1 = ▂
ramp-used-2 = ▃
ramp-used-3 = ▄
ramp-used-4 = ▅
ramp-used-5 = ▆
ramp-used-6 = ▇
ramp-used-7 = █
format =  <label>
label=%gb_used:.1f%
format-underline = ${colors.blue}
[module/swap-memory]
type = internal/memory
interval = 10
label= %gb_swap_used:.1f%
format-underline = ${colors.yellow}
[module/network]
type = internal/network
interval = 1
interface = wlp35s0f3u2
; format-connected = [<ramp-signal>] <label-connected>
label-connected = ↓ %downspeed% ↑ %upspeed%
label-disconnected = X
format-connected-underline = ${colors.green}
format-disconnected-underline = ${colors.red}
ramp-signal-0 = 0
ramp-signal-1 = 1
ramp-signal-2 = 2
ramp-signal-3 = 3
ramp-signal-4 = 4
ramp-signal-5 = 5
[module/date]
type = internal/date
interval = 5
date =
date-alt = "%Y-%m-%d"
time = %H:%M
time-alt = %H:%M:%S
format-underline = ${colors.cyan}
label = "%date% %time%"
[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
;pseudo-transparency = false
[global/wm]
margin-top = 0
margin-bottom = 0
; vim:ft=dosini