diff --git a/.gitignore b/.gitignore index da7be94..1fba58b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,8 @@ qutebrowser/.config/qutebrowser/autoconfig.yml qutebrowser/.config/qutebrowser/qsettings/ qutebrowser/.config/qutebrowser/quickmarks qutebrowser/.local/ +theme/.config/gtk-3.0/bookmarks emacs/.emacs.d -!emacs/.emacs.d/init.el~ +!emacs/.emacs.d/init.el diff --git a/code/.config/Code - OSS/User/settings.json b/code/.config/Code - OSS/User/settings.json index afd160c..14df492 100644 --- a/code/.config/Code - OSS/User/settings.json +++ b/code/.config/Code - OSS/User/settings.json @@ -102,10 +102,9 @@ "menubar.selectionForeground": "#cc5757", "editor.findMatchBorder": "#cc5757", "selection.background": "#cc575740", - "statusBar.background": "#202020", - "statusBar.noFolderBackground": "#202020", - "statusBar.debuggingBackground": "#202020", - "statusBar.foreground": "#fff" + "statusBar.background": "#007acc", + "statusBar.noFolderBackground": "#007acc", + "statusBar.debuggingBackground": "#007acc" }, "editor.formatOnType": true, "editor.formatOnSave": true, diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index ed8299f..77bb5d8 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -12,59 +12,105 @@ ; list the repositories containing them (setq package-archives '(("elpa" . "http://tromey.com/elpa/") - ("gnu" . "http://elpa.gnu.org/packages/") + ("gnu" . "http://elpa.gnu.org/packages/") ("marmalade" . "http://marmalade-repo.org/packages/") ("org" . "http://orgmode.org/elpa/") - ("melpa" . "http://melpa.org/packages/") + ("melpa" . "http://melpa.org/packages/") ("melpa-stable" . "http://stable.melpa.org/packages/"))) (package-initialize) -; fetch the list of packages available +;; fetch the list of packages available (unless package-archive-contents (package-refresh-contents)) -; install the missing packages +;; install the missing packages (dolist (package package-list) (unless (package-installed-p package) (package-install package))) +; (use-package lsp-mode +; :ensure t +; :config + +; ;; make sure we have lsp-imenu everywhere we have LSP +; (require 'lsp-imenu) +; (add-hook 'lsp-after-open-hook 'lsp-enable-imenu) +; ;; get lsp-python-enable defined +; ;; NB: use either projectile-project-root or ffip-get-project-root-directory +; ;; or any other function that can be used to find the root directory of a project +; (lsp-define-stdio-client lsp-python "python" +; #'projectile-project-root +; '("pyls")) + +; ;; make sure this is activated when python-mode is activated +; ;; lsp-python-enable is created by macro above +; (add-hook 'python-mode-hook +; (lambda () +; (lsp-python-enable))) + +; ;; lsp extras +; (use-package lsp-ui +; :ensure t +; :config +; (setq lsp-ui-sideline-ignore-duplicate t) +; (add-hook 'lsp-mode-hook 'lsp-ui-mode)) + +; (use-package company-lsp +; :config +; (push 'company-lsp company-backends)) + +; ;; NB: only required if you prefer flake8 instead of the default +; ;; send pyls config via lsp-after-initialize-hook -- harmless for +; ;; other servers due to pyls key, but would prefer only sending this +; ;; when pyls gets initialised (:initialize function in +; ;; lsp-define-stdio-client is invoked too early (before server +; ;; start)) -- cpbotha +; (defun lsp-set-cfg () +; (let ((lsp-cfg `(:pyls (:configurationSources ("flake8"))))) +; ;; TODO: check lsp--cur-workspace here to decide per server / project +; (lsp--set-configuration lsp-cfg))) + +; (add-hook 'lsp-after-initialize-hook 'lsp-set-cfg)) + + (require 'evil) (evil-mode 1) ;; language server - (require 'lsp-mode) - (add-hook 'prog-mode-hook 'lsp) - (require 'yasnippet) - (require 'projectile) - (require 'lsp-ui) - (add-hook 'lsp-mode-hook #'lsp-ui-mode) - ;; Typescript - (defun setup-tide-mode () - (interactive) - (tide-setup) - (flycheck-mode +1) - (setq flycheck-check-syntax-automatically '(save mode-enabled)) - (eldoc-mode +1) - (tide-hl-identifier-mode +1) - ;; company is an optional dependency. You have to - ;; install it separately via package-install - ;; `M-x package-install [ret] company` - (company-mode +1)) + ; (require 'lsp-mode) + ; (add-hook 'prog-mode-hook 'lsp) + ; (require 'yasnippet) + ; (require 'projectile) + ; (require 'lsp-ui) + ; (add-hook 'lsp-mode-hook #'lsp-ui-mode) + ; ;; Typescript + ; (defun setup-tide-mode () + ; (interactive) + ; (tide-setup) + ; (flycheck-mode +1) + ; (setq flycheck-check-syntax-automatically '(save mode-enabled)) + ; (eldoc-mode +1) + ; (tide-hl-identifier-mode +1) + ; ;; company is an optional dependency. You have to + ; ;; install it separately via package-install + ; ;; `M-x package-install [ret] company` + ; (company-mode +1)) - ;; aligns annotation to the right hand side - (setq company-tooltip-align-annotations t) + ; ;; aligns annotation to the right hand side + ; (setq company-tooltip-align-annotations t) - ;; formats the buffer before saving - (add-hook 'before-save-hook 'tide-format-before-save) + ; ;; formats the buffer before saving + ; (add-hook 'before-save-hook 'tide-format-before-save) - (add-hook 'typescript-mode-hook #'setup-tide-mode) - ;; Python + ; (add-hook 'typescript-mode-hook #'setup-tide-mode) + ; ;; Python +; (setq lsp-response-timeout 60) ;; Completion - (add-hook 'after-init-hook 'global-company-mode) - (require 'company-lsp) - (push 'company-lsp company-backends) + ; (add-hook 'after-init-hook 'global-company-mode) + ; (require 'company-lsp) + ; (push 'company-lsp company-backends) ;; Line numbers (add-hook 'prog-mode-hook #'display-line-numbers-mode) @@ -83,42 +129,67 @@ ;; Keybinds (global-set-key (kbd "C-;") 'comment-line) (global-set-key (kbd "C-,") (lambda() (interactive) - (find-file "~/.emacs.d/init.el"))) + (find-file "~/.emacs.d/init.el"))) -(set-face-attribute 'default nil :height 200) +;; (set-face-attribute 'default nil :height 140) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. - '(ansi-color-faces-vector - [default default default italic underline success warning error]) + ;; '(ansi-color-faces-vector + ;; [default default default italic underline success warning error]) '(custom-enabled-themes (quote (wombat))) '(fringe-mode 0 nil (fringe)) '(global-whitespace-mode t) '(global-whitespace-newline-mode t) - '(indent-tabs-mode nil) + ;; '(indent-tabs-mode nil) '(inhibit-startup-screen t) - '(menu-bar-mode nil) '(package-selected-packages (quote (lsp-typescript lsp-python projectile typescript-mode yasnippet lsp-ui lsp-mode evil))) '(scroll-bar-mode nil) - '(standard-indent 4) - '(tab-stop-list (quote (4 8 12))) - '(tab-width 4) + ;; '(standard-indent 4) + ;; '(tab-stop-list (quote (4 8 12))) + ;; '(tab-width 4) + '(menu-bar-mode nil) '(tool-bar-mode nil) '(tooltip-mode nil)) + (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. - '(default ((t (:inherit nil :stipple nil :background "#202020" :foreground "#f6f3e8" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :foundry "pyrs" :family "Fira Code")))) + '(default + ((t( + :inherit nil + ;; :stipple nil + :background "#202020" + :foreground "#f6f3e8" + ;; :inverse-video nil + ;; :box nil + ;; :strike-through nil + ;; :overline nil + ;; :underline nil + ;; :slant normal + ;; :weight normal + ;; :width normal + ;; :foundry "pyrs" + :family "Fira Code") + ))) '(line-number ((t (:inherit (shadow default) :foreground "#cc5757")))) '(line-number-current-line ((t (:inherit line-number :foreground "white")))) '(whitespace-big-indent ((t (:foreground "dark gray")))) '(whitespace-newline ((t (:inherit whitespace-space :weight normal)))) '(whitespace-space ((t (:foreground "#303030")))) '(whitespace-tab ((t (:foreground "dim gray"))))) + +;; Font-ligatures +;;; Fira code +;; This works when using emacs --daemon + emacsclient +(add-hook 'after-make-frame-functions (lambda (frame) (set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol"))) +;; This works when using emacs without server/client +(set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol") +;; I haven't found one statement that makes both of the above situations work, so I use both for now diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 8d60f8a..7abae81 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -26,10 +26,13 @@ Plug 'junegunn/vim-easy-align' " Language server support - " Plug 'autozimu/LanguageClient-neovim', { - " \ 'branch': 'next', - " \ 'do': 'bash install.sh', - " \} + " Plug 'sheerun/vim-polyglot' + Plug 'dense-analysis/ale' + " Plug 'davidhalter/jedi-vim' + Plug 'autozimu/LanguageClient-neovim', { + \ 'branch': 'next', + \ 'do': 'bash install.sh', + \} " Fuzzy find Plug 'junegunn/fzf' @@ -52,10 +55,6 @@ " Color scheme Plug 'dikiaap/minimalist' - " Language support - " Plug 'sheerun/vim-polyglot' - Plug 'dense-analysis/ale' - " Plug 'davidhalter/jedi-vim' " Simplify movement "Plug 'easymotion/vim-easymotion' @@ -84,7 +83,7 @@ Plug 'vim-latex/vim-latex', { 'for': 'tex' } Plug 'vim-scripts/AnsiEsc.vim' " Plug 'powerman/vim-plugin-AnsiEsc' - Plug 'mboughaba/i3config.vim' + Plug 'mboughaba/i3config.vim' call plug#end() "}}} @@ -130,7 +129,7 @@ call plug#end() " set background=dark "background color is transparent - highlight Normal guibg=None + highlight Normal guibg=None highlight EndOfBuffer guibg=None guifg=#303030 highlight SpecialKey guibg=None guifg=#cc5757 @@ -168,42 +167,41 @@ call plug#end() " Interact with language server " map : - nnoremap gd :ALEGoToDefinition + " nnoremap gd :ALEGoToDefinition " nnoremap gh :call LanguageClient#textDocument_hover() " nnoremap gd :call LanguageClient#textDocument_definition() " nnoremap gr :call LanguageClient#textDocument_references() " nnoremap gs :call LanguageClient#textDocument_documentSymbol() " nnoremap gR :call LanguageClient#textDocument_rename() + nnoremap :call LanguageClient_contextMenu() + " Or map each action separately + nnoremap gh :call LanguageClient#textDocument_hover() + nnoremap gd :call LanguageClient#textDocument_definition() + nnoremap :call LanguageClient#textDocument_rename() + inoremap :call LanguageClient#complete() + "}}} " Lanugage Server{{{ " " Set this variable to 1 to fix files when you save them. - let g:ale_fix_on_save = 1 + " let g:ale_fix_on_save = 1 set hidden - let g:ale_linters = { - \ 'python': ['pyls'], - \ 'rust': ['~/.cargo/bin/rustup', 'run', 'stable', 'rls'], - \ 'tex': ['/usr/bin/texlab'], - \} - " \ 'c': ['cquery', '--log-file=/tmp/cq.log'], - " \ 'cpp': ['cquery', '--log-file=/tmp/cq.log'], - " \ 'javascript': ['/usr/local/bin/javascript-typescript-stdio'], - - let g:ale_fixers = { - \ '*': ['remove_trailing_lines', 'trim_whitespace'], - \ 'javascript': ['prettier', 'eslint'], - \ 'python': ['black'], - \} + let g:LanguageClient_serverCommands = { + \ 'rust': ['rustup', 'run', 'stable', 'rls'], + \ 'python': ['/usr/bin/pyls'], + \ 'tex': ['texlab'], + \ 'c': ['cquery', '--log-file=/tmp/cq.log'], + \ 'cpp': ['cquery', '--log-file=/tmp/cq.log'], + \ } let g:deoplete#enable_at_startup = 1 - " Configure deoplete to use language server - call deoplete#custom#option('sources', { - \ '_': ['ale'], - \}) - " let g:ale_completion_enabled = 1 - " set omnifunc=ale#completion#OmniFunc + call deoplete#custom#source('LanguageClient', + \ 'min_pattern_length', + \ 2) + " Configure deoplete to use language server + "python env{{{ " MUST NOT BE INDENTED! py3 << EOF diff --git a/ranger/.config/ranger/rc.conf b/ranger/.config/ranger/rc.conf index bdbc5d2..71dd578 100644 --- a/ranger/.config/ranger/rc.conf +++ b/ranger/.config/ranger/rc.conf @@ -324,7 +324,7 @@ alias travel scout -aefklst # =================================================================== # Basic -map Q quitall +map Q quitall! map q quit copymap q ZZ ZQ diff --git a/scripts/.local/bin/color-picker b/scripts/.local/bin/color-picker new file mode 100755 index 0000000..e8248b8 --- /dev/null +++ b/scripts/.local/bin/color-picker @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +if pgrep redshift;then + echo r true + pkill redshift + red=true +else + echo r false + red=false +fi + +grim -g "$(slurp -p)" - | + convert - -format '%[pixel:p{0,0}]' txt:- | + grep -oE '#[0-9a-f]{6}' | + wl-copy + +notify-send "$(wl-paste)" "Copied to clipboard" + +$red && redshift &> /dev/null & diff --git a/scripts/.local/bin/forecast b/scripts/.local/bin/forecast index ef8e104..0c88352 100755 --- a/scripts/.local/bin/forecast +++ b/scripts/.local/bin/forecast @@ -14,19 +14,21 @@ owm(){ format_weather(){ case $WEATHER in "Clear") - WEATHER=" " + [ $(date +%H) -gt 06 -a $(date +%H) -lt 18 ] && + WEATHER="" || + WEATHER="" ;; "Clouds") - WEATHER=" " + WEATHER="" ;; "Rain"|"Drizzle") - WEATHER=" " + WEATHER="" ;; "Mist") - WEATHER=" " + WEATHER="" ;; "Snow") - WEATHER=" " + WEATHER="" ;; "Thunderstorm") WEATHER="" diff --git a/sway/.config/mako/config b/sway/.config/mako/config index f09ed57..edd780d 100644 --- a/sway/.config/mako/config +++ b/sway/.config/mako/config @@ -10,5 +10,6 @@ actions=1 layer=overlay [app-name=pavolume] +default-timeout=5000 group-by=app-name format=%s\n%b diff --git a/sway/.config/sway/config b/sway/.config/sway/config index cfc183c..e5feb19 100644 --- a/sway/.config/sway/config +++ b/sway/.config/sway/config @@ -91,6 +91,8 @@ # Exit sway (logs you out of your Wayland session) bindsym $mod+Shift+e exec swaynag -t warning -m 'Do you really want to exit sway?' -b 'Yes, exit sway' 'swaymsg exit' + bindsym Control+Shift+BackSpace exit + # }}} # Moving around: {{{ @@ -145,7 +147,9 @@ bindsym $mod+Shift+0 move container to workspace 10 # Assign programs to their workspace - assign [app_id=org.qutebrowser.qutebrowser] workspace 2 + assign [app_id=.*qutebrowser.*] workspace 2 + assign [app_id=.*keepass.*] workspace 8 + assign [class=Steam] workspace 9 assign [app_id=telegramdesktop] workspace 10 assign [class=discord] workspace 10 @@ -209,10 +213,11 @@ bindsym --locked XF86AudioLowerVolume exec pavolume voldown 5 bindsym --locked XF86AudioMute exec pavolume mutetoggle - # Media player controls - bindsym --locked XF86AudioPlay exec mpc toggle - bindsym --locked XF86AudioNext exec mpc next - bindsym --locked XF86AudioPrev exec mpc prev + # Media player controls + # playerctl for notifications + bindsym --locked XF86AudioPlay exec playerctl -p mpd play-pause + bindsym --locked XF86AudioNext exec playerctl -p mpd next + bindsym --locked XF86AudioPrev exec playerctl -p mpd previous bindsym $mod+Shift+x exec musmenu delete bindsym $mod+Shift+s exec musmenu search @@ -268,7 +273,7 @@ # Block device Mounter to /run/media/ exec udiskie # gesture daemon - exec fusuma + exec pkill fusuma && fusuma # Blue light filter exec redshift # kde connect @@ -277,7 +282,7 @@ # Telegram exec telegram-desktop # Music Player Daemon - exec mpd --no-daemon + exec pkill mpd && mpd --no-daemon exec mpDris2 # lock screen after a period of inactivity execp for fullscreen for_window [class=.*] inhibit_idle fullscreen diff --git a/sway/.config/waybar/config b/sway/.config/waybar/config index 056b688..9d044ce 100644 --- a/sway/.config/waybar/config +++ b/sway/.config/waybar/config @@ -1,36 +1,46 @@ { - "layer": "bottom", // Waybar at top layer - //"margin":"5 5 0 5", - //"margin-bottom":10, - //"position": "bottom", // Waybar position (top|bottom|left|right) - //"height": 26, // Waybar height (to be removed for auto height) - // "width": 1280, // Waybar width - // Choose the order of the modules - "modules-left": ["sway/workspaces","sway/window"], - "modules-center": ["clock","custom/weather"], - "modules-right": ["custom/recording","mpd", "pulseaudio", "network", "battery","custom/mail", "custom/updates", "tray"], - "sway/workspaces": { - "enable-bar-scroll":true, - "format": "{icon}", - "format-icons": { - "1": "", - "2": "", - "3": "", - "10": "", - "urgent": "", - "focused": "", - "default": "" - } - }, - "sway/window":{ - "max-length":40 - }, + "modules-left": [ + "sway/workspaces", + "sway/window" + ], + "modules-center": [ + "clock", + "custom/weather" + ], + "modules-right": [ + "mpd", + "custom/recording", + "custom/mail", + "custom/updates", + "pulseaudio", + "network", + "battery", + "tray" + ], + "sway/workspaces": { + "enable-bar-scroll":true, + "format": "{icon}", + "format-icons": { + "1": "", + "2": "", + "3": "", + "8": "", + "9": "", + "10": "", + "urgent": "", + "focused": "", + "default": "" + } + }, + "sway/window":{ + "max-length":40 + }, "mpd": { "tooltip":false, "format": " {stateIcon} {title} - {artist} 🎜 ", "format-disconnected": " Disconnected 🎜 ", "format-stopped": " Stopped 🎜 ", - "timeout":5, + "timeout":60, "unknown-tag": " N/A ", "tooltip":false, "interval": 2, @@ -40,25 +50,14 @@ "playing": "" } }, - "idle_inhibitor": { - "format": "{icon}", - "format-icons": { - "activated": "", - "deactivated": "" - } - }, "tray": { "tooltip":false, "spacing": 10 }, "clock": { - "tooltip":false, - "tooltip-format": "{:%Y-%m-%d | %H:%M}", - "format-alt": "{:%Y-%m-%d}" - }, - "backlight": { - "format": "{percent}% {icon}", - "format-icons": ["", ""] + "interval":60, + "format":"{:%H:%M %a}", + "tooltip":false }, "battery": { "tooltip":false, @@ -78,7 +77,6 @@ }, "network": { "tooltip":false, - // "interface": "wlp2*", // (Optional) To force the use of this interface "on-click": "termite -e nmtui", "format-wifi": "", "format-ethernet": "", @@ -114,7 +112,8 @@ "custom/mail": { "tooltip":false, "format":"{} ", - "exec": "sleep 10s; checkmail", + "exec-if":"sleep 30s", + "exec": "checkmail", "on-click": "kitty neomutt; pkill -SIGRTMIN+4 waybar", "signal": 4, "interval": 1800 @@ -123,8 +122,9 @@ "tooltip":false, "format": "{} ", "interval": 3600, - "exec": "sleep 30s; yay -Syuw --noconfirm> /dev/null; yay -Qqu | wc -l | sed 's/^0$//'", - "on-click": "[ ping -qc1 archlinux.org ] && kitty yay -Syu || kitty yay -Su; pkill -SIGRTMIN+8 waybar", + "exec-if":"sleep 60s", + "exec": "yay -Syuw --noconfirm> /dev/null; yay -Qqu | wc -l | sed 's/^0$//'", + "on-click": "kitty sh -c 'ping -qc1 archlinux.org >/dev/null && yay -Syu || yay -Su && pkill -SIGRTMIN+8 waybar'", "signal": 8 }, "custom/recording": { diff --git a/sway/.config/waybar/style.css b/sway/.config/waybar/style.css index b9c55f6..b64db84 100644 --- a/sway/.config/waybar/style.css +++ b/sway/.config/waybar/style.css @@ -1,13 +1,10 @@ * { font: 14px Inter; font-weight:bold; - /* border: none; */ border-radius:0; margin:0; padding: 0; transition-duration:0; - /* font-size: ; */ - /* min-height: 0; */ } window#waybar { @@ -20,21 +17,13 @@ window#waybar.empty { border:none; } - #workspaces button { background-color: transparent; border: 3px solid transparent; color: #aaaaaa; } -/* -#workspaces button:hover { - background: rgba(0, 0, 0, 0.2); - border-top: 1px solid white; -} -*/ + #workspaces button.focused { - /* padding: 0 2px; */ - /* background-color: rgba(255,255,255,.01); */ border-top: 3px solid #cc5757; border-bottom: 3px solid transparent; color: #ffffff; @@ -48,7 +37,6 @@ window#waybar.empty { #window{ color:#aaa; margin:0 4px; - /* width:15px; */ } #mpd, @@ -62,7 +50,18 @@ window#waybar.empty { #custom-updates, #custom-weather { - margin: 0 7px; + padding: 0 5px; + margin: 0 2px; + color: #ffffff; + opacity:.7; +} + +#custom-weather, +#clock +{ + font-size:15px; + padding: 0 5px; + margin: 0 2px; color: #ffffff; opacity:.7; } @@ -74,129 +73,17 @@ window#waybar.empty { font-weight:normal; } -#tray -{ - margin-right:7px; -} -/* -label:focus { - border-top: 2px solid #000000; - background-color: #000000; +#custom-recording { + color: #ee4040; } -@keyframes blink { - to { - border-top: 2px solid #ffffff; - color: #000000; - } -} - -#battery { - border-top: 2px solid #ffffff; -} - -#battery.charging { - border-top: 2px solid #26A65B; - color: #ffffff; -} - -#battery.critical:not(.charging) { - background-color: #f53c3c; - color: #ffffff; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; -} -#network { - border-top: 2px solid #66cc99; -} - -#network.disconnected { - border-top: 2px solid #f53c3c; -} - -#pulseaudio { - border-top: 2px solid #f1c40f; -} - -#pulseaudio.muted { - border-top: 2px solid #90b1b1; -} - -#custom-weather { - border-top: 2px solid #2980b9; -} - -#custom-mail { - border-top: 2px solid #67334d; -} - -#custom-updates { - border-top: 2px solid #ee9957; -} - - -#tray { - border-top: 2px solid #2980b9; -} - -#mpd { - border-top: 2px solid #66cc99; -} - -#mpd.disconnected { - border-top: 2px solid #f53c3c; -} - -#mpd.stopped { - border-top: 2px solid #90b1b1; -} - -*/ - #mpd.paused { font-size: 0; border: none; } -#custom-recording { - /* border-top: 2px solid #ee9957; */ - color: #ee4040; +#tray +{ + margin-right:7px; } -/* - * UNUSED - * - -#idle_inhibitor { - background-color: #2d3436; -} - -#idle_inhibitor.activated { - background-color: #ecf0f1; - color: #2d3436; -} - -#temperature { - background-color: #f0932b; -} - -#temperature.critical { - background-color: #eb4d4b; -} - -#cpu { - background-color: #2ecc71; - color: #000000; -} - -#memory { - background-color: #9b59b6; -} - -#backlight { - background-color: #90b1b1; -} -*/ diff --git a/theme/.gtkrc-2.0 b/theme/.gtkrc-2.0 index eabf304..77d002a 100644 --- a/theme/.gtkrc-2.0 +++ b/theme/.gtkrc-2.0 @@ -2,7 +2,7 @@ # Any customization should be done in ~/.gtkrc-2.0.mine instead. include "/home/lelgenio/.gtkrc-2.0.mine" -gtk-theme-name="materia-custom-accent" +gtk-theme-name="materia-custom-accent-dark" gtk-icon-theme-name="Papirus-Dark" gtk-font-name="Inter 11" gtk-cursor-theme-name="capitaine-cursors" diff --git a/zsh/.p10k.zsh b/zsh/.p10k.zsh index 5981f78..86eb0f5 100644 --- a/zsh/.p10k.zsh +++ b/zsh/.p10k.zsh @@ -1,6 +1,6 @@ -# Generated by Powerlevel10k configuration wizard on 2019-12-09 at 10:11 -03. +# Generated by Powerlevel10k configuration wizard on 2019-12-10 at 14:15 -03. # Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 51917. -# Wizard options: awesome-fontconfig + powerline, small icons, lean, time, 2 lines, +# Wizard options: awesome-fontconfig + powerline, small icons, lean, 2 lines, # disconnected, no frame, sparse, few icons, concise, transient_prompt, # instant_prompt=verbose. # Type `p10k configure` to generate another config. @@ -83,7 +83,7 @@ # vpn_ip # virtual private network indicator # ram # free RAM # load # CPU load - time # current time + # time # current time # =========================[ Line #2 ]========================= newline # public_ip # public IP address @@ -161,7 +161,7 @@ typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=true # Add an empty line before each prompt. - typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true + typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false # Connect left prompt lines with these symbols. typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX= @@ -212,15 +212,22 @@ ################################[ prompt_char: prompt symbol ]################################ # Green prompt symbol if the last command succeeded. - typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 + # typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 + typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=9 # Red prompt symbol if the last command failed. typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196 # Default prompt symbol. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' + if [ "$USER" = "root" ] + then + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='#' + else + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='$' + fi + # typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯' # Prompt symbol in command vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='N' # Prompt symbol in visual vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='Ⅴ' + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' # Prompt symbol in overwrite vi mode. typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true @@ -228,17 +235,17 @@ ##################################[ dir: current directory ]################################## # Default current directory color. - typeset -g POWERLEVEL9K_DIR_FOREGROUND=31 + typeset -g POWERLEVEL9K_DIR_FOREGROUND=009 # If directory is too long, shorten some of its segments to the shortest possible unique # prefix. The shortened directory can be tab-completed to the original. typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique # Replace removed segment suffixes with this symbol. typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= # Color of the shortened directory segments. - typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=103 + typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=009 # Color of the anchor directory segments. Anchor segments are never shortened. The first # segment is always an anchor. - typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=39 + typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=009 # Display anchor directory segments in bold. typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true # Don't shorten directories that contain any of these files. They are anchors. @@ -485,7 +492,8 @@ # Show this many fractional digits. Zero means round to seconds. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 # Execution time color. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=101 + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=101 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=9 # Duration format: 1d 2h 3m 4s. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' # Custom icon. @@ -558,7 +566,8 @@ # Context color in SSH without privileges. typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=180 # Default context color (no privileges, no SSH). - typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=180 + # typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=180 + typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=009 # Context format when running with privileges: bold user@hostname. typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m' diff --git a/zsh/.zshrc b/zsh/.zshrc index 0963da7..e613b49 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -1,10 +1,3 @@ -# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. -# Initialization code that may require console input (password prompts, [y/n] -# confirmations, etc.) must go above this block, everything else may go below. -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" -fi - # LEL # _ @@ -48,24 +41,21 @@ export PAGER=less export QT_SCALE_FACTOR=1 export QPA_PLATFORM=wayland export QT_QPA_PLATFORM=wayland - export _JAVA_AWT_WM_NONREPARENTING=1 - export GTK_CSD=0 - export LD_PRELOAD=/usr/lib/libgtk3-nocsd.so.0 - export XCURSOR_THEME=capitaine-cursors exec sway } ei3() { clear - export _JAVA_AWT_WM_NONREPARENTING=1 - export GTK_CSD=0 - export LD_PRELOAD=/usr/lib/libgtk3-nocsd.so.0 - export XCURSOR_THEME=capitaine-cursors exec startx i3 } if [[ $XDG_VTNR -eq 1 ]] #faster like this then if systemctl -q is-active graphical.target && [[ ! $DISPLAY ]] then + export _JAVA_AWT_WM_NONREPARENTING=1 + export GTK_CSD=0 + export LD_PRELOAD=/usr/lib/libgtk3-nocsd.so.0 + export XCURSOR_THEME=capitaine-cursors + export GTK_THEME=materia-custom-accent:dark esway > .swaylog # ei3 > .i3log fi @@ -87,6 +77,42 @@ if [ -z "$TMUX" ] && [ "$TERM" != "xterm-kitty" ]; then fi fi +# }}} +# Instant Prompt{{{ + +# Use beam shape cursor on startup. +echo -ne '\e[5 q' + +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +fi + +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +# }}} +# Cursor shape{{{ +# Change cursor shape for different vi modes. +function zle-keymap-select { + if [[ ${KEYMAP} == vicmd ]] || + [[ $1 = 'block' ]]; then + echo -ne '\e[1 q' + + elif [[ ${KEYMAP} == main ]] || + [[ ${KEYMAP} == viins ]] || + [[ ${KEYMAP} = '' ]] || + [[ $1 = 'beam' ]]; then + echo -ne '\e[5 q' + fi +} +zle -N zle-keymap-select + +zle-line-init() { + zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) + echo -ne "\e[5 q" +} +zle -N zle-line-init + +# Use beam shape cursor for each new prompt. +preexec() { echo -ne '\e[5 q' ;} # }}} # Plugins {{{ # @@ -117,7 +143,6 @@ fi zplug "zsh-users/zsh-autosuggestions" # Promp config - # bindkey -e # SPACESHIP_PROMPT_ADD_NEWLINE=false # SPACESHIP_CHAR_SYMBOL='$ ' # SPACESHIP_CHAR_SYMBOL_ROOT='# ' @@ -144,10 +169,10 @@ fi abbrev-alias suspend="systemctl suspend" abbrev-alias tlsave='telegram-cli -We "send_document @lelgenio "' - alias emacs='env TERM=xterm-256color /usr/bin/emacs -nw' - abbrev-alias em='emacs -nw' - + # alias emacs='env TERM=xterm-256color /usr/bin/emacs -nw' + # abbrev-alias em='emacs -nw' abbrev-alias -i + alias ls='ls --color=auto --human-readable --group-directories-first --classify' alias ll='ls --color=auto --human-readable --group-directories-first --classify -l' alias lla='ls --color=auto --human-readable --group-directories-first --classify -la' @@ -162,75 +187,56 @@ fi command man "$@" } + rcd () { + tmp="$(mktemp)" + ranger --choosedir="$tmp" "$@" + cd "$(cat $tmp)" + rm -f "$tmp" + } + bindkey -s '^o' 'rcd\n' + # }}} # Keys. {{{ # + # Vim keys + bindkey -v + autoload -z edit-command-line zle -N edit-command-line bindkey "^X" edit-command-line - # typeset -g -A key + typeset -g -A key + key[Home]="${terminfo[khome]}" + key[End]="${terminfo[kend]}" + key[Delete]="${terminfo[kdch1]}" + key[Up]="${terminfo[kcuu1]}" + key[Down]="${terminfo[kcud1]}" - # key[Home]="${terminfo[khome]}" - # key[End]="${terminfo[kend]}" # key[Insert]="${terminfo[kich1]}" # key[Backspace]="${terminfo[kbs]}" - # key[Delete]="${terminfo[kdch1]}" - # key[Up]="${terminfo[kcuu1]}" - # key[Down]="${terminfo[kcud1]}" # key[Left]="${terminfo[kcub1]}" # key[Right]="${terminfo[kcuf1]}" # key[PageUp]="${terminfo[kpp]}" # key[PageDown]="${terminfo[knp]}" # key[ShiftTab]="${terminfo[kcbt]}" + + bindkey -- "${key[Home]}" beginning-of-line + bindkey -- ${key[End]} end-of-line #End key + bindkey -- ${key[Delete]} delete-char #Del key + bindkey -- ${key[Up]} history-substring-search-up #Up Arrow + bindkey -- ${key[Down]} history-substring-search-down #Down Arrow - # ${key[Home]} - # ${key[End]} - # ${key[Delete]} - # ${key[Insert]} - # ${key[Backspace]} - # ${key[Up]} - # ${key[Down]} - # ${key[Left]} - # ${key[Right]} - # ${key[PageUp]} - # ${key[PageDown]} - # ${key[ShiftTab]} - - case $TERM in - rxvt*|xterm*) - bindkey "^[[H" beginning-of-line #Home key - bindkey "^[[F" end-of-line #End key - bindkey "^[[3~" delete-char #Del key - bindkey "^[[A" history-substring-search-up #Up Arrow - bindkey "^[[B" history-substring-search-down #Down Arrow - bindkey "^[Oc" forward-word # control + right arrow - bindkey "^[Od" backward-word # control + left arrow - bindkey "^H" backward-kill-word # control + backspace - bindkey "^[[3^" kill-word # control + delete - ;; - linux) - bindkey "^[[1~" beginning-of-line #Home key - bindkey "^[[4~" end-of-line #End key - bindkey "^[[3~" delete-char #Del key - bindkey "^[[A" history-beginning-search-backward - bindkey "^[[B" history-beginning-search-forward - ;; - screen|screen-*) - bindkey "^[[1~" beginning-of-line #Home key - bindkey "^[[4~" end-of-line #End key - bindkey "^[[3~" delete-char #Del key - bindkey "^[[A" history-beginning-search-backward #Up Arrow - bindkey "^[[B" history-beginning-search-forward #Down Arrow - bindkey "^[Oc" forward-word # control + right arrow - bindkey "^[OC" forward-word # control + right arrow - bindkey "^[Od" backward-word # control + left arrow - bindkey "^[OD" backward-word # control + left arrow - bindkey "^H" backward-kill-word # control + backspace - bindkey "^[[3^" kill-word # control + delete - ;; - esac - + if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then + autoload -Uz add-zle-hook-widget + function zle_application_mode_start { + echoti smkx + } + function zle_application_mode_stop { + echoti rmkx + } + add-zle-hook-widget -Uz zle-line-init zle_application_mode_start + add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop + fi # }}} # Completions {{{ @@ -256,8 +262,4 @@ fi setopt GLOBSTARSHORT #}}} - # vim:foldmethod=marker - -# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh