desktop: add C-g to polybar & Zen

This commit is contained in:
Pavel Korytov 2024-10-20 18:29:53 +03:00
parent dff499c668
commit 5aa83aefbd
3 changed files with 81 additions and 12 deletions

View file

@ -193,7 +193,7 @@ font-4 = JetBrains Mono Nerd Font:monospace:size=17;4
; Global bar config:3 ends here ; Global bar config:3 ends here
; [[file:../../Desktop.org::*Global bar config][Global bar config:4]] ; [[file:../../Desktop.org::*Global bar config][Global bar config:4]]
modules-left = i3 modules-left = i3 c-g glyph-left-light-background--blue
; modules-center = test ; modules-center = test
modules-right = ${env:RIGHT_BLOCKS} modules-right = ${env:RIGHT_BLOCKS}
@ -516,6 +516,23 @@ format-underline = ${colors.light-green}
format-foreground = ${colors.foreground} format-foreground = ${colors.foreground}
; pomm:2 ends here ; pomm:2 ends here
; [[file:../../Desktop.org::*C-g][C-g:2]]
[module/c-g]
type = custom/text
content = " C-g"
click-left = bash ~/bin/polybar/c-g.sh
content-background = ${colors.blue}
; C-g:2 ends here
; [[file:../../Desktop.org::*C-g][C-g:3]]
[module/glyph-left-light-background--blue]
type = custom/text
content-background = ${colors.backround}
content-foreground = ${colors.blue}
content = ${glyph.gleft}
content-font = 5
; C-g:3 ends here
; [[file:../../Desktop.org::*SEP][SEP:1]] ; [[file:../../Desktop.org::*SEP][SEP:1]]
[module/SEP] [module/SEP]
type = custom/text type = custom/text

View file

@ -328,6 +328,7 @@ DIR is either 'left or 'right."
:straight (:host github :repo "SqrtMinusOne/password-store-completion") :straight (:host github :repo "SqrtMinusOne/password-store-completion")
:after (exwm) :after (exwm)
:config :config
(add-to-list 'savehist-additional-variables 'password-store-completion)
(require 'password-store-embark) (require 'password-store-embark)
(password-store-embark-mode)) (password-store-embark-mode))
@ -352,13 +353,13 @@ DIR is either 'left or 'right."
" "
^Apps^ ^Apps^
_t_: Terminal (Alacritty) _t_: Terminal (Alacritty)
_b_: Browser (qutebrowser) _b_: Browser (Zen)
_s_: Rocket.Chat _s_: Rocket.Chat
_e_: Telegram _e_: Telegram
_d_: Discord _d_: Discord
" "
("t" (lambda () (interactive) (my/run-in-background "alacritty"))) ("t" (lambda () (interactive) (my/run-in-background "alacritty")))
("b" (lambda () (interactive) (my/run-in-background "qutebrowser"))) ("b" (lambda () (interactive) (my/run-in-background "flatpak run io.github.zen_browser.zen")))
("s" (lambda () (interactive) (my/run-in-background "flatpak run chat.rocket.RocketChat"))) ("s" (lambda () (interactive) (my/run-in-background "flatpak run chat.rocket.RocketChat")))
("e" (lambda () (interactive) (my/run-in-background "telegram-desktop"))) ("e" (lambda () (interactive) (my/run-in-background "telegram-desktop")))
("d" (lambda () (interactive) (my/run-in-background "flatpak run com.discordapp.Discord")))) ("d" (lambda () (interactive) (my/run-in-background "flatpak run com.discordapp.Discord"))))
@ -616,7 +617,8 @@ _d_: Discord
"<mode-line> s-<mouse-5>" #'perspective-exwm-cycle-all-buffers-forward "<mode-line> s-<mouse-5>" #'perspective-exwm-cycle-all-buffers-forward
"M-x" #'execute-extended-command "M-x" #'execute-extended-command
"M-SPC" (general-key "SPC")) "M-SPC" (general-key "SPC"))
(setq exwm-input-simulation-keys `((,(kbd "M-w") . ,(kbd "C-w")) (setopt exwm-input-simulation-keys `(
;; (,(kbd "M-w") . ,(kbd "C-w"))
(,(kbd "M-c") . ,(kbd "C-c")))) (,(kbd "M-c") . ,(kbd "C-c"))))
(setq exwm-input-global-keys (setq exwm-input-global-keys
`( `(

View file

@ -169,10 +169,9 @@ Setting the default MIME types
#+begin_src conf-unix :tangle ~/.config/mimeapps.list #+begin_src conf-unix :tangle ~/.config/mimeapps.list
[Default Applications] [Default Applications]
text/html=qutebrowser.desktop text/html=qutebrowser.desktop
x-scheme-handler/http=qutebrowser.desktop x-scheme-handler/http=io.github.zen_browser.zen.desktop
x-scheme-handler/https=qutebrowser.desktop x-scheme-handler/https=io.github.zen_browser.zen.desktop
x-scheme-handler/about=qutebrowser.desktop x-scheme-handler/about=io.github.zen_browser.zen.desktop
x-scheme-handler/unknown=qutebrowser.desktop
x-scheme-handler/tg=userapp-Telegram Desktop-7PVWF1.desktop x-scheme-handler/tg=userapp-Telegram Desktop-7PVWF1.desktop
image/png=com.interversehq.qView.desktop image/png=com.interversehq.qView.desktop
image/jpg=com.interversehq.qView.desktop image/jpg=com.interversehq.qView.desktop
@ -767,6 +766,7 @@ Also, by default it tries to launch stuff with =gtk-launch=, which is in the =gt
:straight (:host github :repo "SqrtMinusOne/password-store-completion") :straight (:host github :repo "SqrtMinusOne/password-store-completion")
:after (exwm) :after (exwm)
:config :config
(add-to-list 'savehist-additional-variables 'password-store-completion)
(require 'password-store-embark) (require 'password-store-embark)
(password-store-embark-mode)) (password-store-embark-mode))
#+end_src #+end_src
@ -807,7 +807,8 @@ Also other local keybindings, that are also available only in =line-mode=:
Simulation keys. Simulation keys.
#+begin_src emacs-lisp :tangle no :noweb-ref exwm-keybindings #+begin_src emacs-lisp :tangle no :noweb-ref exwm-keybindings
(setq exwm-input-simulation-keys `((,(kbd "M-w") . ,(kbd "C-w")) (setopt exwm-input-simulation-keys `(
;; (,(kbd "M-w") . ,(kbd "C-w"))
(,(kbd "M-c") . ,(kbd "C-c")))) (,(kbd "M-c") . ,(kbd "C-c"))))
#+end_src #+end_src
@ -932,13 +933,13 @@ A +transient+ hydra for shortcuts for the most frequent apps.
" "
^Apps^ ^Apps^
_t_: Terminal (Alacritty) _t_: Terminal (Alacritty)
_b_: Browser (qutebrowser) _b_: Browser (Zen)
_s_: Rocket.Chat _s_: Rocket.Chat
_e_: Telegram _e_: Telegram
_d_: Discord _d_: Discord
" "
("t" (lambda () (interactive) (my/run-in-background "alacritty"))) ("t" (lambda () (interactive) (my/run-in-background "alacritty")))
("b" (lambda () (interactive) (my/run-in-background "qutebrowser"))) ("b" (lambda () (interactive) (my/run-in-background "flatpak run io.github.zen_browser.zen")))
("s" (lambda () (interactive) (my/run-in-background "flatpak run chat.rocket.RocketChat"))) ("s" (lambda () (interactive) (my/run-in-background "flatpak run chat.rocket.RocketChat")))
("e" (lambda () (interactive) (my/run-in-background "telegram-desktop"))) ("e" (lambda () (interactive) (my/run-in-background "telegram-desktop")))
("d" (lambda () (interactive) (my/run-in-background "flatpak run com.discordapp.Discord")))) ("d" (lambda () (interactive) (my/run-in-background "flatpak run com.discordapp.Discord"))))
@ -2150,7 +2151,7 @@ font-4 = JetBrains Mono Nerd Font:monospace:size=17;4
Modules. Because I sometimes set up different blocks on different monitors, they are set via environment variables. Modules. Because I sometimes set up different blocks on different monitors, they are set via environment variables.
#+begin_src conf-windows #+begin_src conf-windows
modules-left = i3 modules-left = i3 c-g glyph-left-light-background--blue
; modules-center = test ; modules-center = test
modules-right = ${env:RIGHT_BLOCKS} modules-right = ${env:RIGHT_BLOCKS}
@ -2831,6 +2832,55 @@ interval = 1
format-underline = ${colors.light-green} format-underline = ${colors.light-green}
format-foreground = ${colors.foreground} format-foreground = ${colors.foreground}
#+end_src #+end_src
*** C-g
#+begin_src bash :tangle ./bin/polybar/c-g.sh
EMACS_FLAG="-l /home/pavel/.emacs.d/desktop.el"
EXCLUDE_PATTERN="dbus-launch --exit-with-session emacs"
EMACS_PIDS=$(pgrep -f "emacs.*${EMACS_FLAG}")
SIGNAL_SENT=false
for PID in $EMACS_PIDS; d o
CMDLINE=$(ps -p "$PID" -o args=)
if [[ "$CMDLINE" == *"$EXCLUDE_PATTERN"* ]]; then
continue
fi
kill -SIGUSR2 "$PID" 2>/dev/null
if [ $? -eq 0 ]; then
echo "Sent SIGUSR2 to Emacs (PID: $PID)"
SIGNAL_SENT=true
else
echo "Failed to send SIGUSR2 to Emacs (PID: $PID)"
fi
done
if [ "$SIGNAL_SENT" = false ]; then
echo "Emacs process not found or already handled."
exit 1
fi
exit 0
#+end_src
#+begin_src conf-windows
[module/c-g]
type = custom/text
content = " C-g"
click-left = bash ~/bin/polybar/c-g.sh
content-background = ${colors.blue}
#+end_src
#+begin_src conf-windows
[module/glyph-left-light-background--blue]
type = custom/text
content-background = ${colors.backround}
content-foreground = ${colors.blue}
content = ${glyph.gleft}
content-font = 5
#+end_src
*** SEP *** SEP
A simple separator A simple separator
#+begin_src conf-windows #+begin_src conf-windows