updating desktop setup
This commit is contained in:
parent
fc983b39a6
commit
2a4a8b3ddd
|
@ -0,0 +1,11 @@
|
|||
# -*- mode: conf -*-
|
||||
|
||||
[Desktop Entry]
|
||||
Comment=Improved dynamic tiling window manager, registers with gnome session manager.
|
||||
Exec=stumpwm-gnome
|
||||
Name=stumpwm-gnome
|
||||
Type=Application
|
||||
X-GNOME-Autostart-Notify=false
|
||||
X-GNOME-Autostart-Phase=WindowManager
|
||||
X-GNOME-Provides=windowmanager
|
||||
X-GNOME-WMName=stumpwm
|
|
@ -0,0 +1,55 @@
|
|||
#
|
||||
# This file MUST be edited with the 'visudo' command as root.
|
||||
#
|
||||
# Please consider adding local content in /etc/sudoers.d/ instead of
|
||||
# directly modifying this file.
|
||||
#
|
||||
# See the man page for details on how to write a sudoers file.
|
||||
#
|
||||
Defaults env_reset
|
||||
Defaults mail_badpass
|
||||
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
|
||||
Defaults use_pty
|
||||
Defaults !lecture
|
||||
|
||||
# This preserves proxy settings from user environments of root
|
||||
# equivalent users (group sudo)
|
||||
Defaults:%sudo env_keep += "http_proxy https_proxy ftp_proxy all_proxy no_proxy"
|
||||
|
||||
# This allows running arbitrary commands, but so does ALL, and it means
|
||||
# different sudoers have their choice of editor respected.
|
||||
Defaults:%sudo env_keep += "EDITOR"
|
||||
|
||||
# Completely harmless preservation of a user preference.
|
||||
Defaults:%sudo env_keep += "GREP_COLOR"
|
||||
|
||||
# While you shouldn't normally run git as root, you need to with etckeeper
|
||||
#Defaults:%sudo env_keep += "GIT_AUTHOR_* GIT_COMMITTER_*"
|
||||
|
||||
# Per-user preferences; root won't have sensible values for them.
|
||||
#Defaults:%sudo env_keep += "EMAIL DEBEMAIL DEBFULLNAME"
|
||||
|
||||
# "sudo scp" or "sudo rsync" should be able to use your SSH agent.
|
||||
Defaults:%sudo env_keep += "SSH_AGENT_PID SSH_AUTH_SOCK"
|
||||
|
||||
# Ditto for GPG agent
|
||||
#Defaults:%sudo env_keep += "GPG_AGENT_INFO"
|
||||
|
||||
# Host alias specification
|
||||
|
||||
# User alias specification
|
||||
|
||||
# Cmnd alias specification
|
||||
|
||||
# User privilege specification
|
||||
root ALL=(ALL:ALL) ALL
|
||||
|
||||
# Members of the admin group may gain root privileges
|
||||
%admin ALL=(ALL) ALL
|
||||
|
||||
# Allow members of group sudo to execute any command
|
||||
%sudo ALL=(ALL:ALL) NOPASSWD: ALL
|
||||
|
||||
# See sudoers(5) for more information on "@include" directives:
|
||||
|
||||
@includedir /etc/sudoers.d
|
|
@ -17,12 +17,22 @@
|
|||
|
||||
BACKSPACE="guess"
|
||||
|
||||
- name: enable passwordless sudo for desktop users
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
src: "{{ role_path }}/files/sudoers"
|
||||
dest: /etc/sudoers
|
||||
mode: 0440
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: set up common desktop tools
|
||||
become: true
|
||||
ansible.builtin.apt: name={{ item }} state=present
|
||||
with_items:
|
||||
- acpitool
|
||||
- emacs
|
||||
- mate-terminal
|
||||
- vim-gtk
|
||||
|
||||
- name: set up desktop environments
|
||||
|
@ -33,6 +43,15 @@
|
|||
- i3lock
|
||||
- stumpwm
|
||||
|
||||
- name: install StumpWM gnome session
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
src: "{{ role_path }}/files/stumpwm-gnome.desktop"
|
||||
dest: /usr/share/xsessions/stumpwm-gnome.desktop
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: set up xprogs
|
||||
become: true
|
||||
ansible.builtin.apt: name={{ item }} state=present
|
||||
|
@ -43,4 +62,11 @@
|
|||
- firefox
|
||||
- gparted
|
||||
- scrot
|
||||
- thunar
|
||||
- thunar-archive-plugin
|
||||
- thunar-font-manager
|
||||
- thunar-gtkhash
|
||||
- thunar-vcs-plugin
|
||||
- thunar-volman
|
||||
- vlc
|
||||
- xfce4-places-plugin
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
- cmake
|
||||
- devscripts
|
||||
- gcc
|
||||
- git
|
||||
- golang-google-genproto-dev
|
||||
- golang-goprotobuf-dev
|
||||
- golang-protobuf-extensions-dev
|
||||
- git
|
||||
- graphviz
|
||||
- ipython3
|
||||
- jq
|
||||
|
@ -21,6 +21,7 @@
|
|||
- lua5.3
|
||||
- luarocks
|
||||
- make
|
||||
- pgcli
|
||||
- protobuf-compiler
|
||||
- python3-pip
|
||||
- python3-progressbar
|
||||
|
|
|
@ -1,228 +1,264 @@
|
|||
Content-Type: text/enriched
|
||||
Text-Width: 70
|
||||
;; -*-lisp-*-
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; INDEX ;;;
|
||||
;;; - DEPRECATED - MANIFEST ;;;
|
||||
;;; - SWANK INTERACTION ;;;
|
||||
;;; - GENERAL CONFIG ;;;
|
||||
;;; - UTILITY FUNCTIONS ;;;
|
||||
;;; - KEY BINDING ;;;
|
||||
;;; - EXECUTION ;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; <x-color><param>#565766</param>-*-lisp-*-
|
||||
</x-color>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>#565766</param>
|
||||
</x-color>;;; <x-color><param>#565766</param>INDEX ;;;
|
||||
</x-color>;;; <x-color><param>#565766</param>- DEPRECATED - MANIFEST ;;;
|
||||
</x-color>;;; <x-color><param>#565766</param>- SWANK INTERACTION ;;;
|
||||
</x-color>;;; <x-color><param>#565766</param>- GENERAL CONFIG ;;;
|
||||
</x-color>;;; <x-color><param>#565766</param>- UTILITY FUNCTIONS ;;;
|
||||
</x-color>;;; <x-color><param>#565766</param>- KEY BINDING ;;;
|
||||
</x-color>;;; <x-color><param>#565766</param>- EXECUTION ;;;
|
||||
</x-color>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>#565766</param>
|
||||
</x-color>
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>#565766</param>
|
||||
</x-color>;;; <x-color><param>#565766</param>DEPRECATED - MANIFEST ;;;
|
||||
</x-color>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>#565766</param>
|
||||
</x-color>;; <x-color><param>#565766</param>without the ability to select localhost-only, we can't use
|
||||
</x-color>;; <x-color><param>#565766</param>manifest at this time.
|
||||
</x-color>;; <x-color><param>#565766</param>(defvar *manifest-url*
|
||||
</x-color>;; <x-color><param>#565766</param>(manifest:start))
|
||||
</x-color>;; <x-color><param>#565766</param>(defun browse-manifest ()
|
||||
</x-color>;; <x-color><param>#565766</param>(format nil "exec ~A ~A" *default-browser* *manifest-url*))
|
||||
</x-color>;; <x-color><param>#565766</param>(define-key *root-map* (kbd "C-d") (browse-manifest))
|
||||
</x-color>
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>#565766</param>
|
||||
</x-color>;;; <x-color><param>#565766</param>SWANK INTERACTION ;;;
|
||||
</x-color>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>#565766</param>
|
||||
</x-color>;; <x-color><param>#565766</param>swank interaction allows us to connect to the StumpWM
|
||||
</x-color>;; <x-color><param>#565766</param>process from emacs while it's running.
|
||||
</x-color>
|
||||
(ql:quickload <x-color><param>#a3646f</param>:swank</x-color>)
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; DEPRECATED - MANIFEST ;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; without the ability to select localhost-only, we can't use
|
||||
;; manifest at this time.
|
||||
;; (defvar *manifest-url*
|
||||
;; (manifest:start))
|
||||
;; (defun browse-manifest ()
|
||||
;; (format nil "exec ~A ~A" *default-browser* *manifest-url*))
|
||||
;; (define-key *root-map* (kbd "C-d") (browse-manifest))
|
||||
|
||||
(<x-color><param>#93e57c</param>let</x-color> ((server-running nil))
|
||||
;; "Don't know how to REQUIRE SB-CLTL2"
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; SWANK INTERACTION ;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; swank interaction allows us to connect to the StumpWM
|
||||
;; process from emacs while it's running.
|
||||
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
|
||||
(user-homedir-pathname))))
|
||||
(when (probe-file quicklisp-init)
|
||||
(load quicklisp-init)))
|
||||
(ql:quickload :swank)
|
||||
|
||||
(let ((server-running nil))
|
||||
(defcommand swank () ()
|
||||
<x-color><param>#627e95</param>"Toggle the swank server on/off"</x-color>
|
||||
(<x-color><param>#93e57c</param>if</x-color> server-running
|
||||
(<x-color><param>#93e57c</param>progn</x-color>
|
||||
"Toggle the swank server on/off"
|
||||
(if server-running
|
||||
(progn
|
||||
(swank:stop-server 4005)
|
||||
(echo-string
|
||||
(current-screen)
|
||||
<x-color><param>#627e95</param>"Stopping swank."</x-color>)
|
||||
"Stopping swank.")
|
||||
(setf server-running nil))
|
||||
(<x-color><param>#93e57c</param>progn</x-color>
|
||||
(swank:create-server <x-color><param>#a3646f</param>:port</x-color> 4005
|
||||
<x-color><param>#a3646f</param>:style</x-color> swank:*communication-style*
|
||||
<x-color><param>#a3646f</param>:dont-close</x-color> t)
|
||||
(progn
|
||||
(swank:create-server :port 4005
|
||||
:style swank:*communication-style*
|
||||
:dont-close t)
|
||||
(echo-string
|
||||
(current-screen)
|
||||
<x-color><param>#627e95</param>"Starting swank. M-x slime-connect RET RET, then (in-packqage stumpwm)."</x-color>)
|
||||
"Starting swank. M-x slime-connect RET RET, then (in-packqage stumpwm).")
|
||||
(setf server-running t)))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; GENERAL CONFIG ;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; this is where configuration parameters, the frame numbering
|
||||
;; and switching, and other general configuration is set up.
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>#565766</param>
|
||||
</x-color>;;; <x-color><param>#565766</param>GENERAL CONFIG ;;;
|
||||
</x-color>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>#565766</param>
|
||||
</x-color>;; <x-color><param>#565766</param>this is where configuration parameters, the frame numbering
|
||||
</x-color>;; <x-color><param>#565766</param>and switching, and other general configuration is set up.
|
||||
</x-color>
|
||||
(<x-color><param>#93e57c</param>defparameter</x-color> <x-color><param>#9e79b3</param>*default-browser*</x-color> <x-color><param>#627e95</param>"firefox"</x-color>)
|
||||
(<x-color><param>#93e57c</param>defparameter</x-color> <x-color><param>#9e79b3</param>*default-terminal*</x-color> <x-color><param>#627e95</param>"mate-terminal"</x-color>)
|
||||
(defparameter *default-browser* "firefox")
|
||||
(defparameter *default-terminal* "mate-terminal")
|
||||
|
||||
;; <x-color><param>#565766</param>make frames 1-numbered (i.e. for getting with ALT-FN)
|
||||
</x-color>(setf *frame-number-map* <x-color><param>#627e95</param>"1234567890"</x-color>)
|
||||
;; make frames 1-numbered (i.e. for getting with ALT-FN)
|
||||
(setf *frame-number-map* "1234567890")
|
||||
|
||||
(run-commands
|
||||
<x-color><param>#627e95</param>"gnewbg G2"</x-color> ;; <x-color><param>#565766</param>F2
|
||||
</x-color> <x-color><param>#627e95</param>"gnewbg G3"</x-color> ;; <x-color><param>#565766</param>F3
|
||||
</x-color> <x-color><param>#627e95</param>"gnewbg G4"</x-color> ;; <x-color><param>#565766</param>F4
|
||||
</x-color> <x-color><param>#627e95</param>"gnewbg G5"</x-color> ;; <x-color><param>#565766</param>F5
|
||||
</x-color> <x-color><param>#627e95</param>"gnewbg G6"</x-color> ;; <x-color><param>#565766</param>F6
|
||||
</x-color> <x-color><param>#627e95</param>"gnewbg G7"</x-color> ;; <x-color><param>#565766</param>F7
|
||||
</x-color> <x-color><param>#627e95</param>"gnewbg G8"</x-color> ;; <x-color><param>#565766</param>F8
|
||||
</x-color> <x-color><param>#627e95</param>"gnewbg G9"</x-color> ;; <x-color><param>#565766</param>F9
|
||||
</x-color> <x-color><param>#627e95</param>"gnewbg G10"</x-color> ;; <x-color><param>#565766</param>F10
|
||||
</x-color> <x-color><param>#627e95</param>"gnewbg G11"</x-color> ;; <x-color><param>#565766</param>F11
|
||||
</x-color> <x-color><param>#627e95</param>"gnewbg G12"</x-color>
|
||||
<x-color><param>#627e95</param>"gnewbg G13"</x-color>
|
||||
<x-color><param>#627e95</param>"gnewbg G14"</x-color>
|
||||
<x-color><param>#627e95</param>"gnewbg G15"</x-color>
|
||||
"gnewbg G2" ;; F2
|
||||
"gnewbg G3" ;; F3
|
||||
"gnewbg G4" ;; F4
|
||||
"gnewbg G5" ;; F5
|
||||
"gnewbg G6" ;; F6
|
||||
"gnewbg G7" ;; F7
|
||||
"gnewbg G8" ;; F8
|
||||
"gnewbg G9" ;; F9
|
||||
"gnewbg G10" ;; F10
|
||||
"gnewbg G11" ;; F11
|
||||
"gnewbg G12"
|
||||
"gnewbg G13"
|
||||
"gnewbg G14"
|
||||
"gnewbg G15"
|
||||
"gnewbg G16"
|
||||
"gnewbg G17"
|
||||
"gnewbg G18"
|
||||
"gnewbg G19")
|
||||
|
||||
|
||||
<x-color><param>#627e95</param>"gnewbg G16"</x-color>
|
||||
<x-color><param>#627e95</param>"gnewbg G17"</x-color>
|
||||
<x-color><param>#627e95</param>"gnewbg G18"</x-color>
|
||||
<x-color><param>#627e95</param>"gnewbg G19"</x-color>)
|
||||
|
||||
|
||||
;; <x-color><param>#565766</param>Fluxbox-style Alt-F# virtual desktop (group in StumpWM-speak)
|
||||
</x-color>;; <x-color><param>#565766</param>switching. Modified from:
|
||||
</x-color>;; <x-color><param>#565766</param>http://hcl-club.lu/svn/development/lisp/.stumpwmrc
|
||||
</x-color>(<x-color><param>#93e57c</param>loop</x-color> for i from 1 to 9
|
||||
;; Fluxbox-style Alt-F# virtual desktop (group in StumpWM-speak)
|
||||
;; switching. Modified from:
|
||||
;; http://hcl-club.lu/svn/development/lisp/.stumpwmrc
|
||||
(loop for i from 1 to 9
|
||||
do
|
||||
(<x-color><param>#93e57c</param>progn</x-color>
|
||||
(format t <x-color><param>#627e95</param>"Key: ~A~%"</x-color> i)
|
||||
(progn
|
||||
(format t "Key: ~A~%" i)
|
||||
(define-key *top-map*
|
||||
(kbd (format nil <x-color><param>#627e95</param>"M-~a"</x-color> i))
|
||||
(format nil <x-color><param>#627e95</param>"gselect ~a"</x-color> i))))
|
||||
(kbd (format nil "M-~a" i))
|
||||
(format nil "gselect ~a" i))))
|
||||
|
||||
(define-key *top-map* (kbd <x-color><param>#627e95</param>"M-!"</x-color>) <x-color><param>#627e95</param>"gselect 10"</x-color>)
|
||||
(define-key *top-map* (kbd <x-color><param>#627e95</param>"M-@"</x-color>) <x-color><param>#627e95</param>"gselect 11"</x-color>)
|
||||
(define-key *top-map* (kbd <x-color><param>#627e95</param>"M-#"</x-color>) <x-color><param>#627e95</param>"gselect 12"</x-color>)
|
||||
(define-key *top-map* (kbd <x-color><param>#627e95</param>"M-$"</x-color>) <x-color><param>#627e95</param>"gselect 13"</x-color>)
|
||||
(define-key *top-map* (kbd <x-color><param>#627e95</param>"M-%"</x-color>) <x-color><param>#627e95</param>"gselect 14"</x-color>)
|
||||
(define-key *top-map* (kbd <x-color><param>#627e95</param>"M-^"</x-color>) <x-color><param>#627e95</param>"gselect 15"</x-color>)
|
||||
(define-key *top-map* (kbd <x-color><param>#627e95</param>"M-&"</x-color>) <x-color><param>#627e95</param>"gselect 16"</x-color>)
|
||||
(define-key *top-map* (kbd <x-color><param>#627e95</param>"M-*"</x-color>) <x-color><param>#627e95</param>"gselect 17"</x-color>)
|
||||
(define-key *top-map* (kbd <x-color><param>#627e95</param>"M-\("</x-color>) <x-color><param>#627e95</param>"gselect 18"</x-color>)
|
||||
(define-key *top-map* (kbd <x-color><param>#627e95</param>"M-\)"</x-color>) <x-color><param>#627e95</param>"gselect 19"</x-color>)
|
||||
(define-key *top-map* (kbd "M-!") "gselect 10")
|
||||
(define-key *top-map* (kbd "M-@") "gselect 11")
|
||||
(define-key *top-map* (kbd "M-#") "gselect 12")
|
||||
(define-key *top-map* (kbd "M-$") "gselect 13")
|
||||
(define-key *top-map* (kbd "M-%") "gselect 14")
|
||||
(define-key *top-map* (kbd "M-^") "gselect 15")
|
||||
(define-key *top-map* (kbd "M-&") "gselect 16")
|
||||
(define-key *top-map* (kbd "M-*") "gselect 17")
|
||||
(define-key *top-map* (kbd "M-\(") "gselect 18")
|
||||
(define-key *top-map* (kbd "M-\)") "gselect 19")
|
||||
|
||||
;; <x-color><param>#565766</param>set FFM
|
||||
</x-color>(setf *mouse-focus-policy* <x-color><param>#a3646f</param>:sloppy</x-color>)
|
||||
;; scale up the font
|
||||
(let ((font-size 22))
|
||||
(stumpwm:set-font
|
||||
(format nil "-*-*-bold-r-*-*-~D-240-*-*-*-*-*-*"
|
||||
font-size)))
|
||||
|
||||
;; <x-color><param>#565766</param>show input bar in centre of screen
|
||||
</x-color>(setf *input-window-gravity* <x-color><param>#a3646f</param>:center</x-color>)
|
||||
;; set FFM
|
||||
(setf *mouse-focus-policy* :sloppy)
|
||||
|
||||
;; show input bar in centre of screen
|
||||
(setf *input-window-gravity* :center)
|
||||
|
||||
;; <x-color><param>#565766</param>enable the mode-line (and preferably the system tray)
|
||||
;; enable the mode-line (and preferably the system tray)
|
||||
|
||||
</x-color>(setf *mode-line-position* <x-color><param>#a3646f</param>:bottom</x-color>)
|
||||
(setf *mode-line-position* :bottom)
|
||||
|
||||
(load-module <x-color><param>#627e95</param>"stumptray"</x-color>)
|
||||
|
||||
|
||||
(<x-color><param>#93e57c</param>dolist</x-color>
|
||||
;;(load-module "stumptray")
|
||||
|
||||
(dolist
|
||||
(head (screen-heads (current-screen)))
|
||||
|
||||
(toggle-mode-line (current-screen) head))
|
||||
|
||||
;; (stumptray::stumptray)
|
||||
|
||||
(stumptray::stumptray)
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; UTILITY FUNCTIONS ;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defvar *exec-base* #P "/usr/bin/")
|
||||
|
||||
(defvar *scratchpad* nil)
|
||||
(defcommand scratch-pad () ()
|
||||
"Create or destroy a new scratchpad group."
|
||||
(if *scratchpad*
|
||||
(progn
|
||||
(gselect *scratchpad*)
|
||||
(dolist (window (group-windows (current-group)))
|
||||
(delete-window window))
|
||||
(gkill)
|
||||
(setf *scratchpad* nil)
|
||||
(echo "nerfed scratchpad"))
|
||||
(progn
|
||||
(setf *scratchpad* (gnew "scratchpad"))
|
||||
(echo "scratchpad created"))))
|
||||
|
||||
(defvar *scratchpad-float* nil)
|
||||
(defcommand scratch-pad-float () ()
|
||||
"Create or destroy a new floating scratchpad group."
|
||||
(if *scratchpad-float*
|
||||
(progn
|
||||
(gselect *scratchpad-float*)
|
||||
(dolist (window (group-windows (current-group)))
|
||||
(delete-window window))
|
||||
(gkill)
|
||||
(setf *scratchpad-float* nil)
|
||||
(echo "nerfed floating scratchpad"))
|
||||
(progn
|
||||
(setf *scratchpad-float* (gnew "scratchpad-float"))
|
||||
(echo "floating scratchpad created"))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>#565766</param>
|
||||
</x-color>;;; <x-color><param>#565766</param>UTILITY FUNCTIONS ;;;
|
||||
</x-color>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>#565766</param>
|
||||
</x-color>
|
||||
(defcommand acpi-status () ()
|
||||
<x-color><param>#627e95</param>"Print ACPI status in the StumpWM message box."</x-color>
|
||||
"Print ACPI status in the StumpWM message box."
|
||||
(stumpwm:echo-string (current-screen)
|
||||
(<x-color><param>#93e57c</param>with-output-to-string</x-color> (stream)
|
||||
(with-output-to-string (stream)
|
||||
(sb-ext:run-program
|
||||
<x-color><param>#627e95</param>"/usr/bin/acpitool"</x-color>
|
||||
(format nil "~A/acpitool" *exec-base*)
|
||||
nil
|
||||
<x-color><param>#a3646f</param>:output</x-color> stream))))
|
||||
:output stream))))
|
||||
|
||||
(defun stumpwm-run-program (program)
|
||||
(sb-ext:run-program
|
||||
(format nil "~A/~A" *exec-base* program) nil))
|
||||
|
||||
(defcommand lock () ()
|
||||
<x-color><param>#627e95</param>"Lock the screen by invoking i3lock."</x-color>
|
||||
(stumpwm:echo-string (current-screen) <x-color><param>#627e95</param>"Locking screen..."</x-color>)
|
||||
(sb-ext:run-program <x-color><param>#627e95</param>"/usr/bin/i3lock"</x-color> nil))
|
||||
"Lock the screen by invoking xautolock."
|
||||
(stumpwm:echo-string (current-screen) "Locking screen...")
|
||||
(sb-ext:run-program
|
||||
(format nil "~A/~A" *exec-base* "xautolock") "-locknow" nil))
|
||||
|
||||
(<x-color><param>#93e57c</param>defun</x-color> <x-color><param>#beb7f7</param>exec-for-status</x-color> (path <x-color><param>#5992c2</param>&rest</x-color> args)
|
||||
<x-color><param>#565766</param>"Run the path with args and return the status code."</x-color>
|
||||
(defun exec-for-status (path &rest args)
|
||||
"Run the path with args and return the status code."
|
||||
(sb-ext:process-exit-code
|
||||
(sb-ext:run-program path args <x-color><param>#a3646f</param>:wait</x-color> t)))
|
||||
(sb-ext:run-program path args :wait t)))
|
||||
|
||||
(<x-color><param>#93e57c</param>defun</x-color> <x-color><param>#beb7f7</param>exec-ok</x-color> (path <x-color><param>#5992c2</param>&rest</x-color> args)
|
||||
<x-color><param>#565766</param>"Returns true if path with args ran without error."</x-color>
|
||||
(defun exec-ok (path &rest args)
|
||||
"Returns true if path with args ran without error."
|
||||
(zerop (exec-for-status path args)))
|
||||
|
||||
(<x-color><param>#93e57c</param>defun</x-color> <x-color><param>#beb7f7</param>daemon-is-running</x-color> (daemon)
|
||||
(zerop (exec-for-status <x-color><param>#627e95</param>"/usr/bin/pgrep"</x-color> daemon)))
|
||||
(defun daemon-is-running (daemon)
|
||||
(zerop (exec-for-status "/usr/bin/pgrep" daemon)))
|
||||
|
||||
(<x-color><param>#93e57c</param>defun</x-color> <x-color><param>#beb7f7</param>start-daemon-if-not-running</x-color> (path <x-color><param>#5992c2</param>&rest</x-color> args)
|
||||
<x-color><param>#565766</param>"If the program specified at path isn't running, start it."</x-color>
|
||||
(<x-color><param>#93e57c</param>when</x-color> (not (daemon-is-running (pathname-name path)))
|
||||
(run-shell-command (<x-color><param>#93e57c</param>if</x-color> (null args)
|
||||
(defun start-daemon-if-not-running (path &rest args)
|
||||
"If the program specified at path isn't running, start it."
|
||||
(when (not (daemon-is-running (pathname-name path)))
|
||||
(run-shell-command (if (null args)
|
||||
path
|
||||
(format nil <x-color><param>#627e95</param>"~A~{ ~A~}"</x-color> path args)))))
|
||||
(format nil "~A~{ ~A~}" path args)))))
|
||||
|
||||
(<x-color><param>#93e57c</param>defun</x-color> <x-color><param>#beb7f7</param>start-program-if-not-running</x-color> (program <x-color><param>#5992c2</param>&rest</x-color> args)
|
||||
(format t <x-color><param>#627e95</param>"WOULD RUN: nohup ~A~{ ~A~}"</x-color> program args)
|
||||
(<x-color><param>#93e57c</param>when</x-color> (not (exec-ok <x-color><param>#627e95</param>"/usr/bin/pgrep"</x-color> program))
|
||||
(run-shell-command (format nil <x-color><param>#627e95</param>"nohup ~A~{ ~A~}"</x-color>
|
||||
(defun start-program-if-not-running (program &rest args)
|
||||
(format t "WOULD RUN: nohup ~A~{ ~A~}" program args)
|
||||
(when (not (exec-ok "/usr/bin/pgrep" program))
|
||||
(run-shell-command (format nil "nohup ~A~{ ~A~}"
|
||||
program args))))
|
||||
|
||||
(<x-color><param>#93e57c</param>defun</x-color> <x-color><param>#beb7f7</param>with-terminal</x-color> (<x-color><param>#5992c2</param>&key</x-color> (run <x-color><param>#627e95</param>""</x-color> run-p) (term *default-terminal*))
|
||||
(concat <x-color><param>#627e95</param>"exec "</x-color> term (<x-color><param>#93e57c</param>if</x-color> run-p <x-color><param>#627e95</param>" -e "</x-color> <x-color><param>#627e95</param>""</x-color>) run))
|
||||
(defun with-terminal (&key (run "" run-p) (term *default-terminal*))
|
||||
(concat "exec " term (if run-p " -e " "") run))
|
||||
|
||||
(<x-color><param>#93e57c</param>defun</x-color> <x-color><param>#beb7f7</param>with-homedir</x-color> (path)
|
||||
(defun with-homedir (path)
|
||||
(merge-pathnames path (user-homedir-pathname)))
|
||||
|
||||
(<x-color><param>#93e57c</param>defun</x-color> <x-color><param>#beb7f7</param>in-homedir-p</x-color> (path)
|
||||
(probe-file (<x-color><param>#93e57c</param>with-homedir</x-color> path)))
|
||||
(defun in-homedir-p (path)
|
||||
(probe-file (with-homedir path)))
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>#565766</param>
|
||||
</x-color>;;; <x-color><param>#565766</param>DEMON^WKEY BINDING ;;;
|
||||
</x-color>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>#565766</param>
|
||||
</x-color>
|
||||
(define-key stumpwm:*root-map* (kbd <x-color><param>#627e95</param>"B"</x-color>) <x-color><param>#627e95</param>"exec firefox"</x-color>)
|
||||
(define-key stumpwm:*root-map* (kbd <x-color><param>#627e95</param>"c"</x-color>) (<x-color><param>#93e57c</param>with-terminal</x-color>))
|
||||
(define-key *root-map* (kbd <x-color><param>#627e95</param>"b"</x-color>) <x-color><param>#627e95</param>"acpi-status"</x-color>)
|
||||
(define-key *root-map* (kbd <x-color><param>#627e95</param>"RET"</x-color>) (<x-color><param>#93e57c</param>with-terminal</x-color>))
|
||||
(define-key *root-map* (kbd <x-color><param>#627e95</param>"d"</x-color>) <x-color><param>#627e95</param>"exec dmenu_run"</x-color>)
|
||||
(define-key *root-map* (kbd <x-color><param>#627e95</param>"D"</x-color>) <x-color><param>#627e95</param>"exec i3-dmenu-desktop"</x-color>)
|
||||
(define-key *root-map* (kbd <x-color><param>#627e95</param>"e"</x-color>) <x-color><param>#627e95</param>"exec emacsclient -c -a \"\""</x-color>)
|
||||
(define-key *root-map* (kbd <x-color><param>#627e95</param>"E"</x-color>) (<x-color><param>#93e57c</param>with-terminal</x-color> <x-color><param>#a3646f</param>:run</x-color> <x-color><param>#627e95</param>"'emacsclient -c -nw -a \"\"'"</x-color>))
|
||||
(define-key *root-map* (kbd <x-color><param>#627e95</param>"g"</x-color>) (<x-color><param>#93e57c</param>with-terminal</x-color> <x-color><param>#a3646f</param>:run</x-color> <x-color><param>#627e95</param>"ghci"</x-color>))
|
||||
(define-key *root-map* (kbd <x-color><param>#627e95</param>"C-i"</x-color>) (<x-color><param>#93e57c</param>with-terminal</x-color> <x-color><param>#a3646f</param>:run</x-color> <x-color><param>#627e95</param>"ipython"</x-color>))
|
||||
(define-key *root-map* (kbd <x-color><param>#627e95</param>"l"</x-color>) <x-color><param>#627e95</param>"lock"</x-color>)
|
||||
(define-key *root-map* (kbd <x-color><param>#627e95</param>"C-l"</x-color>) (<x-color><param>#93e57c</param>with-terminal</x-color> <x-color><param>#a3646f</param>:run</x-color> <x-color><param>#627e95</param>"rlwrap sbcl"</x-color>))
|
||||
(<x-color><param>Purple</param>define-key</x-color> *root-map* (kbd <x-color><param>VioletRed4</param>"M"</x-color>) (<x-color><param>Purple</param>with-terminal</x-color> <x-color><param>dark slate blue</param>:run</x-color> <x-color><param>VioletRed4</param>"htop"</x-color>))
|
||||
(<x-color><param>Purple</param>define-key</x-color> *root-map* (kbd <x-color><param>VioletRed4</param>"C-s"</x-color>) <x-color><param>VioletRed4</param>"swank"</x-color>)
|
||||
(<x-color><param>Purple</param>define-key</x-color> *root-map* (kbd <x-color><param>VioletRed4</param>"C-v"</x-color>) <x-color><param>VioletRed4</param>"exec pavucontrol"</x-color>)
|
||||
(<x-color><param>Purple</param>define-key</x-color> *root-map* (kbd <x-color><param>VioletRed4</param>"w"</x-color>) (<x-color><param>Purple</param>with-terminal</x-color> <x-color><param>dark slate blue</param>:run</x-color> <x-color><param>VioletRed4</param>"nmtui-connect"</x-color>))
|
||||
(<x-color><param>Purple</param>define-key</x-color> *root-map* (kbd <x-color><param>VioletRed4</param>"`"</x-color>) <x-color><param>VioletRed4</param>"scratch-pad"</x-color>)
|
||||
(<x-color><param>Purple</param>define-key</x-color> *root-map* (kbd <x-color><param>VioletRed4</param>"~"</x-color>) <x-color><param>VioletRed4</param>"scratch-pad-float"</x-color>)
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; DEMON^WKEY BINDING ;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>Firebrick</param>
|
||||
</x-color>;;; <x-color><param>Firebrick</param>EXECUTION ;;;
|
||||
</x-color>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>Firebrick</param>
|
||||
</x-color>
|
||||
(run-shell-command <x-color><param>VioletRed4</param>"ssh-add"</x-color>)
|
||||
(define-key stumpwm:*root-map* (kbd "B") "exec firefox")
|
||||
(define-key stumpwm:*root-map* (kbd "c") (with-terminal))
|
||||
(define-key *root-map* (kbd "b") "acpi-status")
|
||||
(define-key *root-map* (kbd "RET") (with-terminal))
|
||||
(define-key *root-map* (kbd "d") "exec dmenu_run")
|
||||
(define-key *root-map* (kbd "D") "exec i3-dmenu-desktop")
|
||||
(define-key *root-map* (kbd "e") "exec emacsclient -c -a \"\"")
|
||||
(define-key *root-map* (kbd "E") (with-terminal :run "'emacsclient -c -nw -a \"\"'"))
|
||||
(define-key *root-map* (kbd "g") (with-terminal :run "ghci"))
|
||||
(define-key *root-map* (kbd "C-i") (with-terminal :run "ipython"))
|
||||
(define-key *root-map* (kbd "l") "exec i3lock")
|
||||
(define-key *root-map* (kbd "C-l") (with-terminal :run "rlwrap sbcl"))
|
||||
(define-key *root-map* (kbd "M") (with-terminal :run "htop"))
|
||||
(define-key *root-map* (kbd "C-s") "swank")
|
||||
(define-key *root-map* (kbd "C-v") "exec pavucontrol")
|
||||
(define-key *root-map* (kbd "w") (with-terminal :run "nmtui-connect"))
|
||||
(define-key *root-map* (kbd "`") "scratch-pad")
|
||||
(define-key *root-map* (kbd "~") "scratch-pad-float")
|
||||
|
||||
(<x-color><param>Purple</param>when</x-color> (in-homedir-p <x-color><param>VioletRed4</param>".fehbg"</x-color>)
|
||||
(sb-ext:run-program <x-color><param>VioletRed4</param>"/bin/sh"</x-color> (<x-color><param>Purple</param>with-homedir</x-color> <x-color><param>VioletRed4</param>".fehbg"</x-color>)))
|
||||
(<x-color><param>Purple</param>when</x-color> (in-homedir-p <x-color><param>VioletRed4</param>".screenlayouts/norminal.sh"</x-color>)
|
||||
(run-shell-command (<x-color><param>Purple</param>with-homedir</x-color> <x-color><param>VioletRed4</param>".screenlayouts/norminal.sh"</x-color>)))
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; EXECUTION ;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>Firebrick</param>
|
||||
</x-color>;;; <x-color><param>Firebrick</param>THIS BATTLESTATION IS FULLY OPERATIONAL ;;;
|
||||
</x-color>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<x-color><param>Firebrick</param>
|
||||
</x-color>(message <x-color><param>VioletRed4</param>"Ready."</x-color>)
|
||||
(run-shell-command "ssh-add")
|
||||
|
||||
;;<x-color><param>Firebrick</param>LISP=sbcl
|
||||
</x-color>
|
||||
(when (in-homedir-p ".fehbg")
|
||||
(sb-ext:run-program "/bin/sh" (with-homedir ".fehbg")))
|
||||
(when (in-homedir-p ".screenlayouts/norminal.sh")
|
||||
(run-shell-command (with-homedir ".screenlayouts/norminal.sh")))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; THIS BATTLESTATION IS FULLY OPERATIONAL ;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(message "Ready.")
|
||||
|
||||
;;LISP=sbcl
|
||||
|
|
Loading…
Reference in New Issue