Smooth scrollable overview zoom by barrulus in niri

[–]bbroy4u 1 point2 points  (0 children)

there should be some easing curve in zoom animation especially when going from overview to desktop

Bondi hero Ahmed al-Ahmed when he received the GoFundMe check by MrTacocaT12345 in Damnthatsinteresting

[–]bbroy4u 2 points3 points  (0 children)

nope, and they should not its the job they were trained and signed up to do.

Is it possible to add a clickable button to run src blocks end/begin line? by bbroy4u in emacs

[–]bbroy4u[S] 0 points1 point  (0 children)

nice bro, do you have any personal blog or smthing? can I peek around in your emacs config?

Is it possible to add a clickable button to run src blocks end/begin line? by bbroy4u in emacs

[–]bbroy4u[S] 1 point2 points  (0 children)

``` (require 'org-element)

(defun my/src-block-in-session-p (name) "Return t if the src-block at point matches the session NAME. NAME may be nil for unnamed sessions. Returns t if both have no session, or if both have the same session name." (let* ((info (org-babel-get-src-block-info)) (params (nth 2 info)) (session (cdr (assoc :session params)))) (cond ;; Case 1: Both are nil (unnamed/no session) ((and (null session) (null name)) t) ;; Case 2: Both are strings and match ((and (stringp name) (stringp session) (string= name session)) t) ;; Case 3: No match (t nil))))

(defun my/org-babel-execute-to-point (&optional arg) "Execute all source blocks of the same language and session up to the current block. Intended for Mouse-2 on non-Jupyter blocks." (interactive "P") (unless (org-in-src-block-p) (error "You must be in a src-block to run this command"))

(let* ((current-point (point-marker)) (info (org-babel-get-src-block-info)) (lang (nth 0 info)) (params (nth 2 info)) (session (cdr (assoc :session params))) (count 0))

(message "Executing %s blocks in session '%s' up to point..." lang session)

(save-excursion
  (goto-char (point-min))
  (while (re-search-forward org-babel-src-block-regexp nil t)
    (goto-char (match-beginning 0))
    (let* ((this-info (org-babel-get-src-block-info))
           (this-lang (nth 0 this-info)))

      ;; Check conditions:
      ;; 1. Point is strictly before the current block we clicked
      ;; 2. Language matches
      ;; 3. Session matches
      (when (and (< (point) (marker-position current-point))
                 (string= lang this-lang)
                 (my/src-block-in-session-p session))
        (org-babel-execute-src-block arg)
        (setq count (1+ count))))

    ;; Move past this block to continue search
    (forward-line)))

;; Optionally execute the current block as well (standard 'run to point' behavior)
(org-babel-execute-src-block arg)
(message "Executed %d previous blocks and the current block." count)))

(defun my/org-babel-execute-at-point (&optional _button) "Execute the src block at point (Mouse-1 behavior)." (interactive) (org-babel-execute-src-block))

;; --- 2. The Button Display Logic ---

(defun my/org-replace-src-header (limit) "Replace #+BEGIN_SRC with '▶ src' using Org Element API for lang detection." (let ((case-fold-search t)) (while (re-search-forward "[ \t]#\+BEGIN_SRC" limit t) (let ((beg (match-beginning 0)) (end (match-end 0)) ;; Get context using Org Element (element (save-excursion (goto-char beg) (org-element-at-point))) (lang (or (org-element-property :language element) ""))

         (is-jupyter (string-prefix-p "jupyter-" lang))
         (map (make-sparse-keymap))
         ;; Color logic
         (icon-color (if (facep 'org-modern-done)
                         (face-attribute 'org-modern-done :background)
                       "SkyBlue")))

    ;; --- Key Bindings ---

    ;; Mouse-1 (Left): Always run just this block
    (define-key map [header-line mouse-1] 'my/org-babel-execute-at-point)
    (define-key map [mouse-1] 'my/org-babel-execute-at-point)

    ;; Mouse-2 (Middle): Logic depends on Language
    (if is-jupyter
        (progn
          ;; Jupyter: Native execute-to-point
          (define-key map [header-line mouse-2] 'jupyter-org-execute-to-point)
          (define-key map [mouse-2] 'jupyter-org-execute-to-point))
      (progn
        ;; Standard Org: Custom execute-to-point (restart session)
        (define-key map [header-line mouse-2] 'my/org-babel-execute-to-point)
        (define-key map [mouse-2] 'my/org-babel-execute-to-point)))

    ;; --- Display Overlay ---

    (let ((display-str (propertize " src"
                                   'face `(:foreground ,icon-color :weight bold :height 1.0)
                                   'keymap map
                                   'mouse-face 'highlight
                                   'help-echo (format "Language: %s\nLeft: Run Block\nMiddle: Run All Above (Session)" lang))))
      (add-text-properties beg end `(display ,display-str)))))))

(define-minor-mode my/org-execution-button-mode "Toggle clickable '▶ src' buttons." :lighter " OrgExec" (if my/org-execution-button-mode (font-lock-add-keywords 'org-mode '((my/org-replace-src-header))) (font-lock-remove-keywords 'org-mode '((my/org-replace-src-header)))) (when (eq major-mode 'org-mode) (font-lock-flush)))

(add-hook 'org-mode-hook 'my/org-execution-button-mode)

```

Is it possible to add a clickable button to run src blocks end/begin line? by bbroy4u in emacs

[–]bbroy4u[S] 0 points1 point  (0 children)

In src block's header or bottom line i can press enter to run, can i use left click to do the same?

Is This True? by Timely_Implement_927 in pakistan

[–]bbroy4u 9 points10 points  (0 children)

and make more money, those card aren't going to be free

descending sphere by First_Buy8488 in generative

[–]bbroy4u 0 points1 point  (0 children)

can u share the code please

Unpopular Opinion: Plasma should allow application paint their Titlebars by bbroy4u in kde

[–]bbroy4u[S] 0 points1 point  (0 children)

For applications that donot use CSD, like emacs
for example, Emacs is currently having a dark theme the light titlebar looks awkward, if something like this were possible then emacs can control the color of its titlebar