Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 23 20:39
    landakram synchronize #857
  • Feb 23 10:26
    landakram edited #857
  • Feb 23 10:24
    landakram opened #857
  • Feb 22 20:49
    alethiophile commented #763
  • Feb 22 20:49
    alethiophile closed #856
  • Feb 22 20:49
    alethiophile commented #856
  • Feb 22 20:46
    alethiophile opened #856
  • Feb 22 17:56
    ThomasBucaioni closed #855
  • Feb 22 17:56
    ThomasBucaioni commented #855
  • Feb 22 14:28
    tychoish commented #855
  • Feb 22 10:38
    jorams commented #855
  • Feb 22 07:12
    ThomasBucaioni opened #855
  • Feb 22 04:07
    tpine opened #21
  • Feb 21 19:40
    jamesmccabe edited #854
  • Feb 21 17:48
    jamesmccabe edited #854
  • Feb 21 17:48
    jamesmccabe edited #854
  • Feb 21 17:36
    jamesmccabe edited #854
  • Feb 21 17:35
    jamesmccabe edited #854
  • Feb 21 17:33
    jamesmccabe opened #854
  • Feb 18 15:50
    szos commented #851
David
@dmb2
Hello room
Stuart Dilts
@sdilts
Hello!
John
@podiki
Hi stumpers? stumpwmers? Anyway hello
first quick question: is there a preferred way of using swank? I had server setup in my stump config file, but just moved it to start before stump (in a script that runs stump, called by xinit). This seems to be better behaved in e.g. catching errors and allowing me to recover. Perhaps relatedly, trying some commands like 'restart-soft' or 'restart-hard' from a slime connection fails due to not finding the :top-level tag
Stuart Dilts
@sdilts
You have the full power of the CL environment in the init file, so I see no reason to start slime in a custom start script. Plus, if you do it in the init script, you should be able to have graphical prompts that help you debug/reconfigure swank.
John
@podiki
Sorry, perhaps I wasn't clear. I run startxdirectly, and .xinitrc runs sbcl with a short file that just loads and starts stumpwm. It seems starting the swank server there, before (stumpwm:stumpwm) is giving me better results than in my stump config file (which is run after). Does that make sense there would be a difference? I don't think I've changed anything else but was handling some errors better (related to multimonitor)
Stuart Dilts
@sdilts
I wouldn't think there would be a difference, but I'm no expert. What errors are you getting?
John
@podiki
Yeah, I didn't think there would be a difference, but maybe something else was going on. I'll see if I can reproduce.
As for errors, handling of displays being enabled or disabled was giving me some trouble, though the fixes somewhat recently that have been pushed seem to be doing better. It may actually be fine now, other than some custom code (a module I'll submit) which needs to deal with updating when displays are changed
restart-* from slime will run into not finding the tag :top-level, so somehow this is not being caught
Stuart Dilts
@sdilts
Are you trying to restart stumpwm inside slime?
If so, try using the macro (or is it a function?) called something like run-in-main-thread to call the restart. I don't have the code handy to find out what the actual name of the function is.
John
@podiki
I think I found it, a function called call-in-main-thread that takes a function as argument to run (does a thread check or adds it to some queue). Thanks, I'll try it out when I'm next debugging
Javier Olaechea
@PuercoPop_gitlab
Anyone got experience with GitHub actions? https://github.com/PuercoPop/stumpwm/runs/769451461
Javier Olaechea
@PuercoPop_gitlab
(for some reason using make succeed even if the build failed. I suspect because the debugger was enabled on the branch)
Mohd Hafiz Hilman
@hilman-dayo

Hello everyone. A beginner here. I have a question.

Let say I am focusing on emacs, and want to be able to send key to firefox to pause/play youtube video without moving the focus. Is it possible?

Mehmet Tekman
@mtekman
@hilman-dayo
(defun media-window-toggle ()
  (let ((num-orig (window-number (current-window))))
    (act-on-matching-windows
     (win) (title-re-p win ".*(Watch|YouTube).*")
     (progn (select-window-by-number (window-number win))
            ;; middle click, so that the fullscreen is not triggered
            (center-click))
     ;; Restore window and pointer
     (select-window-by-number num-orig)
     (banish)
     (echo "Toggled "))))

(defcommand center-content-do () () (media-window-toggle))
(define-key *top-map* (kbd "<your-desired-binding>") "center-content-do")
Mehmet Tekman
@mtekman

I have a question: how do I create a rule to automatically float a floating window, instead of forcing it into a frame?
Joram Schrijver
@jorams
@mtekman You can use define-frame-preference for that. If you set the target frame to :float, the window will be floated
Mohd Hafiz Hilman
@hilman-dayo
@mtekman Neat! Thanks!
Mehmet Tekman
@mtekman
@jorams thanks
Mehmet Tekman
@mtekman
@jorams do you know a way to automatically capture any window and assign it to :float by default, and still preserve existing rules (e.g. browser, editor) for explicit tiling?
Joram Schrijver
@jorams
@mtekman I'm not sure I understand what you mean. A frame preference only applies to the windows matching what you specify, so it shouldn't affect any other rules.
Mehmet Tekman
@mtekman
@jorams sorry, I meant that I wish all frames to float by default, except those with specific frame preferences. This would be a catch all solution for windows whose names I do not know in advance, such as GIMP toolbars and the R install location window
Stuart Dilts
@sdilts
@mtekman There is a specific X11 window that is usually assigned to windows that should be floating. That's at least how i3 and Sway choose how to float windows. I don't remember what the property is, but it is probably worth looking into.
Mehmet Tekman
@mtekman
Ah, interesting! So I could select based on X11 properties -- thanks @sdilts
Mohd Hafiz Hilman
@hilman-dayo

@mtekman hey, I tried your code and got this warning

undefined function: STUMPWM::CENTER-CLICK

How can I solve it?

Mehmet Tekman
@mtekman
Oh whoops I thought that was builtin
@hilman-dayo
(defun center-click ()
  (let ((scre (window-screen (current-window)))
        (wwid2 (round (window-width (current-window)) 2))
        (whid2 (round (window-height (current-window)) 2))
        (geom (multiple-value-list (geometry-hints 
(current-window)))))
    (let* ((wx (nth 0 geom)) (wy (nth 1 geom))
           (sx (+ wx wwid2)) (sy (+ wy whid2)))
      (warp-pointer scre sx sy)
      (ratclick 1))))
Mohd Hafiz Hilman
@hilman-dayo
@mtekman thanks man! I still need to tinker with cl more
Mehmet Tekman
@mtekman
welcome -- let me know it works
Mohd Hafiz Hilman
@hilman-dayo

@mtekman
It is working.

One weird thing though.
Although the num-orig window seems to be selected back, the keys still act on the other window.

Toy example,

;; win0 = emacs
;; win1 = firefox

;; current window number is 0
(select-window-by-number 1)
(select-window-by-number 0)

After execute the above code, my emacs does not correspond to any key although the word Current Frame is written on emacs frame by stumpwm. The keystroke seems to be sent to firefox window.

Mehmet Tekman
@mtekman

@hilman-dayo I can't reproduce that, it seems to work fine for me...

I have these settings:

(setf *mouse-follows-focus* t)
(setf *mouse-focus-policy* :click)
Mohd Hafiz Hilman
@hilman-dayo
@mtekman So far, it is working for me now. Thanks!
Mehmet Tekman
@mtekman
Yay!
Roland Everaert
@montaropdf

Hello,

Can someone show an example of binding a key to a CL function, defined with (defun) or a stump command, defined with (defcommand)?

I have defined functions to manage the brightness of the screen on my laptop, but I face an exception, linked to calling said function.

I would, also, like to bind the special "laptop" keys for cycling between the embedded screen of the laptop and an external screen. I suppose, xrandr or gui like lxrandr are my friends, hier?

Mehmet Tekman
@mtekman

For brightness I have this horrible function I defined:

(defun brightness (up step)
  (let ((direction (if up "-inc" "-dec")))
    (run-shell-command (format nil "xbacklight ~A ~D" direction step))
    (let ((bright
           (run-shell-command
            "xbacklight -get | awk -F'.' '{printf \"Brightness: \"$1\"%\"}'"
            t))
          (cbright-file "~/.config/current-user-brightness.txt"))
      (if (< 10 (length bright))
          (message bright)
          ;; Otherwise use xrandr -- slow though!
          (let ((outdevice
                 (string-trim
                  '(#\Space #\Tab #\Newline)
                  (run-shell-command
                   "xrandr | grep \" connected\" | cut -d' ' -f 1" t)))
                (next-brightN nil))
            (with-open-file (str cbright-file
                                 :direction :IO
                                 :if-exists :OVERWRITE
                                 :if-does-not-exist :CREATE)
              (let* ((file-bright (read-line str nil))
                     (file-brightN (if file-bright
                                       (parse-integer file-bright)
                                       50))
                     (increment (if up step (- step))))
                (setq next-brightN (+ file-brightN increment)))
              (file-position str 0)
              (write-line (format nil "~D" next-brightN) str))
            (run-shell-command
             (format nil
                     "xrandr --output ~A --brightness ~1,2F"
                     outdevice
                     (/ next-brightN 100))))))))

called by

(defcommand brightness-up () () (brightness t 5))
(defcommand brightness-down () () (brightness nil 5))

and bound to

(define-key *top-map* (kbd "H-M-,") "brightness-down")
(define-key *top-map* (kbd "H-M-.") "brightness-up")
3 replies
John
@podiki
For brightness I use the excellent program light: https://github.com/haikarainen/light
3 replies
that can be bound easily to special keys just like audio control for example (define-key *top-map* (kbd "XF86AudioPrev") "exec mpc prev") (thought I had light bound in stumpwm but don't see it right now)
e.g. something for the key XF86MonBrightnessUp with exec light -A 5
Mehmet Tekman
@mtekman
@podiki I prefer to re-invent the wheel thank you very much!
John
@podiki
@mtekman don't we all! :-P the joy of things like stump and lisp
Mehmet Tekman
@mtekman
indeed indeed!
Roland Everaert
@montaropdf

On a different note, I am fighting with stumpwm and the ttf-fonts module on a fedora 33 system. stumpwm and all the modules were installed using the guix package manager. Currently, when I try to set the font, stumpwm tells me that it is not able to find it. However, the font files are installed in $HOME/.fonts, I have executed fc-cache -f -v and below is my configuration:

(load-module "ttf-fonts")
;; Next line to be used when fonts gets updated
(setf xft:*font-dirs* (list (concat (getenv "HOME") "/.guix-profile/share/fonts/")
                (concat (getenv "HOME") "/.fonts/")))
(setf clx-truetype:+font-cache-filename+ (concat (getenv "HOME") "/.fonts/font-cache.sexp"))
;; (xft:cache-fonts)
;; (message xft:*font-dirs*)

(set-font (make-instance 'xft:font :family "DejaVu Sans Mono" :subfamily "Book" :size 14))

If I uncomment (xft:cache-fonts), the system wants, sometimes, to write into a subdirectory of a guix package in the guix store. This fails as the store is write protected.

I want to install the Nerd font version of DejaVu Sans Mono.

On my laptop, StumpWM is installed from source and I didn't find much difficulties to load the fond except for finding the right value for the parameter :family.

Anyone have experience with the installation of StumpWM using the the Guix package manager to install and configure StumpWM and the contribs?

Pranav Kesavarapu
@psiayn
Hi, sorry if this is the wrong place to ask...
I just found stumpwm recently and gave it a try. I've been trying to load stumptray and start it using the command in the readme of the module but it keeps throwing errors that the function STUMPTRAY::STUMPTRAY is undefined.
7 replies