Code Monkey home page Code Monkey logo

awesome-tray's Introduction

Hi, I'm ManateeLazyCat

About Me

I often use English name Andy Stewart, my Chinese name is 王勇.

Here are some ideas to get you started:

  • Self-study computer and programming technology
  • Mobile game developer (2005 ~ 2007)
  • Create a clothing factory (2007 ~ 2009)
  • Pre-CTO of deepin operating system (2010 ~ 2018)
  • Own several IT companies now (2019 ~ now)
  • Like self-driving tour, live with kind wife and cute daughter
  • A lot of time on EAF and lsp-bridge

Skills: Python、C、C++、Emacs Lisp、Haskell、Golang、Vala、JavaScript、Ruby、Lua and more

Welcome to my Chinese blog: manateelazycat.github.io

Coding Life

Github Stats

Most Used Languages

Recent Activity

awesome-tray's People

Contributors

amaikinono avatar antoineb avatar booaa avatar bzy-debug avatar ciavash avatar ctrl2wei avatar feng-qi avatar jaor avatar jousimies avatar junyi-hou avatar kimim avatar kuxiade avatar lucastavaresa avatar manateelazycat avatar mumu-lhl avatar saul-bt avatar tomterl avatar trev-dev avatar wtding1998 avatar xhcoding avatar zaeouh avatar zw963 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

awesome-tray's Issues

Line number display incorrect when use "M-<" or "M->"

reproduce

Open a file, we suppose this file content 70 lines

the cursor current at line 1, line number show (1:0 top), this is expected

Press "M->"

i can see (1:0 top) no changed, this is not expected.

i expect to see "(70:0 bottom)"

Press "Ctrl+p", will move one line up,

we see (69:0 99%), this is expected.

solution

It seem like when press "Ctrl+>" or "Ctrl+<", some hook not happen which should update
line number.

Emacs 26.1 + newest commit fdda61e

Thank.

Windows下使用导致卡顿

  • 问题描述
    你好! 我尝试了您的awesome-tray后, 感觉十分好用. 不过我发现如果打开含有git信息的文档, Emacs就会变得十分卡顿甚至失去相应.

为了防止其他包的干扰结果, 使用emacs -Q最小化启动, 单独载入awesome-tray并打开profiler.
结果如图所示.
tim 20181027182138

似乎CPU大部分时间忙于处理git信息的更新, 而在windows下启动进程比较昂贵, 可能这就是导致卡顿的原因.

  • 我的一点点建议
    Git分支信息不同于行号和列号当前时间这种实时更新的信息, 是相对比较固定的. 可以将其缓存下来, 避免了反复调用Git开销严重, 进而导致性能问题

Performance issue with awesome-tray-module-location-info

When editing large file (org file with 20000 lines), the location module is very slow. I inspected the code and found out it cause by (line-number-at-pos (point-max)) and (line-number-at-pos). So i try to replace those function with better solution and it get much more faster.

  • Original
(defun awesome-tray-module-location-info ()
  (let* ((bottom-line (line-number-at-pos (point-max)))
         (location-percent
          (cond ((equal (line-number-at-pos) 1)
                 "top")
                ((equal (line-number-at-pos) bottom-line)
                 "bottom")
                (t
                 (format "%.f%%" (* (/ (float (line-number-at-pos)) bottom-line) 100))))
          ))
    (format "(%s:%s %s)"
            (line-number-at-pos)
            (current-column)
            location-percent
            )))
  • I replace (line-number-at-pos (point-max)) with total-lines-mode and (line-number-at-pos) with (string-to-number (format-mode-line "%l"))
(defun awesome-tray-module-location-info ()
          (let* ((bottom-line (if (numberp total-lines) total-lines (line-number-at-pos (point-max))))
                 (current-line (string-to-number (format-mode-line "%l")))
                 (location-percent
                  (cond ((equal current-line 1)
                         "top")
                        ((equal current-line bottom-line)
                         "bottom")
                        (t
                         (format "%.f%%" (* (/ (float current-line) bottom-line) 100))))
                  ))
            (format "(%s:%s %s)"
                    current-line
                    (current-column)
                    location-percent
                    )))

Can't exit Emacs when using wrong modules.

我没有用 circe 这个包。今天测试一些 face 的时候启用了 “circe” 模块,然后 awesome-tray 报错:

Wrong type argument: listp, "Sorry, something error in awesome tray."

且 Emacs 无法退出,退出时 modeline 会闪,并且重复报这个错。我估计可能是因为 awesome-tray 给一些 minibuffer 相关的函数加了 advice,而退出时 Emacs 还想要 message 什么信息,就一直卡在这个错误里了。

Update: 在开发 evil 模块的时候我发现如果模块的 info 函数出错,awesome-tray 就会报这个错。或许应当使得 info 函数出错时自动用 "" 代替其返回值,这样 info 函数就不需要太细致地处理错误。

Awesome-Tray hides vertico completions when using daemon.

Awesome-tray works fine with vertico when run via emacs.exe, however when using emacsclientw.exe to connect to a daemon awesome tray inhibits the display of vertico completions. The candidates will appear momentarily, and then be suppressed.

Emacs also throws this message(s) when connecting to the daemon:

Invalid face reference: awesome-tray-module-file-path-face
Invalid face reference: awesome-tray-module-mode-name-face
Invalid face reference: awesome-tray-module-date-face
Invalid face reference: awesome-tray-module-input-method-face

These messages do not appear when running without the daemon.

This occurs if running awesome-tray via the init.el or via M-x.

对 calendar 的支持

calendar 在 mode-line 上可以显示一些节日信息,感觉这个功能还挺好的

请问 awesome-tray 能否支持一下对 calendar 的显示呢?

感谢猫哥

awesome tray showing on left side

I am using following instructions to install awesome tray using use-package and straight, but awesome tray is showing on left side of the minibuffer. How can I resolve this issue.

(use-package awesome-tray
  :straight (:host github
             :repo "manateelazycat/awesome-tray"
             :branch "master")
  :config
  (awesome-tray-mode 1)
  (setq awesome-tray-active-modules '("location" "buffer-name" "git" "mode-name" "evil"))
  )

Modeline color when buffer is modified

I would like to change the mode-line-active-color dynamically if a buffer is modified. Actually the only way is to reactivate the mode. I would like to know if there is another way.

awetray + telega

In telega, the dividing line will become thicker because telega adds content to it.
I think it is possible to directly hide the modelline and add a dividing line instead of setting the modeline as a dividing line?

小建议 awesome-tray-get-echo-format-string 如果多于一行则添加换行符,使tray始终右对齐

(defun awesome-tray-get-echo-format-string (message-string)
(let* ((tray-info (awesome-tray-build-info))
        ;; (frame (if exwm--floating-frame exwm-workspace--minibuffer))
        (frame (when (and exwm_enable (exwm-workspace--minibuffer-own-frame-p))
                exwm-workspace--minibuffer nil))
        (blank-length (- (frame-width frame) (length tray-info) (length message-string) awesome-tray-info-padding-right))
        (empty-fill-string (make-string (max 0 (- (frame-width frame) (length tray-info) awesome-tray-info-padding-right)) ?\ ))
        (message-fill-string (make-string (max 0 (- (frame-width frame) (length message-string) (length tray-info) awesome-tray-info-padding-right)) ?\ ))
        )
    (prog1
        (if (> blank-length 0)
            ;; Fill message's end with whitespace to keep tray info at right of minibuffer.
            (concat message-string message-fill-string tray-info)
        (if (and awesome-tray-last-tray-info
                message-string
                (string-suffix-p awesome-tray-last-tray-info message-string))
            ;; Fill empty whitespace if new message contain duplicate tray-info (cause by move mouse on minibuffer window).
            (concat empty-fill-string tray-info)
            ;; Don't fill whitepsace at end of message if new message is very long.

            (concat message-string "\n" (concat empty-fill-string tray-info))))

    ;; Record last tray information.
    (setq awesome-tray-last-tray-info tray-info))))

mode-line is very weird when using org clock

before
图片

after
图片

When I use org-clock, the disabled mode-line will be weird. (org-clock-clocked-display in mode-line default)

Awesome-tray-hide-mode-line is not-nil, the thin mode-line become not thin.

I know disable the org-clock-clocked-display will become thin mode-line . But is this normal?

Consider a declarative scheme to add modules?

Currently a module can't be added without touching awesome-tray's codebase. Sometimes a user may want to have some private modules to satisfy his/her demand. I suggest we refactor awesome-tray-get-module-info to read the logic from an alist like:

(("git" . '(awesome-tray-module-git-info awesome-tray-module-git-face)
 (...))

so user can push his module name, info function and face into this list. I can do this if you consider it reasonable.

启动后 awsome-tab图标缩小

Is there a alternative way to pad right by overlay?

Hey, I noticed the option awesome-tray-info-padding-right had been removed by commit 00047f4.

Without that option the last one character of awesome-tray in my Emacs always goes to the new line, check out the screenshot:
image

And instead of, we are now using overlay, I want to know how to make the same purpose with overlay.

使用lsp-bridge时,awesome-tray modeline 表现异常

在使用lsp-bridge时,emacs启动后首先开启的buffer,awesome-tray的modeline表现正常,如图
image

而当打开文件,lsp-bridge被启动后,modeline就表现异常,貌似两者产生了冲突,如图
image

lsp-bridge 没有启动的buffer 表现正常,如图:
image

以下是我的配置:

(use-package lsp-bridge
  :quelpa (lsp-bridge :fetcher github
  		              :repo "manateelazycat/lsp-bridge"
  		              :files ("*"))
  :init (require 'lsp-bridge)
  :config
  (global-lsp-bridge-mode))

(use-package awesome-tray
  :quelpa (awesome-tray :fetcher github
  		                :repo "manateelazycat/awesome-tray"
  		                :files ("*.el"))
  :hook (after-init . awesome-tray-mode)
  :init
  (setq 
        awesome-tray-update-interval 0.6
        awesome-tray-buffer-name-max-length 30
        awesome-tray-file-path-show-filename t
        awesome-tray-buffer-name-buffer-changed t
        awesome-tray-active-modules   '("location" "belong" "buffer-name" "date")
        awesome-tray-essential-modules '("location" "belong" "buffer-name")))

麻烦懒猫大神帮忙看下,是否可以修复 ?非常感谢

Minibuffer里cursor表现异常

一旦想在minibuffer输入,比如使用M-x时,cursor会使minibuffer中间变全白。

image

不知是否和我其他安装的包有冲突。

awesome-tray 一些显示问题.

目前使用过程中, 主要遇到两个问题:

当开启多个 window 时, 鼠标挪到 tray 上面, 看到很多重复的 tray 信息, 体验较差.

1.gif

和 tabbar.el 在一起不工作

1.png

awesome-tray 相关的配置:

(require 'awesome-tray)
(awesome-tray-mode 1)

(provide 'awesome-tray_init)
;;; awesome-tray_init.el ends here

tabbar 相关的配置 (网上抄的)

(when (require 'tabbar nil t)
  (set-face-attribute 'tabbar-default nil
                      :background "gray20"
                      :foreground "gray20"
                      :box '(:line-width 1 :color "gray20" :style nil))
  (set-face-attribute 'tabbar-unselected nil
                      :background "gray30"
                      :foreground "white"
                      :box '(:line-width 5 :color "gray30" :style nil))
  (set-face-attribute 'tabbar-selected nil
                      :background "gray75"
                      :foreground "black"
                      :box '(:line-width 5 :color "gray75" :style nil))
  (set-face-attribute 'tabbar-highlight nil
                      :background "white"
                      :foreground "black"
                      :underline nil
                      :box '(:line-width 5 :color "white" :style nil))
  (set-face-attribute 'tabbar-button nil
                      :box '(:line-width 1 :color "gray20" :style nil))
  (set-face-attribute 'tabbar-separator nil
                      :background "gray20"
                      :height 0.6)
  ;; Enable tabbars globally:
  (tabbar-mode 1)
  (global-set-key [(meta \9)] 'tabbar-backward-tab)
  (global-set-key [(meta \0)] 'tabbar-forward-tab)

  (setq tabbar-buffer-list-function
        (lambda ()
          (remove-if
           (lambda (buffer)
             (or
              (string-match "^\\*.*\\*.*$\\|Scratch.txt" (buffer-name buffer))
              (eql major-mode 'dired-mode))
             )
           (buffer-list))))

  (defun tabbar-buffer-groups ()
    "Return the list of group names the current buffer belongs to.
Return a list of one element based on major mode."
    (list
     (cond
      ((or (get-buffer-process (current-buffer))
           ;; Check if the major mode derives from `comint-mode' or
           ;; `compilation-mode'.
           (tabbar-buffer-mode-derived-p
            major-mode '(comint-mode compilation-mode)))
       "Process"
       )
      ((member (buffer-name)
               '("*scratch*" "*Messages*"))
       "Common"
       )
      ((eq major-mode 'dired-mode)
       "Dired"
       )
      ((memq major-mode
             '(help-mode apropos-mode Info-mode Man-mode))
       "Help"
       )
      ((memq major-mode
             '(rmail-mode
               rmail-edit-mode vm-summary-mode vm-mode mail-mode
               mh-letter-mode mh-show-mode mh-folder-mode
               gnus-summary-mode message-mode gnus-group-mode
               gnus-article-mode score-mode gnus-browse-killed-mode))
       "Mail"
       )
      ((memq major-mode
             '(ruby-mode enh-ruby-mode rhtml-mode feature-mode js2-mode js-mode
                         yaml-mode haml-mode slim-mode css-mode scss-mode coffee-mode
                         markdown-mode sql-mode html-mode handlebars-mode sh-mode
                         python-mode web-mode dockerfile-mode scss-css-mode nginx-mode
                         ))
       "Web Develop"
       )
      ((memq major-mode
             '(dev-mode emacs-lisp-mode makefile-bsdmake-mode
                        nxml-mode conf-unix-mode-hook
                        ))
       "Develop"
       )
      ((memq major-mode
             '(text-mode org-mode
                         ))
       "Text"
       )
      (t
       ;; Return `mode-name' if not blank, `major-mode' otherwise.
       (if (and (stringp mode-name)
                ;; Take care of preserving the match-data because this
                ;; function is called when updating the header line.
                (save-match-data (string-match "[^ ]" mode-name)))
           mode-name
         (symbol-name major-mode))
       ))))
  )

(provide 'tabbar_init)
;;; tabbar_init.el ends here

Do not message "Enable awesome tray"?

awesome-tray-enable messages "Enable awesome tray". I put it in my own load theme hook to have correct colors/mode line heights when changing theme, but it's annoying that everytime it messages "Enable awesome tray". I tried this:

(define-advice awesome-tray-enable (:around (fn) fix)
  "Suppress messaging."
  (cl-letf (((symbol-function 'message) #'ignore))
    (funcall fn)))

It works, but somehow it breaks the function message: when calling message, the string show for an instant, but then nil appears in the echo area. This should have something to do with awesome-tray's advices.

Could we:

  • Let awesome-tray-enable do not message anything? We know it's loaded since the tray is there.
  • Or have a awesome-tray-refresh function for user to put in his/her own hooks?
  • Or find a way to make the above advice work without breaking message?

Awesome-tray seems to be interfering with `emacsclient`

I'm using awesome-tray with doom-emacs and it works awesome and I love it on GUI mode. However, when starting emacs with daemon and using emacsclient to connect to it it looks like awesome-tray interferes somehow. The mini-bufer just does not stays up while I try to complete a file path on it, it keeps hiding itself as seen in the gift below. If I disable awesome-tray or instead of using emacsclient -t -a '' I use emacs -nw everything works as expected.

2021-10-31 07 40 00

add to melpa?

As title, wish that this package can be added into melpa.

By the way, thanks for making this awesome work, I have waited for a cleaner mode line for a long time, and this package fit my needs perfectly.

java-ts-mode 中 belong信息没有显示

我在python-ts-mode 中 belong信息可以正常显示:

image

但是在java-ts-mode中belong信息就没有了:

image
上面显示是鼠标悬停在springboot 的controller类的方法中,按理belong应该返回内容的呀

大佬有空能看下吗,是不是有什么bug ?

awesome-tray-disable incorrectly recovers modeline height

Disabling awesome-tray makes modeline height to be 0.1pt. Documentation states that float number must be used as value for :height to apply it as scaling factor. Anyway, even 1.0 as :height value is not good, because user might have custom :height for modeline, that is exactly my situation

Thanks

occur with "minibuffer-inactive ... ..."

I found that I use vr/replace, and my emacs output some undesirable information as follows:
94637921-4f023380-030b-11eb-9e0f-27181d29cafc
So, I want to know how to prohibit this message which is often nosiy. Thanks.

How to set active line color?

I have tried to set the line color with (setq awesome-tray-mode-line-active-color "#7BDFCB")

When emacs starts, the line is still red and I get these warnings:

Warning: setting attribute ‘:background’ of face ‘mode-line-buffer-id’: nil value is invalid, use ‘unspecified’ instead.
AppData/Roaming/.emacs.d/awesome-tray/awesome-tray.el: Warning: Pattern t is deprecated.  Use `_' instead [2 times]
Unable to load color "color" [2 times]

edit: those errors seem to be there anyway

What is the correct way I should be setting the color?

Option for customize module.

Hi, thank for making awesome package. Can you add way to add custom module to traybar (like symon-mode). Thank a lot.

How to darken faces for light themes?

如题,我打算给 awesome-tray 加一个在亮色背景下自动把文字 face 变暗的功能。我想到下面两种做法:

最简单的实现像是:

(defface awesome-tray-module-awesome-tab-face
  '((((background light))
     :foreground "#731E38" :bold t)
    (t
     :foreground "#E73C70" :bold t))
  "Awesome tab face."
  :group 'awesome-tray)

我可以用一个 darken 函数来把一个颜色变暗,但遗憾的是上述表达式中并不能用函数的返回值作为颜色,所以需要手动一个一个加上去。此外若用户自定义 face,也需要像这样手动来搞,体验不太好。

另一种办法是我们定义一堆空 face,再搞一堆 defcustom 指定各 module 在暗色主题下的前景色(或者处于「中间」的前景色,让用户指定纯度比较高的颜色,在亮暗主题下分别加暗或加亮,这可以讨论)。在 awesome-tray-enable 时根据背景的亮暗再设定 face,类似 awesome-tab 那样。但是这样阵仗有点大。

你怎么看?是否有更好一些的做法?

When Active Line indicator is selected, then the Selected Text attributes should be modified to distinguish the selection

The text attributes of the active line indicator and of selected text are the same.

The selected text is always on the active line (with the exception of multi-caret selections), so it is impossible to determine which text is selected when the active line indicator option is used.

When the user chooses to have the active line indicator displayed, the selected text should automatically be modified to ensure that selected text is visibly highlighted.

Awesome tray and hotkeys

If i use hotkeys (C-a C-e or M-b M-f of cursor move C-f C-b), "awesome-tray" all refresh.

Another situation for blinking - "beginning buffer" and "end of buffer". Just press 'up' in begin file, all
data in tray lost (name, mode etc).

Truncate awesome-tab information?

Awesome-tab often give us a long project directory like:

Project: /home/kino/.emacs.d/straight/repos/awesome-tray/

It would be better to simply show

Project: awesome-tray

or

Project: .../s/r/awesome-tray/

In fact, I think it's better for "parent-dir" module to show .../s/r/awesome-tray, and "awesome-tab" module can show Project: awesome-tray.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.