summaryrefslogtreecommitdiffstats
path: root/Desktop.org
blob: e50ef7758fadf56162df220e8e08d77bae47db1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
#+title: EXW Configuration
#+author: jdlugosz963
#+PROPERTY: header-args:emacs-lisp :tangle .config/emacs/exwm/desktop.el


* EXWM
** Config

#+begin_src emacs-lisp

  (defun jd/exwm-update-class ()
    (exwm-workspace-rename-buffer exwm-class-name))

  (defun jd-exwm/run-in-background (command)
    (let ((command-parts (split-string command "[ ]+")))
      (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))

  (defun jd-exwm/exwm-init-hook ()
    (display-battery-mode t)
    (display-time-mode t)

    (jd-exwm/run-in-background "nm-applet")
    (jd-exwm/run-in-background "pasystray")
    (jd-exwm/run-in-background "blueman-applet"))

  (defun jd-exwm/exwm-update-title ()
    (exwm-workspace-rename-buffer exwm-title))

  (defun jd-exwm/configure-window-by-class ()
    (interactive)
    (pcase exwm-class-name
      ("firefox" (exwm-workspace-move-window 2))
      ("qutebrowser" (exwm-workspace-move-window 2))
      ("discord" (exwm-workspace-move-window 5))
      ("obs" (exwm-workspace-move-window 5))
      ("Virt-manager" (exwm-workspace-move-window 4))))

  (use-package exwm
    :config
    (setq exwm-workspace-number 9)

    (add-hook 'exwm-init-hook #'jd-exwm/exwm-init-hook)
    (add-hook 'exwm-update-class-hook #'jd/exwm-update-class)
    (add-hook 'exwm-update-title-hook #'jd-exwm/exwm-update-title)
    (add-hook 'exwm-manage-finish-hook #'jd-exwm/configure-window-by-class)

    (start-process-shell-command "xmodmap" nil "xmodmap ~/dotfiles/.Xmodmap")
    (start-process-shell-command "nitrogen" nil "nitrogen --restore")
    (start-process-shell-command "xinput" nil "xinput set-prop 11 336 1")

    (require 'exwm-randr)
    (exwm-randr-enable)
    ;; (start-process-shell-command "xrandr" nil "xrandr --output DP-1-8 --primary --mode 1920x1080 --output eDP-1 --off")

    (require 'exwm-systemtray)
    (exwm-systemtray-enable)

    (setq exwm-input-simulation-keys
          '(([?\C-l] . [left])
            ([?\C-h] . [right])
            ([?\C-k] . [up])
            ([?\C-j] . [down])))

    (setq exwm-input-prefix-keys
          '(?\C-x
            ?\C-u
            ?\C-h
            ?\M-x
            ?\M-`
            ?\M-&
            ?\M-:
            ?\C-\M-j 
            ?\C-\ ))  

    (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
    (exwm-input-set-key (kbd "s-p") 'counsel-linux-app)

    (setq exwm-input-global-keys
          `(([?\s-R] . exwm-reset)


            ([?\s-r] . (lambda (command)
                         (interactive (list (read-shell-command "$ ")))
                         (start-process-shell-command command nil command)))

            ([?\s-W] . exwm-workspace-move-window)
            ([?\s-w] . exwm-workspace-switch)

            ,@(mapcar (lambda (i)
                        `(,(kbd (format "s-%d" i)) .
                          (lambda ()
                            (interactive)
                            (exwm-workspace-switch-create ,i))))
                      (number-sequence 1 9))))

    (exwm-enable))

#+end_src
** Desktop mode

#+begin_src emacs-lisp

  (use-package desktop-environment
    :after exwm
    :config (desktop-environment-mode)
    :custom
    (desktop-environment-brightness-small-increment "2%+")
    (desktop-environment-brightness-small-decrement "2%-")
    (desktop-environment-brightness-normal-increment "5%+")
    (desktop-environment-brightness-normal-decrement "5%-"))

#+end_src

** Transparency

#+begin_src emacs-lisp

  (set-frame-parameter (selected-frame) 'alpha '(95 . 95))
  (add-to-list 'default-frame-alist `(alpha . (95 . 95)))
  (set-frame-parameter (selected-frame) 'fullscreen 'maximized)
  (add-to-list 'default-frame-alist '(fullscreen . maximized))

#+end_src

** Start emacs

#+begin_src sh :tangle ~/.config/emacs/exwm/start.sh
  #!/bin/sh

  picom &

  xss-lock -- slock &

  export VISUAL=emacsclient
  export EDITOR="$VISUAL"

  exec dbus-launch --exit-with-session emacs -mm --debug-init -l ~/.config/emacs/exwm/desktop.el

#+end_src


* Applications
** Flatpak

*Applications to Install*

#+begin_src sh

flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user flathub com.spotify.Client
flatpak install --user flathub com.valvesoftware.Steam
flatpak install --user flathub com.microsoft.Teams
flatpak install --user flathub com.discordapp.Discord

#+end_src

*Guix Packages*

#+begin_src scheme :noweb-ref packages :noweb-sep ""

"flatpak"

#+end_src

** Audio control

*Guix Packages*

#+begin_src scheme :noweb-ref packages :noweb-sep ""

"pulsemixer"

#+end_src

** Bluetooth

*Guix Packages*

#+begin_src scheme :noweb-ref packages :noweb-sep ""

  "blueman"

#+end_src

** Xorg

*Xmodmap*

#+begin_src sh :tangle .Xmodmap

clear lock
keycode 0x42 = Escape

#+end_src

*Guix Packages*

#+begin_src scheme :noweb-ref packages :noweb-sep ""

  "xev"
  "xset"
  "xrdb"
  "xhost"
  "xmodmap"
  "setxkbmap"
  "xrandr"
  "arandr"
  "xss-lock"
  "libinput"
  "xinput"

#+end_src

** Desktop Profile

#+begin_src scheme :tangle .config/guix/manifests/desktop.scm :noweb yes

(specifications->manifest
 '(
   <<packages>>
))

#+end_src