stumpwm/applications.lisp @ a65fd2691c94 default tip
More
| author | Steve Losh <steve@stevelosh.com> | 
|---|---|
| date | Mon, 03 Nov 2025 14:55:17 -0500 | 
| parents | 890e2d48b6f7 | 
| children | (none) | 
(in-package :stumpwm-user) (defcommand igv () () (run-or-raise "igv" '(:class "org-broad-igv-ui-Main"))) (defcommand spotify () () (run-or-raise "spotify" '(:class "Spotify"))) (defcommand zoom-meeting () () (run-or-raise "echom 'No meeting running.'" '(:class "zoom" :title "Meeting"))) (defcommand files () () (run-shell-command "open $HOME")) (defcommand browser () () (run-or-raise "firefox" '(:class "firefox"))) (defcommand vlc () () (run-or-raise "vlc" '(:class "vlc"))) (defcommand terminal () () (run-shell-command (format nil "st -f 'Ubuntu Mono:size=~D'" *terminal-font-size*))) (defcommand terminal-in (path) ((:string "Working directory: ")) (run-shell-command (format nil "st -f 'Ubuntu Mono:size=~D' env -C '~A' fish" ; todo actually escape this *terminal-font-size* path))) (defun window-pid (&optional (window (current-window))) (let ((window-id (xlib:window-id (window-xwin (current-window))))) (first (xlib:get-property (window-xwin window) :_net_wm_pid)))) (defclass* process () (pid command-line cwd children)) (defmethod print-object ((o process) s) (print-unreadable-object (o s :type t) (format s "~D ~S (~D child(ren))" (pid o) (command-line o) (length (children o))))) (defun process-info (pid) (make-instance 'process :pid pid :command-line (_ (format nil "/proc/~D/cmdline" pid) alexandria:read-file-into-string (str:split #\nul _ :end (1- (length _)))) :cwd (sb-posix:readlink (format nil "/proc/~D/cwd" pid)) :children (gathering (dolist (thread (list-directory (format nil "/proc/~D/task" pid))) (dolist (child (_ thread namestring (format nil "~A/children" _) alexandria:read-file-into-string (str:split #\space _ :omit-nulls t) (mapcar #'parse-integer _))) (gather (process-info child))))))) (defcommand vsplit-terminal-here () () (let ((cwd (dwim-cwd))) (sane-vsplit) (terminal-in cwd))) (defcommand hsplit-terminal-here () () (let ((cwd (dwim-cwd))) (sane-hsplit) (terminal-in cwd))) (defcommand terminal-here () () (terminal-in (dwim-cwd))) (defcommand terminal-apl () () (run-shell-command "st -f 'BQN386 Unicode:style=Regular:size=12'")) (defcommand gcontrol () () (run-or-raise "gcontrol" '(:class "Gnome-control-center"))) (defcommand papers () () (run-or-raise "jabref" '(:class "org.jabref.gui.MainApplication")))