Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spacing issue in terminal mode #479

Open
o0nd7ots opened this issue Sep 28, 2023 · 6 comments
Open

Spacing issue in terminal mode #479

o0nd7ots opened this issue Sep 28, 2023 · 6 comments
Labels

Comments

@o0nd7ots
Copy link

o0nd7ots commented Sep 28, 2023

Hello,
I am trying to achieve an uniform look between text mode and graphical mode in emacs.
I have made a banner in svg and ascii.

I have run into a problem: my 1:1 ascii representation has two empty lines above it and four below it, while in GUI mode its one above and one below. Is there any way to control this?

Also, can one control the transparency and size of files placed as banners?

@jcs090218
Copy link
Member

Sorry for the late reply!

I have run into a problem: my 1:1 ascii representation has two empty lines above it and four below it, while in GUI mode its one above and one below. Is there any way to control this?

Those are control by your text banner. You can see my mine as an example https://github.com/jcs-emacs/jcs-emacs/blob/master/banners/sink.txt.

Text Graphical
2023-10-11 14 58 33 2023-10-11 14 58 38

Also, can one control the transparency and size of files placed as banners?

This is not possible at the moment. Can you elaborate a bit more? 🤔

@o0nd7ots
Copy link
Author

Hi and do not worry, it is not urgent.

Here is my text mode dashboard:
text-spacing

wc shows that my banner has 20 lines. For me in text mode dashboard puts two empty lines before and after it.
I am not sure if it also is the case for you but I think yes.

About the size and transparency;
I have an Aperture Science logo as my dashboard image. It is in SVG. Here is a screen.
gui-spacing
I have cesored the banner title.

As you can see the SVG file is on a opaque background. I wish there was a way to make it transparent.

Also, when I launch Emacs on a display with a bigger scale, the screen estate is not enough for the banner alone: I need to scroll to access the rest of the dashboard. I would like to make it smaller so that I can see the "packages loaded" section.

@jcs090218
Copy link
Member

I have fixed one extra empty line on the top in terminal mode, see 427cd8e.

As you can see the SVG file is on a opaque background. I wish there was a way to make it transparent.

Duplicate of #347.

@o0nd7ots
Copy link
Author

o0nd7ots commented Oct 12, 2023

I think there can be just one newline after the logo in text mode. Now we have 1 on top and 2 on the bottom.
In GUI mode there is one line at the top and at the bottom.
Removing the (when (display-graphic-p) (insert "\n")) would allow for more flexibility - if people want they can just add an extra line to their ascii logo.

I proposed this change in this patch (how to link the commit id like you did?)

I do not think it is a duplicate. #347 is about the lining and my problem is with the filling.
I tried both pgtk and X. The opaque square is still there.

I think it has something to do with emacs 29's transparency.

@jcs090218
Copy link
Member

jcs090218 commented Oct 12, 2023

I think there can be just one newline after the logo in text mode. Now we have 1 on top and 2 on the bottom.

On my end, there is only one line at the bottom (terminal mode).

Removing the (when (display-graphic-p) (insert "\n")) would allow for more flexibility - if people want they can just add an extra line to their ascii logo.

Good suggestion! I will think a little more on this. Sorry I am very busy these months... 😓

I do not think it is a duplicate. 347 is about the lining and my > problem is with the filling.
I tried both pgtk and X. The opaque square is still there.

You mean the background should be transparent? I only used png file, but not sure if svg will work in Emacs. 🤔

@o0nd7ots
Copy link
Author

On my end, there is only one line at the bottom (terminal mode).

For me it is two:
image

I have checked my config and i do not see why this happens.
Here is my dashboard config:

 (use-package dashboard
   :ensure t
   :after all-the-icons
   :init
   ;; general
   (setq dashboard-center-content t
         ;;dashboard-init-info "test" ; replace init info with a string
         dashboard-set-init-info t    ; show info about packages and startup time
         dashboard-show-shortcuts nil ; do not show shortcuts ex. (r) for recents
         )

   ;; Icons
   (setq dashboard-icon-type 'all-the-icons
         dashboard-set-heading-icons t
         dashboard-set-file-icons    t)

   (if (display-graphic-p) ; if there is a gui
       (progn (setq dashboard-startup-banner (expand-file-name "themes/aperture-logo.svg" user-emacs-directory))
              (cond ; recongnize which one
               ((eq window-system 'pgtk) (setq dashboard-banner-logo-title "Welcome to Aperturemacs"))
               ((eq window-system 'x)    (setq dashboard-banner-logo-title "Welcome to AperturemaX" ))
               (t                        (setq dashboard-banner-logo-title "Welcome to...\nWait, what is this window system?"))))
     ;; if no GUI
     (setq dashboard-startup-banner (expand-file-name "themes/aperture-logo.txt" user-emacs-directory)
           dashboard-banner-logo-title "Welcome to Aperturemacs"))

   (setq dashboard-items '(
                           (agenda    . 8 )
                           (recents   . 3  )
                           ;;(bookmarks . 3 )
                           ;;(projects  . 3 ) ; requires Projectile
                           ;;(registers . 3 )
                           ))

   (setq dashboard-set-navigator nil
         dashboard-navigator-buttons; format: (list (icon title help action face frefix suffix))
         `((;; line1
            (,(all-the-icons-material "update" :height 2) "" "Update Aperturemacs packages"
             (lambda (&rest _) (elpaca-log) (elpaca-update-all))
             font-lock-variable-name-face "" "")

            (,(all-the-icons-material "info_outline" :height 2) "" "Read the history of Aperturemacs"
             (lambda (&rest _) (find-file-read-only "~/.config/emacs/themes/about-aperturemacs"))
             font-lock-builtin-face "" ""
             )
            ;;("⚑" nil "Show flags" (lambda (&rest _) (message "flag")) error) ; accept many arguments. _ is basically saying DO NOT CARE ABOUT THEM
            (,(all-the-icons-faicon "birthday-cake" :height 1.5 :v-adjust 0.0) "" "Don't you dare."
             (lambda (&rest _) (toggle-theme-music))
             font-lock-string-face "" " "
             )
            )
           ))
   ;; Agenda
   (setq dashboard-week-agenda t ; set nil for today
         dashboard-filter-agenda-entry 'dashboard-no-filter-agenda
         dashboard-agenda-sort-strategy '(priority-down)
         )
   ;; Footer
   (setq dashboard-footer-messages '("We do what we must, because we can.")) ; TODO add a custom face for this - I do not know if it is possible
   ;;(setq dashboard-footer-icon (all-the-icons-octicon "dashboard" :face 'org-quote :height 1.2 :v-adjust -0.05))
   ;;(setq dashboard-footer-icon (all-the-icons-faicon "music" :face 'org-quote :height 1.2 :v-adjust -0.05))
   ;;(setq dashboard-footer-icon (all-the-icons-octicon "issue-closed" :face 'org-quote :height 1.5 :v-adjust -1.05)) ; cannot theme
   :config
   (dashboard-modify-heading-icons '((recents . "file-text")))
   (add-hook 'elpaca-after-init-hook #'dashboard-insert-startupify-lists)
   (add-hook 'elpaca-after-init-hook #'dashboard-initialize)
   (dashboard-setup-startup-hook)
   ;;:hook (set-frame-parameter nil 'alpha '(60 . 60))
   )

Do you have any ideas what might be causing it? I build the package from source.

You mean the background should be transparent? I only used png file, but not sure if svg will work in Emacs. 🤔

Alright, thanks. I have read somewhere that emacs supports SVG it but I can manage without it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants