[ / / / / / / / / / / / / / ] [ dir / 1piece / dcaco / firechan / imas / lovelive / marx / mde / sunny ][Options][ watchlist ]

/tech/ - Technology

You can now write text to your AI-generated image at https://aiproto.com It is currently free to use for Proto members.
Email
Comment *
File
Select/drop/paste files here
Password (Randomized for file and post deletion; you may also set your own.)
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Expand all images

File (hide): 35c72cd29bd4ddd⋯.png (15.83 KB, 800x163, 800:163, stumpwm.png) (h) (u)

[–]

 No.953877[Watch Thread][Show All Posts]

I've been using StumpWM for a couple of months now, ever since I've seen it mentioned here.

Anyone got some neet customizations?

I'm not some ultimate lisp h4xx0r. Here's my only real self-made customization, other shit I got I copied from other rc files.

Reason for customization: I'm on a laptop and I got tired of having to look up the monitor names (as I work at different places a lot), so when attaching monitors I created this little script for easy editing of xrandr setup:


(defun get-connected-monitors (awk)
"Return list of connected monitor strings."
(cl-ppcre:split "\\n+" (run-shell-command (concatenate 'string "xrandr | grep ' connected' | awk '{ " awk " }'") t)))

(defun string-from-list (strings &optional (glue " "))
"Join strings from a list."
(reduce (lambda (m o)
(concatenate 'string m glue o))
strings))

(defun get-monitor-parameter (desc)
"Gets xrandr parameter from string."
(cond ((string= desc "off") "--off")
((string= desc "left") "--left-of")
((string= desc "right") "--right-of")
((string= desc "up") "--above")
((string= desc "down") "--below")
(t "")))

(defcommand monitor-edit () ()
(let* ((monitor
(read-one-line (current-screen)
(concatenate 'string "Monitor wijzigen (" (string-from-list (get-connected-monitors "print$1,$3,$4") ", ") "): ")))
(doing (read-one-line (current-screen) "Plaatsing: "))
(where (read-one-line (current-screen) "Tegenover welke: "))
(x (concatenate 'string "xrandr --output " monitor " --auto")))
(when (and (stringp doing) (> (length doing) 0))
(setq x (concatenate 'string x " " (get-monitor-parameter doing)))
(when (and (stringp where) (> (length where) 0))
(setq x (concatenate 'string x " " where))))
(run-shell-command x)))

I'd care about feedback too if anyone has some

>inb4 redundant string splitting & concatenating

 No.953878

Forgot to translate txt from dutch to english:

Monitor wijzigen = Edit monitor

Plaatsing = placement

tegenover welke = against which


 No.953931>>953953 >>954252 >>954338

I've been a common lisp programmer since 2004 and see tiling window managers and emacs as a whole utterly useless. Convince me otherwise


 No.953953>>954119

>>953931

Tiling window managers are useful if you customize everything to your needs keyboard wise. I use Emacs and Firefox (with tridactyl) most of the time. Both are customized to my own custom shortcuts. And now my window manager is as customizable as Emacs. I can practically do everything from my keyboard in a few shortcut keys. So things I find annoying to do, I automate, and put them under shortcuts to start or stop. Also using the whole screen all the time is something I prefer over the stacking way. So your statement is utterly worthless. Convince me otherwise


 No.953975>>954400

Consider using the interactive-args feature of defcommand, it makes getting arguments quite a bit easier than embedding read-line into your function.

I have a more limited use case, since I'm only interested in attaching/detaching a monitor to my laptop, but this is my xrandr function, for example.


(defcommand attach-monitor (dir &optional (interface "VGA1"))
((:direction "Direction: "))
"add a monitor on the specified interface using xrandr"
(declare (type (member :up :down :left :right) dir))
(let ((xdir (cond ((eq dir :up) "above")
((eq dir :down) "below")
(t (string-downcase (string dir))))))
(run-shell-command
(format nil "xrandr --output ~A --auto --~A-of LVDS1" interface xdir))))


 No.954119>>955503

>>953953

You can customize other window managers just as much. A lot of people dislike GNOME because of lack of customization, when in reality they just haven't been looking in the right places to do so (e.g. wm config files)

The keyboard is used for typing, which it's good for. Of course you can't do everything with a mouse, THAT'S where commands come in and where they should stay. There's also the fact that you can only have about 4 windows open on a tiling window manager in 1 workspace before things become too crowded, when with a stacking one you can easily put in 6 and switch between them comfortably without switching a workspace.


 No.954252

>>953931

I have to say, you're mostly right. If you have keybinding that allows you to switch directly to emacs on a none-tilling wm, then you're good, especially if you mostly use emacs.

Even though I'm using stumpwm right now, too lazy to change.


 No.954338>>954384

File (hide): 49ee75c431d4f4e⋯.webm (270.54 KB, 950x800, 19:16, edit-server.webm) (h) (u) [play once] [loop]

>>953931

>tiling window managers

>Emacs

Why not both? Xah has a good article on why tiling window managers>>953931

>tiling window managers

>Emacs

Why not both?

In all seriousness, Xah has a good article on why tiling window managers suck. Mainly his disdain comes down to two things: the blatantly misguided facade of "window optimization" and obscure window controls.

The former is something you'll never really overcome, just by the inherent nature of window tiling. You'll never be able to center a window, so you'll never have a direct view of anything you're working on unless that's the only window on that particular desktop. Most window managers by default will render windows according to awkward proportions; the irony of tiling wm's saving estate, of course, is that most applications aren't really designed for the window sizes that tiling wm's impose--even as I'm using Emacs right now, my windows are much bigger than the allotted 80-character column that I assign my fill-column var to be at in text buffers (I think my prog-mode buffers are at 140 before whitespace mode bugs me), and even if I exceed that, it's kind of unwieldy. With that in mind, there is an advantage to Emacs with regards to this issue, because Emacs has good window management, better than any multiplexer like tmux and definitely better than most tiling wm's, I would assert–but not by default. Like, for example, in pic related I'm using a module that resizes windows according to the golden ratio. That doesn't address disproportionate sizes or the fact that windows are pushed to the wayside, but it does keep un-highlighted windows in the periphery, which is basically the desired end for most. You could probably (and people probably have) implement this in more extensible wm's like wm, but I don't think the windows resize according to which window is active.

The latter is actually incredibly nixed, at least in the case of Xah, because he's a die-hard Emacs user. What better keybind choices for an Emacs user than that of Emacs itself? Of course, most people don't like the default input paradigm of Emacs, enough to where they dismiss Emacs itself. Well there are a lot of reasons to dismiss Emacs, but it's really sad that they've been so shit on by editors and other software that they sincerely believe keybindings are set in stone. There are multiple input methods for Emacs, including voice control, Vi emulation, and a better Vi-esque key input method that isn't tied down to the archaic Vi terminology, but I digress.

Both of those points aren't very persuasive in favor of EXWM. They pinnacle of why I use Emacs as a tiling WM and will never go back to anything else is because of its key simulation. You can find some posts about it on /emacs/, but, basically, it means you never have to deal with any more key bindings but the ones that Emacs uses ever again. Back when Conkeror was a thing, a lot of people were excited because it emulated Emacs bindings (as well as some deeper mannerisms that were never fully realized, but that's beyond the point). I didn't care for it though, because I didn't really feel the need to use an Emacs emulator within Emacs, especially when I could manipulate text in FF just like I would in Emacs. For example when I push C-n, the screen goes down are my cursor goes down, C-i replaces tab, etc., etc.. It can also handle more complex macros. This is nice because, as we all know, FF has recently hardcoded a lot of its bindings. Even with extensions that do alter certain bindings, they won't affect select pages in Firefox; with key simulation, you can surmount this, and it can be applicable for literally all X applications, no settings required.

In fact, Emacs can augment the behavior in some more ways, the most notable being exwm-edit. Right now, like in pic related, I'm editing this text with Emacs in markdown-mode. When I press C-c C-c, it'll paste the text automatically in the text box. This is actually a very primitive extension compared to the edit-with-emacs module where FF spawns a server that renders the text in this buffer in parallel with that of a text form, but this module isn't specific to FF, so I prefer it.

Anyway, I didn't really write this to convince you, but maybe you'll get a better understanding of the rationale of people who use Emacs and tiling wm's. I definitely think EXWM is the best tiling WM in the market, but it does have its flaws--mainly Emacs' lack of asynchronicity. I don't know why simulation keys aren't a feature of all wm's, but it's a really profound feature.


 No.954384>>954428

>>954338

His retarded babby duck post wa already debunked in a thread, kiddo.


 No.954400

>>953975

I tried to use it, but it only allows string literals


 No.954428

>>954384

Did you delete your post and then rewrite it just for that point?


 No.955503

>>954119

If you're switching between six windows constantly, you have no idea how to categorize the software you're using.




[Return][Go to top][Catalog][Screencap][Nerve Center][Cancer][Update] ( Scroll to new posts) ( Auto) 5
11 replies | 1 images | Page ???
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / 1piece / dcaco / firechan / imas / lovelive / marx / mde / sunny ][ watchlist ]