summaryrefslogtreecommitdiffstats
path: root/files
diff options
context:
space:
mode:
authorjdlugosz963 <jdlugosz963@gmail.com>2024-09-20 14:16:56 +0200
committerjdlugosz963 <jdlugosz963@gmail.com>2024-09-20 14:16:56 +0200
commit45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a (patch)
treeb564c1c43920def6641cd482a7b4dca453dbc043 /files
parent07dd8e37eb767c3dd6abf63e5e4a720cd778da15 (diff)
downloaddotfiles-45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a.tar.gz
dotfiles-45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a.zip
Change dotfiles structure, and add guix-channels declaration.
Diffstat (limited to 'files')
-rw-r--r--files/.Xmodmap2
-rw-r--r--files/.bash_profile17
-rwxr-xr-xfiles/.bin/arduino-cli14
-rwxr-xr-xfiles/.bin/chiaki21
-rwxr-xr-xfiles/.bin/clean.sh3
-rwxr-xr-xfiles/.bin/download_music.sh26
-rwxr-xr-xfiles/.bin/esp_upload.sh6
-rwxr-xr-xfiles/.bin/file_upload.sh38
-rwxr-xr-xfiles/.bin/guix-container8
-rwxr-xr-xfiles/.bin/home-reconfigure3
-rw-r--r--files/.bin/jd-arduino-cli.Dockerfile16
-rwxr-xr-xfiles/.bin/mount-nas-abaks1
-rwxr-xr-xfiles/.bin/oath14
-rwxr-xr-xfiles/.bin/profile-add-all9
-rwxr-xr-xfiles/.bin/stumpish196
-rwxr-xr-xfiles/.bin/system-reconfigure3
-rwxr-xr-xfiles/.bin/update.sh4
-rwxr-xr-xfiles/.bin/whois-at-hsp84
-rw-r--r--files/.config/alacritty/alacritty.toml46
-rw-r--r--files/.config/alacritty/alacritty.toml.old23
-rw-r--r--files/.config/alacritty/alacritty.yaml27
-rw-r--r--files/.config/common-lisp/source-registry.conf.d/50-user-lisp.conf1
-rw-r--r--files/.config/dunst/dunstrc177
-rw-r--r--files/.config/guix/.gitignore1
-rwxr-xr-xfiles/.config/guix/channels.scm19
-rw-r--r--files/.config/guix/shell-authorized-directories10
-rw-r--r--files/.config/picom/picom.conf117
-rw-r--r--files/.config/polybar/config.ini122
-rwxr-xr-xfiles/.config/qtile/autorc31
-rw-r--r--files/.config/qtile/config.py232
-rwxr-xr-xfiles/.config/qtile/mdt_shell1
-rw-r--r--files/.config/qtile/photos/desktop.pngbin0 -> 1555228 bytes
-rw-r--r--files/.config/qtile/python.pngbin0 -> 52166 bytes
-rw-r--r--files/.config/qtile/readme.org5
-rw-r--r--files/.config/sway/config195
-rw-r--r--files/.config/waybar/config159
-rw-r--r--files/.config/waybar/style.css205
-rw-r--r--files/.emacs.d/.gitignore5
-rwxr-xr-xfiles/.emacs.d/init.el146
-rwxr-xr-xfiles/.emacs.d/jd/jd-apps.el49
-rwxr-xr-xfiles/.emacs.d/jd/jd-custom.el33
-rwxr-xr-xfiles/.emacs.d/jd/jd-dev.el177
-rwxr-xr-xfiles/.emacs.d/jd/jd-exwm.el177
-rwxr-xr-xfiles/.emacs.d/jd/jd-gym.el120
-rwxr-xr-xfiles/.emacs.d/jd/jd-keys.el49
-rw-r--r--files/.emacs.d/jd/jd-misc.el34
-rwxr-xr-xfiles/.emacs.d/jd/jd-mu4e.el84
-rwxr-xr-xfiles/.emacs.d/jd/jd-org.el224
-rw-r--r--files/.emacs.d/jd/jd-sway.el18
-rwxr-xr-xfiles/.emacs.d/jd/jd-ui.el104
-rw-r--r--files/.gitignore7
-rw-r--r--files/.guile2
-rw-r--r--files/.mbsyncrc47
-rw-r--r--files/.nix-channels1
-rw-r--r--files/.stumpwm.d/.gitignore1
-rwxr-xr-xfiles/.stumpwm.d/init.lisp360
56 files changed, 3474 insertions, 0 deletions
diff --git a/files/.Xmodmap b/files/.Xmodmap
new file mode 100644
index 0000000..cb4706f
--- /dev/null
+++ b/files/.Xmodmap
@@ -0,0 +1,2 @@
1clear lock
2keycode 0x42 = Escape
diff --git a/files/.bash_profile b/files/.bash_profile
new file mode 100644
index 0000000..14802fe
--- /dev/null
+++ b/files/.bash_profile
@@ -0,0 +1,17 @@
1# Honor per-interactive-shell startup file
2if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
3
4export GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles
5
6for i in $GUIX_EXTRA_PROFILES/*; do
7 profile=$i/$(basename "$i")
8 if [ -f "$profile"/etc/profile ]; then
9 GUIX_PROFILE="$profile"
10 . "$GUIX_PROFILE"/etc/profile
11 fi
12 unset profile
13done
14
15export NIX_PATH=~/.nix-defexpr/channels/nixos/
16
17. .profile
diff --git a/files/.bin/arduino-cli b/files/.bin/arduino-cli
new file mode 100755
index 0000000..7c0d41a
--- /dev/null
+++ b/files/.bin/arduino-cli
@@ -0,0 +1,14 @@
1#!/bin/sh
2
3SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
4
5if [[ $(docker images | grep jd-arduino-cli | wc -l) -eq 0 ]]
6then
7 docker build -f "$SCRIPT_DIR/jd-arduino-cli.Dockerfile" -t jd-arduino-cli .
8fi
9
10docker run --rm --network none -it --privileged \
11 -v $(pwd):/src \
12 -v jd-arduino-cli-tmp:/tmp \
13 -v /dev:/dev jd-arduino-cli \
14 arduino-cli $@
diff --git a/files/.bin/chiaki b/files/.bin/chiaki
new file mode 100755
index 0000000..5fa6547
--- /dev/null
+++ b/files/.bin/chiaki
@@ -0,0 +1,21 @@
1#!/bin/sh
2
3CHIAKI_SHELL=/tmp/.chiaki.nix
4
5cat <<EOF > $CHIAKI_SHELL
6let
7 nixgl = import (fetchTarball https://github.com/guibou/nixGL/archive/main.tar.gz) { };
8in
9{ nixpkgs ? import <nixpkgs> {} }:
10with nixpkgs; mkShell {
11 buildInputs = [
12 chiaki
13 nixgl.auto.nixGLDefault
14 ];
15 shellHook = ''
16 nixGL chiaki && exit;
17 '';
18}
19EOF
20
21nix-shell $CHIAKI_SHELL
diff --git a/files/.bin/clean.sh b/files/.bin/clean.sh
new file mode 100755
index 0000000..3e6bbfd
--- /dev/null
+++ b/files/.bin/clean.sh
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3sudo emerge --ask --depclean;
diff --git a/files/.bin/download_music.sh b/files/.bin/download_music.sh
new file mode 100755
index 0000000..e3a3601
--- /dev/null
+++ b/files/.bin/download_music.sh
@@ -0,0 +1,26 @@
1#!/bin/sh
2
3BOLD="\e[1";
4ENDCOLOR="\e[0m";
5Green="32";
6LightRed="31";
7
8if ! [ $1 ]; then
9 echo ""
10 echo -e $BOLD";"";"$LightRed"m Please provide music url!"$ENDCOLOR
11 echo ""
12 exit
13fi
14
15MUSIC_DIR="~/Documents/Music/%(artist)s/%(album)s/%(title)s-%(id)s.%(ext)s"
16if [ $2 ]; then
17 MUSIC_DIR="${a}/%(artist)s/%(album)s/%(title)s-%(id)s.%(ext)s"
18fi
19
20echo ""
21echo -e $BOLD";"";"$Green"m Music will download to ${MUSIC_DIR} directory!"$ENDCOLOR
22echo ""
23
24sleep 1
25
26yt-dlp -x --audio-format mp3 --embed-metadata -o $MUSIC_DIR $1
diff --git a/files/.bin/esp_upload.sh b/files/.bin/esp_upload.sh
new file mode 100755
index 0000000..27d8d41
--- /dev/null
+++ b/files/.bin/esp_upload.sh
@@ -0,0 +1,6 @@
1#!/bin/sh
2
3# rm /tmp/arduino-sketch-*/ -r
4~/.local/bin/arduino-cli cache clean
5~/.local/bin/arduino-cli compile --fqbn esp8266:esp8266:nodemcuv2
6~/.local/bin/arduino-cli upload -p /dev/ttyUSB0 --fqbn esp8266:esp8266:nodemcuv2
diff --git a/files/.bin/file_upload.sh b/files/.bin/file_upload.sh
new file mode 100755
index 0000000..0ff6c57
--- /dev/null
+++ b/files/.bin/file_upload.sh
@@ -0,0 +1,38 @@
1#!/bin/sh
2
3BOLD="\e[1";
4ENDCOLOR="\e[0m";
5Green="32m";
6LightRed="31m";
7
8echo ""
9echo -e $BOLD";"";"$Green" FILE UPLOADER"$ENDCOLOR
10echo ""
11
12if ! [ $1 ]; then
13 echo ""
14 echo -e $BOLD";"";"$LightRed" Please provide file path!"$ENDCOLOR
15 echo ""
16 exit
17fi
18
19if [ $1 ]; then
20 echo -e " Are u sure u want upload this file: "$BOLD";"";"$Green" '$1'"$ENDCOLOR"? [y/N]: "
21 read -p " " input
22 echo ""
23 # read -r -p " " input
24 case $input in
25 [yY][eE][sS]|[yY])
26 URL=$(curl -s -F "file=@$1" https://0x0.st);
27 echo -e " URL: "$BOLD";"";"$Green"$URL"$ENDCOLOR;
28 ;;
29 [nN][oO]|[nN])
30 echo -e $BOLD";"";"$Green" OK"$ENDCOLOR;
31 ;;
32 *)
33 echo -e $BOLD";"";"$LightRed" Invalid input..."$ENDCOLOR;
34 exit 1
35 ;;
36 esac
37 echo ""
38fi;
diff --git a/files/.bin/guix-container b/files/.bin/guix-container
new file mode 100755
index 0000000..162eda0
--- /dev/null
+++ b/files/.bin/guix-container
@@ -0,0 +1,8 @@
1#!/bin/sh
2
3guix shell -C -F -N \
4 -E XDG_RUNTIME_DIR=/tmp \
5 -E WAYLAND_DISPLAY \
6 -E DISPLAY \
7 --share=$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY=/tmp/$WAYLAND_DISPLAY \
8 $@ coreutils
diff --git a/files/.bin/home-reconfigure b/files/.bin/home-reconfigure
new file mode 100755
index 0000000..f3a4e5f
--- /dev/null
+++ b/files/.bin/home-reconfigure
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3JD_HOME=1 guix home -L $HOME/dotfiles/guix reconfigure $HOME/dotfiles/guix/jd/desktops/$(hostname).scm
diff --git a/files/.bin/jd-arduino-cli.Dockerfile b/files/.bin/jd-arduino-cli.Dockerfile
new file mode 100644
index 0000000..cb8eb91
--- /dev/null
+++ b/files/.bin/jd-arduino-cli.Dockerfile
@@ -0,0 +1,16 @@
1FROM python:3.12-rc-slim
2
3RUN apt update && apt install -y wget && \
4 wget https://downloads.arduino.cc/arduino-cli/nightly/arduino-cli_nightly-latest_Linux_64bit.tar.gz && \
5 tar -C /usr/bin/ -xf arduino-cli_nightly-latest_Linux_64bit.tar.gz
6
7RUN mkdir ~/.arduino15 && \
8 echo "board_manager:" > ~/.arduino15/arduino-cli.yaml && \
9 echo " additional_urls:" >> ~/.arduino15/arduino-cli.yaml && \
10 echo " - http://arduino.esp8266.com/stable/package_esp8266com_index.json" >> ~/.arduino15/arduino-cli.yaml
11
12
13RUN arduino-cli core update-index && \
14 arduino-cli core install esp8266:esp8266
15
16WORKDIR /src \ No newline at end of file
diff --git a/files/.bin/mount-nas-abaks b/files/.bin/mount-nas-abaks
new file mode 100755
index 0000000..6c14817
--- /dev/null
+++ b/files/.bin/mount-nas-abaks
@@ -0,0 +1 @@
sudo mount -t cifs -o vers=2.0,username=kdlugosz,password=$(pass nas/abaks/kdlugosz) //195.74.91.28/kdlugosz /mnt \ No newline at end of file
diff --git a/files/.bin/oath b/files/.bin/oath
new file mode 100755
index 0000000..7444993
--- /dev/null
+++ b/files/.bin/oath
@@ -0,0 +1,14 @@
1#!/bin/sh
2
3if [[ $1 ]]; then
4 PASS=$(oathtool -b --totp $(pass show "oath/$1"))
5 printf $PASS | wl-copy
6 echo "pass: $PASS"
7 echo "Password should be in your clipboard!"
8else
9 echo "Usage: oath <pass>"
10 echo "Available pass:"
11 pass oath
12fi
13
14
diff --git a/files/.bin/profile-add-all b/files/.bin/profile-add-all
new file mode 100755
index 0000000..bca4178
--- /dev/null
+++ b/files/.bin/profile-add-all
@@ -0,0 +1,9 @@
1#!/bin/sh
2
3GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles
4for i in $HOME/.config/guix/manifests/*; do
5 echo $i
6 MANIFEST_NAME=$(basename $i .scm)
7 mkdir -p "$GUIX_EXTRA_PROFILES"/"$MANIFEST_NAME"
8 guix package --manifest=$i --profile="$GUIX_EXTRA_PROFILES/$MANIFEST_NAME/$MANIFEST_NAME"
9done
diff --git a/files/.bin/stumpish b/files/.bin/stumpish
new file mode 100755
index 0000000..9e95c0c
--- /dev/null
+++ b/files/.bin/stumpish
@@ -0,0 +1,196 @@
1#!/bin/sh
2
3# Copyright (C) 2007 Jonathan Moore Liles
4#
5# Maintainer: Jonathan Moore Liles
6#
7# stumpish is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2, or (at your option)
10# any later version.
11#
12# stumpish is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this software; see the file COPYING. If not, see
19# <http://www.gnu.org/licenses/>.
20
21### STUMPwm Interactive SHell.
22
23DELAY=0.01
24
25if ! sleep $DELAY 2>/dev/null >&2
26then
27 DELAY=1
28fi
29
30# replace -E with -r option for old versions of GNU sed
31if ! sed -E 1p /dev/null 2>/dev/null; then
32 sed() { shift; command sed -r "$@"; }
33fi
34
35# parse C-style backslash sequences by default
36if [ "$(echo -e foo)" = foo ]; then
37 echo() { builtin echo -e "$@"; }
38fi
39
40wait_result ()
41{
42 while true
43 do
44 RESULT=$(xprop -root -f STUMPWM_COMMAND_RESULT 8s \
45 STUMPWM_COMMAND_RESULT 2>/dev/null |
46 sed -E 's/\\([[:digit:]]+)/\\0\1/g')
47 if echo "$RESULT" | grep -v -q 'not found.$'
48 then
49 break
50 fi
51
52 sleep $DELAY
53 done
54
55 xprop -root -remove STUMPWM_COMMAND_RESULT
56
57 if echo "$RESULT" | grep -q '= $'
58 then
59 return 0
60 fi
61
62 echo "$RESULT" |
63 sed -E 's/[^"\\n]+"//
64 /^"[[:space:]]*$/d
65 s/(^|[^\\])\\n/\1\
66/g
67 s/\\(["\\n])/\1/g
68 s/\^([*[:digit:]]+|[Bbn])//g'
69}
70
71send_cmd ()
72{
73 local cmd="$1"
74
75 if [ "$cmd" = "stumpwm-quit" ]
76 then
77 cmd=quit
78 elif [ "$cmd" = "quit" ]
79 then
80 exit
81 fi
82
83 xprop -root -f STUMPWM_COMMAND 8s -set STUMPWM_COMMAND "$cmd"
84
85 wait_result
86}
87
88usage ()
89{
90 cat <<EOF
91Usage: ${0##*/} [[-e|-r] command [args...]]
92
93StumpIsh is the StumpWM shell. Use it to interact a running StumpWM
94instance. When run from a terminal with no arguments, stumpish
95accepts commands interactively and prints each result. If standard
96input is a pipe, stumpish executes any number of commands and prints
97the concatenated results. If the '-e' option and one argument are
98given on the command line, stumpish reads any number of lines from
99standard input and uses them as the argument to the named command.
100Otherwise, if one or more arguments are provided on the command line,
101the first is considered the name of the command to execute and the
102remainder is concatenated to form the argument.
103
104Example:
105 echo '(group-windows (current-group))' | ${0##*/} -e eval
106EOF
107 exit 0;
108}
109
110warn ()
111{
112 {
113 tput md bold
114 tput AF setaf 1
115 echo 'WARN:\c'
116 tput me sgr0
117 echo " $*"
118 } >&2
119}
120
121tput ()
122{
123 local cap1=$1 cap2=$2
124 shift 2
125
126 command tput $cap1 $@ 2>/dev/null ||
127 command tput $cap2 $@ 2>/dev/null
128}
129
130READLINE=yes
131
132if [ "x$1" = "x-r" ]
133then
134 READLINE=no
135 shift 1
136fi
137
138if [ $# -gt 0 ]
139then
140 [ "$1" = "--help" ] && usage
141 if [ "$1" = "-e" ]
142 then
143 if [ $# -ne 2 ]
144 then
145 echo "'-e' requires exactly one argument!"
146 exit
147 fi
148 shift 1
149 IFS=''
150 ARGS=$(cat /dev/stdin)
151 send_cmd "$1 $ARGS"
152 else
153 IFS=' '
154 send_cmd "$*"
155 fi
156else
157 if [ -t 0 ]
158 then
159 if ! type rlwrap 2>/dev/null >&2
160 then
161 warn rlwrap not found, command completion won\'t work
162 elif [ $READLINE = yes ]
163 then
164 COMMANDS="${TMPDIR:-/tmp}/stumpish.commands.$$"
165 echo $(send_cmd "commands") |
166 sed -E 's/[[:space:]]+/\
167/g' |
168 sort > "$COMMANDS"
169 trap 'rm -f "$COMMANDS"' exit int term
170 rlwrap -b '' -f "$COMMANDS" "$0" -r
171 exit
172 fi
173
174 tput AF setaf 5
175 echo Welcome to the STUMPwm Interactive SHell.
176 tput me sgr0
177 echo 'Type \c'
178 tput AF setaf 2
179 echo 'commands\c'
180 tput me sgr0
181 echo \ for a list of commands.
182
183 while read -p '> ' REPLY
184 do
185 tput md bold
186 tput AF setaf 2
187 send_cmd "$REPLY"
188 tput me sgr0
189 done
190 else
191 while read REPLY
192 do
193 send_cmd "$REPLY"
194 done
195 fi
196fi
diff --git a/files/.bin/system-reconfigure b/files/.bin/system-reconfigure
new file mode 100755
index 0000000..c4c1a05
--- /dev/null
+++ b/files/.bin/system-reconfigure
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3sudo -E guix system -L $HOME/dotfiles/guix reconfigure $HOME/dotfiles/guix/jd/desktops/$(hostname).scm \ No newline at end of file
diff --git a/files/.bin/update.sh b/files/.bin/update.sh
new file mode 100755
index 0000000..e6f9f8d
--- /dev/null
+++ b/files/.bin/update.sh
@@ -0,0 +1,4 @@
1#!/bin/sh
2
3sudo emerge --sync
4sudo emerge --ask --verbose --update --newuse --deep @world;
diff --git a/files/.bin/whois-at-hsp b/files/.bin/whois-at-hsp
new file mode 100755
index 0000000..982a90e
--- /dev/null
+++ b/files/.bin/whois-at-hsp
@@ -0,0 +1,84 @@
1#!/usr/bin/env -S guix shell guile guile-json -- guile --no-auto-compile -e main -s
2-*- scheme -*-
3!#
4
5(use-modules (srfi srfi-1)
6 (ice-9 iconv)
7 (ice-9 receive)
8 (web client)
9 (json))
10
11(define whois-at-hsp-endpoint "https://whois.at.hsp.sh/api/now")
12
13(define (http-get-serialize-json url)
14 (receive (response data) (http-request url)
15 (values (json-string->scm (bytevector->string data "UTF-8"))
16 response)))
17
18(define (whois-data->users whois-data)
19 (assoc-ref whois-data "users"))
20
21(define (whois-data->unknown-devices whois-data)
22 (assoc-ref whois-data "unknown_devices"))
23
24(define (whois-data->head-count whois-data)
25 (assoc-ref whois-data "headcount"))
26
27(define (whois-data->formated-users whois-data)
28 (let ((users (vector->list (whois-data->users whois-data))))
29 (if (> (length users) 0)
30 (fold-right
31 (lambda (a b) (string-append a " " b))
32 ""
33 users)
34 "No visible users!")))
35
36(define (whois-data->summary whois-data)
37 (string-append
38 "Unknown devices: "
39 (number->string (whois-data->unknown-devices whois-data))
40 "\nUsers: [" (number->string (whois-data->head-count whois-data)) "] "
41 (whois-data->formated-users whois-data)))
42
43(define (notify data)
44 (system* "notify-send"
45 "WHOIS AT HSP"
46 (whois-data->summary data)))
47
48(define (command-line-option? option args)
49 (> (length (or (member option args)
50 '()))
51 0))
52
53(define-syntax-rule (command-line-args-handle args default ((option ...) body ...) ...)
54 (let ((option? (lambda (o) (command-line-option? o args))))
55 (cond ((or (option? option) ...) body ...) ...
56 (#t default))))
57
58;; (command-line-args-handle '("a" "--help")
59;; 0
60;; (("-h" "--help") "dupa"))
61
62(define (main args)
63 (let ((whois-data (http-get-serialize-json whois-at-hsp-endpoint)))
64 (command-line-args-handle args
65 (begin (display (whois-data->summary whois-data))
66 (newline))
67 (("-h" "--help")
68 (display (string-append "-h, --help Help message\n"
69 "-n, --notify Notification massage with whois information.\n"
70 "-u Get users\n"
71 "-H Get head count\n"
72 "-U Get unknown devices\n")))
73 (("-n" "--notify")
74 (notify whois-data))
75 (("-u")
76 (display (whois-data->formated-users whois-data))
77 (newline))
78 (("-H")
79 (display (whois-data->head-count whois-data))
80 (newline))
81 (("-U")
82 (display (whois-data->unknown-devices whois-data))
83 (newline)))))
84
diff --git a/files/.config/alacritty/alacritty.toml b/files/.config/alacritty/alacritty.toml
new file mode 100644
index 0000000..39fd4e9
--- /dev/null
+++ b/files/.config/alacritty/alacritty.toml
@@ -0,0 +1,46 @@
1[cursor]
2style = "Block"
3unfocused_hollow = true
4
5[font]
6size = 14
7
8[font.italic]
9family = "Terminus"
10style = "Light Italic"
11
12[font.normal]
13family = "Terminus"
14style = "Light"
15
16[font.offset]
17x = 0
18y = 0
19
20[window]
21dynamic_padding = true
22# opacity = 0.90
23
24[colors.bright]
25black = "0x002b36"
26blue = "0x839496"
27cyan = "0x93a1a1"
28green = "0x586e75"
29magenta = "0x6c71c4"
30red = "0xcb4b16"
31white = "0xfdf6e3"
32yellow = "0x657b83"
33
34[colors.normal]
35black = "0x073642"
36blue = "0x268bd2"
37cyan = "0x2aa198"
38green = "0x859900"
39magenta = "0xd33682"
40red = "0xdc322f"
41white = "0xeee8d5"
42yellow = "0xb58900"
43
44[colors.primary]
45background = "0x002b36"
46foreground = "0x839496"
diff --git a/files/.config/alacritty/alacritty.toml.old b/files/.config/alacritty/alacritty.toml.old
new file mode 100644
index 0000000..031d81c
--- /dev/null
+++ b/files/.config/alacritty/alacritty.toml.old
@@ -0,0 +1,23 @@
1[cursor]
2style = "Block"
3unfocused_hollow = true
4
5[font]
6size = 14
7
8[font.italic]
9family = "Terminus"
10style = "Light Italic"
11
12[font.normal]
13family = "Terminus"
14style = "Light"
15
16[font.offset]
17x = 0
18y = 0
19
20[window]
21dynamic_padding = true
22opacity = 0.90
23
diff --git a/files/.config/alacritty/alacritty.yaml b/files/.config/alacritty/alacritty.yaml
new file mode 100644
index 0000000..a4f2823
--- /dev/null
+++ b/files/.config/alacritty/alacritty.yaml
@@ -0,0 +1,27 @@
1colors:
2 # Default colors
3 primary:
4 background: '0x002b36'
5 foreground: '0x839496'
6
7 # Normal colors
8 normal:
9 black: '0x073642'
10 red: '0xdc322f'
11 green: '0x859900'
12 yellow: '0xb58900'
13 blue: '0x268bd2'
14 magenta: '0xd33682'
15 cyan: '0x2aa198'
16 white: '0xeee8d5'
17
18 # Bright colors
19 bright:
20 black: '0x002b36'
21 red: '0xcb4b16'
22 green: '0x586e75'
23 yellow: '0x657b83'
24 blue: '0x839496'
25 magenta: '0x6c71c4'
26 cyan: '0x93a1a1'
27 white: '0xfdf6e3'
diff --git a/files/.config/common-lisp/source-registry.conf.d/50-user-lisp.conf b/files/.config/common-lisp/source-registry.conf.d/50-user-lisp.conf
new file mode 100644
index 0000000..5ffc4fe
--- /dev/null
+++ b/files/.config/common-lisp/source-registry.conf.d/50-user-lisp.conf
@@ -0,0 +1 @@
(:tree "/home/jakub/Projects/lisp/") \ No newline at end of file
diff --git a/files/.config/dunst/dunstrc b/files/.config/dunst/dunstrc
new file mode 100644
index 0000000..b3b93b6
--- /dev/null
+++ b/files/.config/dunst/dunstrc
@@ -0,0 +1,177 @@
1[global]
2frame_width = 2
3frame_color = "#39bae6"
4font = sourcecodepro
5
6# Allow a small subset of html markup:
7# <b>bold</b>
8# <i>italic</i>
9# <s>strikethrough</s>
10# <u>underline</u>
11#
12# For a complete reference see
13# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
14# If markup is not allowed, those tags will be stripped out of the
15# message.
16markup = yes
17
18# The format of the message. Possible variables are:
19# %a appname
20# %s summary
21# %b body
22# %i iconname (including its path)
23# %I iconname (without its path)
24# %p progress value if set ([ 0%] to [100%]) or nothing
25# Markup is allowed
26format = "%s %p\n%b"
27
28# Sort messages by urgency.
29sort = yes
30
31# Show how many messages are currently hidden (because of geometry).
32indicate_hidden = yes
33
34# Alignment of message text.
35# Possible values are "left", "center" and "right".
36alignment = left
37
38# The frequency with wich text that is longer than the notification
39# window allows bounces back and forth.
40# This option conflicts with "word_wrap".
41# Set to 0 to disable.
42bounce_freq = 5
43
44
45# Show age of message if message is older than show_age_threshold
46# seconds.
47# Set to -1 to disable.
48show_age_threshold = 60
49
50# Split notifications into multiple lines if they don't fit into
51# geometry.
52word_wrap = no
53
54# Ignore newlines '\n' in notifications.
55ignore_newline = no
56
57
58# The geometry of the window:
59# [{width}]x{height}[+/-{x}+/-{y}]
60# The geometry of the message window.
61# The height is measured in number of notifications everything else
62# in pixels. If the width is omitted but the height is given
63# ("-geometry x2"), the message window expands over the whole screen
64# (dmenu-like). If width is 0, the window expands to the longest
65# message displayed. A positive x is measured from the left, a
66# negative from the right side of the screen. Y is measured from
67# the top and down respectevly.
68# The width can be negative. In this case the actual width is the
69# screen width minus the width defined in within the geometry option.
70geometry = "500x10-10+50"
71
72# Shrink window if it's smaller than the width. Will be ignored if
73# width is 0.
74shrink = yes
75
76# The transparency of the window. Range: [0; 100].
77# This option will only work if a compositing windowmanager is
78# present (e.g. xcompmgr, compiz, etc.).
79transparency = 15
80
81# Don't remove messages, if the user is idle (no mouse or keyboard input)
82# for longer than idle_threshold seconds.
83# Set to 0 to disable.
84# default 120
85idle_threshold = 120
86
87# Which monitor should the notifications be displayed on.
88monitor = 0
89
90# Display notification on focused monitor. Possible modes are:
91# mouse: follow mouse pointer
92# keyboard: follow window with keyboard focus
93# none: don't follow anything
94#
95# "keyboard" needs a windowmanager that exports the
96# _NET_ACTIVE_WINDOW property.
97# This should be the case for almost all modern windowmanagers.
98#
99# If this option is set to mouse or keyboard, the monitor option
100# will be ignored.
101follow = mouse
102
103# Should a notification popped up from history be sticky or timeout
104# as if it would normally do.
105sticky_history = yes
106
107# Maximum amount of notifications kept in history
108history_length = 20
109
110# Display indicators for URLs (U) and actions (A).
111show_indicators = yes
112
113# The height of a single line. If the height is smaller than the
114# font height, it will get raised to the font height.
115# This adds empty space above and under the text.
116line_height = 0
117
118# Draw a line of "separator_height" pixel height between two
119# notifications.
120# Set to 0 to disable.
121separator_height = 1
122
123# Padding between text and separator.
124# padding = 8
125padding = 8
126
127# Horizontal padding.
128horizontal_padding = 10
129
130# Define a color for the separator.
131# possible values are:
132# * auto: dunst tries to find a color fitting to the background;
133# * foreground: use the same color as the foreground;
134# * frame: use the same color as the frame;
135# * anything else will be interpreted as a X color.
136separator_color = #263238
137
138# Print a notification on startup.
139# This is mainly for error detection, since dbus (re-)starts dunst
140# automatically after a crash.
141startup_notification = false
142
143# dmenu path.
144dmenu = /usr/bin/dmenu -p dunst:
145
146# Browser for opening urls in context menu.
147browser = palemoon
148
149# Align icons left/right/off
150icon_position = left
151
152# Limit icons size.
153max_icon_size=128
154
155[urgency_low]
156# IMPORTANT: colors have to be defined in quotation marks.
157# Otherwise the "#" and following would be interpreted as a comment.
158background "#0d1017"
159foreground = "#888888"
160timeout = 10
161# Icon for notifications with low urgency, uncomment to enable
162#icon = /path/to/icon
163
164[urgency_normal]
165background = "#1e2128"
166foreground = "#ffffff"
167timeout = 10
168# Icon for notifications with normal urgency, uncomment to enable
169#icon = /path/to/icon
170
171[urgency_critical]
172background = "#900000"
173foreground = "#ffffff"
174frame_color = "#ff0000"
175timeout = 0
176# Icon for notifications with critical urgency, uncomment to enable
177#icon = /path/to/icon
diff --git a/files/.config/guix/.gitignore b/files/.config/guix/.gitignore
new file mode 100644
index 0000000..1f4ddec
--- /dev/null
+++ b/files/.config/guix/.gitignore
@@ -0,0 +1 @@
current \ No newline at end of file
diff --git a/files/.config/guix/channels.scm b/files/.config/guix/channels.scm
new file mode 100755
index 0000000..13bee44
--- /dev/null
+++ b/files/.config/guix/channels.scm
@@ -0,0 +1,19 @@
1(cons* (channel
2 (name 'rustup)
3 (url "https://github.com/declantsien/guix-rustup")
4 (introduction
5 (make-channel-introduction
6 "325d3e2859d482c16da21eb07f2c6ff9c6c72a80"
7 (openpgp-fingerprint
8 "F695 F39E C625 E081 33B5 759F 0FC6 8703 75EF E2F5"))))
9
10 (channel
11 (name 'nonguix)
12 (url "https://gitlab.com/nonguix/nonguix")
13 ;; Enable signature verification:
14 (introduction
15 (make-channel-introduction
16 "897c1a470da759236cc11798f4e0a5f7d4d59fbc"
17 (openpgp-fingerprint
18 "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5"))))
19 %default-channels)
diff --git a/files/.config/guix/shell-authorized-directories b/files/.config/guix/shell-authorized-directories
new file mode 100644
index 0000000..f6e0c84
--- /dev/null
+++ b/files/.config/guix/shell-authorized-directories
@@ -0,0 +1,10 @@
1/home/jakub/Projects/laco
2/home/jakub/Projects/yasa
3/home/jakub/Projects/trial
4/home/jakub/Projects/matura-infa
5/home/jakub/Projects/abaks-infra
6/home/jakub/Projects/lispz
7/home/jakub/Projects/zig-learning
8/home/jakub/Projects/let-over-lambda
9/home/jakub/Projects/rust
10/home/jakub/temphome/embedded-rust
diff --git a/files/.config/picom/picom.conf b/files/.config/picom/picom.conf
new file mode 100644
index 0000000..0f3fe1d
--- /dev/null
+++ b/files/.config/picom/picom.conf
@@ -0,0 +1,117 @@
1# ____ _____
2# | _ \_ _| Derek Taylor (DistroTube)
3# | | | || | http://www.youtube.com/c/DistroTube
4# | |_| || | http://www.gitlab.com/dwt1/
5# |____/ |_|
6#
7# My config. Not much to see here; just some pretty standard stuff.
8
9# Enabled client-side shadows on windows. Note desktop windows
10# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
11# unless explicitly requested using the wintypes option.
12#
13shadow = true;
14
15# The blur radius for shadows, in pixels. (defaults to 12)
16shadow-radius = 8;
17
18# The opacity of shadows. (0.0 - 1.0, defaults to 0.75)
19shadow-opacity = .6
20
21# The left offset for shadows, in pixels. (defaults to -15)
22shadow-offset-x = -3;
23
24# The top offset for shadows, in pixels. (defaults to -15)
25shadow-offset-y = -3;
26
27# Specify a list of conditions of windows that should have no shadow.
28#
29# examples:
30# shadow-exclude = "n:e:Notification";
31#
32# shadow-exclude = []
33shadow-exclude = [
34 "name = 'Notification'",
35 "class_g = 'Conky'",
36 "class_g ?= 'Notify-osd'",
37 "class_g = 'Cairo-clock'",
38 "class_g = 'slop'",
39 "class_g = 'Polybar'",
40 "_GTK_FRAME_EXTENTS@:c"
41];
42
43
44# Fade windows in/out when opening/closing and when opacity changes,
45# unless no-fading-openclose is used.
46# fading = false
47fading = true;
48
49# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
50# fade-in-step = 0.028
51fade-in-step = 0.3;
52
53# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
54# fade-out-step = 0.03
55fade-out-step = 0.3;
56
57# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
58# fade-delta = 10
59
60# Specify a list of conditions of windows that should not be faded.
61# don't need this, we disable fading for all normal windows with wintypes: {}
62fade-exclude = [
63 "class_g = 'slop'" # maim
64]
65
66# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
67inactive-opacity = 0.9
68# inactive-opacity = 1.0;
69
70# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
71# frame-opacity = 1.0
72frame-opacity = 0.7;
73
74# Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0)
75# menu-opacity = 1.0
76# menu-opacity is depreciated use dropdown-menu and popup-menu instead.
77
78#If using these 2 below change their values in line 510 & 511 aswell
79popup_menu = { opacity = 0.8; }
80dropdown_menu = { opacity = 0.8; }
81
82
83# Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows.
84# inactive-opacity-override = true
85inactive-opacity-override = false;
86
87# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0)
88active-opacity = 1.0;
89
90# Dim inactive windows. (0.0 - 1.0, defaults to 0.0)
91# inactive-dim = 0.0
92
93# Specify a list of conditions of windows that should always be considered focused.
94# focus-exclude = []
95focus-exclude = [
96 "class_g = 'Cairo-clock'",
97 "class_g = 'Bar'", # lemonbar
98 "class_g = 'slop'" # maim
99];
100
101opacity-rule = [
102 "100:class_g = 'XTerm'",
103 "100:class_g = 'URxvt'",
104 "100:class_g = 'firefox'",
105 "100:class_g = 'Thunderbird'"
106];
107
108wintypes:
109{
110 normal = { fade = false; shadow = true; }
111 tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; };
112 dock = { shadow = false; }
113 dnd = { shadow = true; }
114 popup_menu = { opacity = 0.8; }
115 dropdown_menu = { opacity = 0.8; }
116};
117
diff --git a/files/.config/polybar/config.ini b/files/.config/polybar/config.ini
new file mode 100644
index 0000000..d43ee51
--- /dev/null
+++ b/files/.config/polybar/config.ini
@@ -0,0 +1,122 @@
1[settings]
2screenchange-reload = true
3
4[colors]
5background = ${xrdb:emacs.background}
6foreground = ${xrdb:emacs.foreground}
7primary = #7fd962
8disabled = #707880
9
10[bar/example]
11width = 100%
12height = 18pt
13
14background = ${colors.background}
15foreground = ${colors.foreground}
16
17line-size = 1.5pt
18
19padding-left = 0
20padding-right = 1
21
22module-margin = 1
23
24separator = |
25separator-foreground = ${colors.disabled}
26
27font-0 = "Terminus:size=15"
28font-1 = "FontAwesome"
29
30modules-left = xworkspaces
31modules-right = memory cpu battery date
32
33cursor-click = pointer
34cursor-scroll = ns-resize
35
36enable-ipc = true
37
38tray-position = right
39
40[module/xworkspaces]
41type = internal/xworkspaces
42
43icon-0 = 1;0
44icon-1 = 2;1
45icon-2 = 3;2
46icon-3 = 4;3
47icon-4 = 5;4
48icon-5 = 6;5
49icon-6 = 7;6
50icon-7 = 8;7
51icon-8 = 9;8
52icon-9 = 10;9
53
54label-active = %icon%
55label-active-background = ${colors.background-alt}
56label-active-underline= ${colors.primary}
57label-active-padding = 1
58
59label-occupied = %icon%
60label-occupied-padding = 1
61
62label-urgent = %icon%
63label-urgent-background = ${colors.alert}
64label-urgent-padding = 1
65
66label-empty = %icon%
67label-empty-foreground = ${colors.disabled}
68label-empty-padding = 1
69
70[module/battery]
71type = internal/battery
72battery = BAT0
73adapter = ADP1
74
75format-charging = <animation-charging> <label-charging>
76format-discharging = <ramp-capacity> <label-discharging>
77format-low = <ramp-capacity> <label-low>
78format-full = <ramp-capacity> <label-full>
79
80label-charging = %percentage%%
81label-discharging = %percentage%%
82label-low = LOW %percentage%%
83label-full = FULL %percentage%%
84
85ramp-capacity-0 = 
86ramp-capacity-1 = 
87ramp-capacity-2 = 
88ramp-capacity-3 = 
89ramp-capacity-4 = 
90ramp-capacity-foreground = ${colors.primary}
91
92animation-charging-0 = 
93animation-charging-1 = 
94animation-charging-2 = 
95animation-charging-3 = 
96animation-charging-4 = 
97animation-charging-foreground = ${colors.primary}
98animation-charging-framerate = 750
99
100[module/memory]
101type = internal/memory
102interval = 2
103format-prefix = "RAM "
104format-prefix-foreground = ${colors.primary}
105label = %percentage_used:2%%
106
107[module/cpu]
108type = internal/cpu
109interval = 2
110format-prefix = "CPU "
111format-prefix-foreground = ${colors.primary}
112label = %percentage:2%%
113
114[module/date]
115type = internal/date
116interval = 1
117
118date = %H:%M
119date-alt = %Y-%m-%d %H:%M:%S
120
121label = %date%
122label-foreground = ${colors.primary}
diff --git a/files/.config/qtile/autorc b/files/.config/qtile/autorc
new file mode 100755
index 0000000..c54f683
--- /dev/null
+++ b/files/.config/qtile/autorc
@@ -0,0 +1,31 @@
1#!/bin/bash
2
3function monitor_settings() {
4 sleep .5
5 monitor_status=$(xrandr | grep "HDMI-1-4 connected" | wc -l)
6
7 if [ $monitor_status == 1 ];
8 then
9 # xrandr --auto
10 # xrandr --output eDP-1 --off
11 xrandr --output eDP-1-1 --auto --output HDMI-0 --auto --left-of eDP-1-1
12 fi
13}
14
15function caps_to_esc(){ xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'; }
16
17function start() {
18 killall $1
19 sleep .5
20 $($1 $2) &
21}
22
23# monitor_settings
24caps_to_esc
25
26start nitrogen "--restore"
27start picom ""
28start spotifyd ""
29start rclone "mount remote:/sync /home/jakub/Sync"
30start emacs "--daemon"
31xinput set-prop 11 344 1
diff --git a/files/.config/qtile/config.py b/files/.config/qtile/config.py
new file mode 100644
index 0000000..9106731
--- /dev/null
+++ b/files/.config/qtile/config.py
@@ -0,0 +1,232 @@
1import os
2import subprocess
3
4from typing import List
5
6from libqtile import bar, layout, widget
7from libqtile.config import Click, Drag, Group, Key, Match, Screen, KeyChord
8from libqtile import extension
9from libqtile.lazy import lazy
10from libqtile.utils import guess_terminal
11from libqtile import hook
12
13MOD = "mod4"
14
15TERMINAL = guess_terminal()
16
17DMENU_FLAGS = '-l 16 -p run -c -i'
18
19BAR = '#282a36'
20LIGHT_BAR = '#393b37'
21YELLOW = '#f1fa8c'
22RED = '#ff5555'
23LIGHT_RED = '#ff9999'
24GREEN = '#50fa7b'
25CYAN = '#8be9fd'
26LIGHT_CYAN = '#abfbff'
27
28@hook.subscribe.startup_once
29def autostart():
30 home = os.path.expanduser('~/.config/qtile/autorc')
31 subprocess.run([home])
32
33keys = [
34 Key([MOD], "h", lazy.layout.left(), desc="Move focus to left"),
35 Key([MOD], "l", lazy.layout.right(), desc="Move focus to right"),
36 Key([MOD], "j", lazy.layout.down(), desc="Move focus down"),
37 Key([MOD], "k", lazy.layout.up(), desc="Move focus up"),
38 Key([MOD], "s", lazy.next_screen() ),
39 Key([MOD], "space", lazy.window.toggle_floating(),
40 desc="Move window focus to other window"),
41
42 Key([MOD, "shift"], "h", lazy.layout.shuffle_left(),
43 desc="Move window to the left"),
44 Key([MOD, "shift"], "l", lazy.layout.shuffle_right(),
45 desc="Move window to the right"),
46 Key([MOD, "shift"], "j", lazy.layout.shuffle_down(),
47 desc="Move window down"),
48 Key([MOD, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"),
49
50 Key([MOD, "control"], "h", lazy.layout.grow_left(),
51 desc="Grow window to the left"),
52 Key([MOD, "control"], "l", lazy.layout.grow_right(),
53 desc="Grow window to the right"),
54 Key([MOD, "control"], "j", lazy.layout.grow_down(),
55 desc="Grow window down"),
56 Key([MOD, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"),
57 Key([MOD], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
58
59 Key([MOD, "shift"], "Return", lazy.layout.toggle_split(),
60 desc="Toggle between split and unsplit sides of stack"),
61 Key([MOD], "Return", lazy.spawn(TERMINAL), desc="Launch terminal"),
62
63 Key([MOD], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
64 Key([MOD], "c", lazy.window.kill(), desc="Kill focused window"),
65
66 Key([MOD, "control"], "r", lazy.restart(), desc="Restart Qtile"),
67 Key([MOD, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
68
69 Key([MOD], "F12", os.system("xbacklight -inc 10"), desc="Inc backlight"),
70 Key([MOD], "F11", os.system("xbacklight -dec 10"), desc="Dec backlight"),
71
72 Key([MOD], "r", lazy.spawncmd(),
73 desc="Spawn a command using a prompt widget"),
74
75 KeyChord([MOD], "p", [
76 Key([], "p", lazy.spawn(f"dmenu_run {DMENU_FLAGS}"), desc="Spawn dmenu run"),
77 Key([], "n", lazy.spawn(f"networkmanager_dmenu {DMENU_FLAGS}"), desc="Spawn dmenu for network manager"),
78 ]),
79
80 Key([MOD, "mod1"], "q", lazy.spawn("qutebrowser"), desc="Spawn qutebrowser"),
81 Key([MOD, "mod1"], "b", lazy.spawn("brave"), desc="Spawn brave"),
82 Key([MOD, "mod1"], "f", lazy.spawn("firefox"), desc="Spawn firefox"),
83
84 KeyChord([MOD], "e", [
85 Key([], "e", lazy.spawn("emacsclient -c -a 'emacs'"), desc="Spawn Emacsclient"),
86 Key([], "d", lazy.spawn("emacsclient -c -a 'emacs' --eval '(dired nil)'"), desc='Emacsclient Dired'),
87 Key([], "m", lazy.spawn("emacsclient -c -a 'emacs' --eval '(emms-browser)'"), desc='Emacsclient Dired'),
88 ]),
89
90 Key([MOD, "mod1"], "s", lazy.spawn("alacritty -e spt"), desc="Spawn spt (spotify clent)"),
91 Key([MOD, "mod1"], "l", lazy.spawn("slock"), desc="lock desktop"),
92 Key([MOD, "mod1"], "r", lazy.spawn("alacritty -e ranger"), desc="Spawn ranger (file manager)"),
93 Key([MOD, "mod1"], "p", lazy.spawn("alacritty -e pulsemixer"), desc="Spawn pulsemixer"),
94]
95
96groups_names = [
97 "dev",
98 "www",
99 "music",
100 "virt",
101 "sys",
102 "other"
103]
104
105groups = [Group(i) for i in groups_names]
106for i, group in enumerate(groups):
107 keys.extend([
108 Key([MOD], str(i+1), lazy.group[group.name].toscreen(),
109 desc="Switch to group {}".format(group.name)),
110
111 Key([MOD, "shift"], str(i+1), lazy.window.togroup(group.name, switch_group=True),
112 desc="Switch to & move focused window to group {}".format(group.name)),
113 ])
114
115mouse = [
116 Drag([MOD], "Button1", lazy.window.set_position_floating(),
117 start=lazy.window.get_position()),
118 Drag([MOD], "Button3", lazy.window.set_size_floating(),
119 start=lazy.window.get_size()),
120 Click([MOD], "Button2", lazy.window.bring_to_front())
121]
122
123layout_cfg = {
124 'border_width': 2,
125 'border_normal': "#bb8888",
126 'border_focus': "884444",
127 'margin': 8
128}
129
130layouts = [
131 # layout.Columns(**layout_cfg),
132 # layout.Max(),
133 layout.Stack(num_stacks=1, **layout_cfg),
134 # layout.Bsp(),
135 # layout.Matrix(),
136 layout.MonadTall(**layout_cfg),
137 # layout.MonadWide(),
138 # layout.RatioTile(),
139 # layout.Tile(),
140 # layout.TreeTab(),
141 # layout.VerticalTile(),
142 # layout.Zoomy(),
143]
144
145widget_defaults = dict(
146 font='sans',
147 fontsize=12,
148 padding=6,
149)
150
151transparent_sep = {
152 'foreground': BAR,
153 'margin': 2
154}
155
156soft_sep = {
157 'foreground': '44475a',
158 'padding': 2,
159 'margin': 4
160}
161
162screens = [
163 Screen(
164 top=bar.Bar(
165 [
166 widget.Sep(**transparent_sep),
167 widget.Image(filename="~/.config/qtile/python.png", margin=4),
168 widget.Sep(**transparent_sep),
169 widget.CurrentLayout(),
170 widget.Sep(**transparent_sep),
171 widget.GroupBox(
172 margin_y = 3,
173 margin_x = 0,
174 padding_y = 5,
175 padding_x = 3,
176 borderwidth = 3,
177 rounded = False,
178 highlight_color = LIGHT_BAR,
179 highlight_method = "line",
180 this_current_screen_border = CYAN,
181 this_screen_border = CYAN,
182 other_current_screen_border = LIGHT_BAR,
183 other_screen_border = LIGHT_BAR,
184 ),
185 widget.Prompt(),
186 widget.Sep(**transparent_sep),
187 widget.WindowName(),
188 widget.Net(format="🌐 ↓{down} ↑{up}", foreground=YELLOW),
189 widget.Sep(**soft_sep),
190 widget.CPU(format='💻 {load_percent}%', fontsize=12, foreground=RED),
191 widget.Sep(**soft_sep),
192 widget.Battery(format='🔋 {char} {percent:2.0%} {hour:d}:{min:02d} {watt:.2f} W', foreground=GREEN),
193 widget.Sep(**soft_sep),
194 widget.Clock(format='📅 %B %-d, %H:%M', foreground=CYAN),
195 widget.Sep(**soft_sep),
196 widget.CurrentScreen(),
197 widget.Sep(**soft_sep),
198 widget.Systray()
199 ],
200 24,
201 margin=8,
202 background=BAR,
203 border_color=CYAN,
204 border_width=1
205 ),
206 ),
207]
208
209floating_layout = layout.Floating(float_rules=[
210 # Run the utility of `xprop` to see the wm class and name of an X client.
211 *layout.Floating.default_float_rules,
212 Match(wm_class='confirmreset'), # gitk
213 Match(wm_class='makebranch'), # gitk
214 Match(wm_class='maketag'), # gitk
215 Match(wm_class='ssh-askpass'), # ssh-askpass
216 Match(title='branchdialog'), # gitk
217 Match(title='pinentry'), # GPG key password entry
218])
219
220dgroups_key_binder = None
221dgroups_app_rules = []
222
223follow_mouse_focus = True
224bring_front_click = False
225cursor_warp = False
226auto_fullscreen = True
227focus_on_window_activation = "smart"
228reconfigure_screens = True
229
230auto_minimize = True
231
232wmname = "LG3D"
diff --git a/files/.config/qtile/mdt_shell b/files/.config/qtile/mdt_shell
new file mode 100755
index 0000000..90fa6f3
--- /dev/null
+++ b/files/.config/qtile/mdt_shell
@@ -0,0 +1 @@
TERM=xterm-256color /home/jakub/.local/bin/mdt shell
diff --git a/files/.config/qtile/photos/desktop.png b/files/.config/qtile/photos/desktop.png
new file mode 100644
index 0000000..8fca190
--- /dev/null
+++ b/files/.config/qtile/photos/desktop.png
Binary files differ
diff --git a/files/.config/qtile/python.png b/files/.config/qtile/python.png
new file mode 100644
index 0000000..9a4b1ed
--- /dev/null
+++ b/files/.config/qtile/python.png
Binary files differ
diff --git a/files/.config/qtile/readme.org b/files/.config/qtile/readme.org
new file mode 100644
index 0000000..235dd47
--- /dev/null
+++ b/files/.config/qtile/readme.org
@@ -0,0 +1,5 @@
1#+title: Config
2
3* Qtile conifg
4- My personal qtile config ;)
5 [[./photos/desktop.png]]
diff --git a/files/.config/sway/config b/files/.config/sway/config
new file mode 100644
index 0000000..cf587fc
--- /dev/null
+++ b/files/.config/sway/config
@@ -0,0 +1,195 @@
1set $mod Mod4
2
3set $left h
4set $down j
5set $up k
6set $right l
7
8set $term alacritty
9set $emacs emacsclient -c
10set $menu fuzzel -r0 -b 282828f2 -C 458588f2 -B 3 -s 458588f2 -S 282828FF --font "Terminus:size=12" -p "run: "
11
12set $laptop-display eDP-1
13set $generic-display HDMI-A-1
14set $primary-home-display 'Iiyama North America PLE2407HDSD 0x01010101'
15set $secondary-home-display 'Dell Inc. DELL E190S M8VPV186CELI'
16
17set $primary-display-layout 'Samsung Electric Company C34H89x HTJM200007' $primary-home-display $generic-display $laptop-display
18set $secondary-display-layout $secondary-home-display $laptop-display
19
20# output * bg SPOILER_33.png fill
21output * bg #002b36 solid_color
22
23output $laptop-display resolution 1920x1080 position 1920,0
24output $generic-display resolution 1920x1080 position 0,0
25output $primary-home-display resolution 1920x1080 position 0,0
26output $secondary-home-display resolution 1280x1024 position 1920,0
27set $opacity 0.9
28
29client.focused #002b36 #586e75 #eee8d5 #268bd2
30client.focused_inactive #002b36 #073642 #93a1a1 #268bd2
31client.unfocused #002b36 #073642 #93a1a1 #268bd2
32client.urgent #002b36 #dc322f #fdf6e3 #002b36
33
34input type:keyboard {
35 xkb_layout pl,us
36}
37
38input type:touchpad {
39 tap enabled
40 middle_emulation enabled
41}
42
43bindsym $mod+Shift+s output $laptop-display toggle
44
45set $swaylock 'swaylock -f -c 000000 --font "Terminus"'
46exec swayidle -w \
47 timeout 280 $swaylock \
48 timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
49 before-sleep $swaylock
50
51# inhibit_idle fullscreen
52
53bindsym $mod+Escape exec $swaylock
54
55bindsym XF86MonBrightnessUp exec brightnessctl set 5%+
56bindsym XF86MonBrightnessDown exec brightnessctl set 5%-
57
58bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
59bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
60bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
61
62bindsym XF86AudioNext exec playerctl next
63bindsym XF86AudioPrev exec playerctl previous
64bindsym XF86AudioPlay exec playerctl play-pause
65bindsym XF86AudioPause exec playerctl pause
66
67bindsym print exec grimshot --notify copy area
68bindsym $mod+print exec grimshot --notify copy output
69bindsym $mod+Ctrl+print grimshot save area - | swappy -f -
70
71bindsym $mod+Return exec $term
72
73bindsym $mod+Shift+q kill
74
75floating_modifier $mod normal
76
77bindsym $mod+Shift+c reload
78bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
79
80bindsym $mod+$left focus left
81bindsym $mod+$down focus down
82bindsym $mod+$up focus up
83bindsym $mod+$right focus right
84
85bindsym $mod+Shift+$left move left
86bindsym $mod+Shift+$down move down
87bindsym $mod+Shift+$up move up
88bindsym $mod+Shift+$right move right
89
90workspace 1 output $primary-display-layout
91workspace 2 output $primary-display-layout
92workspace 3 output $secondary-display-layout
93workspace 4 output $secondary-display-layout
94workspace 9 output $primary-display-layout
95workspace 10 output $secondary-display-layout
96
97bindsym $mod+1 workspace number 1
98bindsym $mod+2 workspace number 2
99bindsym $mod+3 workspace number 3
100bindsym $mod+4 workspace number 4
101bindsym $mod+5 workspace number 5
102bindsym $mod+6 workspace number 6
103bindsym $mod+7 workspace number 7
104bindsym $mod+8 workspace number 8
105bindsym $mod+9 workspace number 9
106bindsym $mod+0 workspace number 10
107
108bindsym $mod+Shift+1 move container to workspace number 1
109bindsym $mod+Shift+2 move container to workspace number 2
110bindsym $mod+Shift+3 move container to workspace number 3
111bindsym $mod+Shift+4 move container to workspace number 4
112bindsym $mod+Shift+5 move container to workspace number 5
113bindsym $mod+Shift+6 move container to workspace number 6
114bindsym $mod+Shift+7 move container to workspace number 7
115bindsym $mod+Shift+8 move container to workspace number 8
116bindsym $mod+Shift+9 move container to workspace number 9
117bindsym $mod+Shift+0 move container to workspace number 10
118
119assign [app_id="(firefox-default|Firefox|qutebrowser|Chromium-browser)"] 2
120assign [instance="(chromium-browser)"] 2
121assign [instance="(spotify)"] 3
122assign [app_id=".blueman-manager-real"] 3
123assign [app_id="pavucontrol"] 3
124assign [app_id="(org.telegram.desktop)"] 4
125assign [app_id="vesktop"] 4
126assign [app_id="com.ktechpit.whatsie"] 4
127assign [instance="(discord)"] 4
128
129# for_window [app_id="vesktop"] opacity $opacity
130
131bindsym $mod+b splith
132bindsym $mod+v splitv
133
134bindsym $mod+s layout stacking
135bindsym $mod+w layout tabbed
136bindsym $mod+e layout toggle split
137
138bindsym $mod+f fullscreen
139bindsym $mod+Shift+space floating toggle
140bindsym $mod+space focus mode_toggle
141bindsym $mod+a focus parent
142
143bindsym $mod+Shift+minus move scratchpad
144bindsym $mod+minus scratchpad show
145
146mode "resize" {
147 bindsym $left resize shrink width 10px
148 bindsym $down resize grow height 10px
149 bindsym $up resize shrink height 10px
150 bindsym $right resize grow width 10px
151
152 bindsym Return mode "default"
153 bindsym Control+g mode "default"
154 bindsym Escape mode "default"
155}
156bindsym $mod+r mode "resize"
157
158set $default swaymsg mode default
159mode "menu" {
160 bindsym --no-repeat e exec '$default; $emacs;'
161 bindsym --no-repeat w exec "$default; whois-at-hsp -n"
162
163 bindsym Return mode "default"
164 bindsym Control+g mode "default"
165 bindsym Escape mode "default"
166
167}
168bindsym $mod+o mode "menu"
169
170
171workspace_layout tabbed
172
173# default_border normal 3
174# gaps outer 0
175# gaps inner 6
176# corner_radius 4
177# blur_xray disable
178# blur enable
179# layer_effects "waybar" blur enable
180
181font Terminus (TTF) 12
182bindsym $mod+p exec $menu
183
184
185# Taken from dawivil dotfiles.
186exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
187
188# exec udiskie -t
189exec mako --font "Terminus (TTF)" --outer-margin=5 --margin=3 --border-size=3 --default-timeout=7000 --background="#282828e0"
190
191exec nm-applet --indicator
192exec blueman-applet
193exec waybar
194exec udiskie -t
195exec wlsunset -l 51.919438 -L 19.145136
diff --git a/files/.config/waybar/config b/files/.config/waybar/config
new file mode 100644
index 0000000..5ebee30
--- /dev/null
+++ b/files/.config/waybar/config
@@ -0,0 +1,159 @@
1{
2 "layer": "top",
3 "position": "top",
4
5 "modules-left": [
6 "sway/workspaces",
7 "sway/mode"
8 ],
9
10 "modules-right": [
11// "custom/whois",
12 "pulseaudio",
13 "network",
14 "memory",
15 "cpu",
16 "temperature",
17 "battery",
18 "sway/language",
19 "clock#date",
20 "clock#time",
21 "idle_inhibitor",
22 "tray"
23 ],
24
25 // Modules
26 "idle_inhibitor": {
27 "format": "{icon}",
28 "format-icons": {
29 "activated": "",
30 "deactivated": ""
31 }
32 },
33
34 "battery": {
35 "interval": 10,
36 "states": {
37 "warning": 30,
38 "critical": 15
39 },
40 "format-time": "{H}:{M:02}",
41 "format": "{icon} {capacity}% ({time})",
42 "format-charging": " {capacity}% ({time})",
43 "format-charging-full": " {capacity}%",
44 "format-full": "{icon} {capacity}%",
45 "format-alt": "{icon} {power}W",
46 "format-icons": [
47 "",
48 "",
49 "",
50 "",
51 ""
52 ],
53 "tooltip": false
54 },
55
56 "clock#time": {
57 "interval": 10,
58 "format": "{:%H:%M}",
59 "tooltip": false
60 },
61
62 "clock#date": {
63 "interval": 20,
64 "format": " {:%e %b %Y}",
65 "tooltip": false
66 //"tooltip-format": "{:%e %B %Y}"
67 },
68
69 "cpu": {
70 "interval": 5,
71 "tooltip": false,
72 "format": " {usage}%",
73 "format-alt": " {load}",
74 "states": {
75 "warning": 70,
76 "critical": 90
77 }
78 },
79
80 "sway/language": {
81 "format": " {}",
82 "min-length": 5,
83 "on-click": "swaymsg 'input * xkb_switch_layout next'",
84 "tooltip": false
85 },
86
87 "memory": {
88 "interval": 5,
89 "format": " {used:0.1f}G/{total:0.1f}G",
90 "states": {
91 "warning": 70,
92 "critical": 90
93 },
94 "tooltip": false
95 },
96
97 "network": {
98 "interval": 5,
99 "format-wifi": " {essid} ({signalStrength}%)",
100 "format-ethernet": " {ifname}",
101 "format-disconnected": "No connection",
102 "format-alt": " {ipaddr}/{cidr}",
103 "tooltip": false
104 },
105
106 "sway/mode": {
107 "format": "{}",
108 "tooltip": false
109 },
110
111 "sway/window": {
112 "format": "{}",
113 "max-length": 30,
114 "tooltip": false
115 },
116
117 "sway/workspaces": {
118 "disable-scroll-wraparound": true,
119 "smooth-scrolling-threshold": 4,
120 "enable-bar-scroll": true,
121 "format": "{name}"
122 },
123
124 "pulseaudio": {
125 "format": "{icon} {volume}%",
126 "format-bluetooth": "{icon} {volume}%",
127 "format-muted": "",
128 "format-icons": {
129 "headphone": "",
130 "hands-free": "",
131 "headset": "",
132 "phone": "",
133 "portable": "",
134 "car": "",
135 "default": ["", ""]
136 },
137 "scroll-step": 1,
138 "on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle",
139 "tooltip": false
140 },
141
142 "temperature": {
143 "critical-threshold": 90,
144 "interval": 5,
145 "format": "{icon} {temperatureC}°",
146 "format-icons": [
147 "",
148 "",
149 "",
150 "",
151 ""
152 ],
153 "tooltip": false
154 },
155
156 "tray": {
157 "icon-size": 18,
158 }
159}
diff --git a/files/.config/waybar/style.css b/files/.config/waybar/style.css
new file mode 100644
index 0000000..53d732b
--- /dev/null
+++ b/files/.config/waybar/style.css
@@ -0,0 +1,205 @@
1/* Keyframes */
2
3@keyframes blink-critical {
4 to {
5 /*color: @white;*/
6 background-color: @critical;
7 }
8}
9
10
11/* Styles */
12
13/* Colors (gruvbox) */
14@define-color black #073642;
15@define-color red #dc322f;
16@define-color green #859900;
17@define-color yellow #b58900;
18@define-color blue #268bd2;
19@define-color purple #d33682;
20@define-color aqua #00afaf;
21@define-color gray #1c1c1c;
22@define-color brgray #928374;
23@define-color brred #cb4b16;
24@define-color brgreen #586e75;
25@define-color bryellow #657b83;
26@define-color brblue #839496;
27@define-color brpurple #6c71c4;
28@define-color braqua #93a1a1;
29@define-color white #eee8d5;
30@define-color bg1 #073642;
31@define-color bg2 #002b36;
32
33
34@define-color warning @bryellow;
35@define-color critical @red;
36@define-color mode @bg2;
37@define-color unfocused @bg2;
38@define-color focused @blue;
39@define-color inactive @purple;
40@define-color sound @green;
41@define-color network @yellow;
42@define-color memory @aqua;
43@define-color cpu @blue;
44@define-color temp @brpurple;
45@define-color layout @green;
46@define-color battery @yellow;
47@define-color date @aqua;
48@define-color time @bg2;
49@define-color tray @bg2;
50
51/* Reset all styles */
52* {
53 border: none;
54 border-radius: 0;
55 min-height: 0;
56 margin: 0;
57 padding: 0;
58 box-shadow: none;
59 text-shadow: none;
60 icon-shadow: none;
61}
62
63/* The whole bar */
64#waybar {
65 background: @bg2;
66 color: @white;
67 font-family: "Terminus (TTF)", FontAwesome;
68 font-size: 12pt;
69}
70
71/* Each module */
72#battery,
73#clock,
74#cpu,
75#language,
76#memory,
77#mode,
78#network,
79#pulseaudio,
80#temperature,
81#tray,
82#backlight,
83#idle_inhibitor,
84#disk,
85#user,
86#mpris {
87 padding-left: 8pt;
88 padding-right: 8pt;
89}
90
91/* Each critical module */
92#memory.critical,
93#cpu.critical,
94#temperature.critical,
95#battery.critical.discharging {
96 animation-timing-function: linear;
97 animation-iteration-count: infinite;
98 animation-direction: alternate;
99 animation-name: blink-critical;
100 animation-duration: 1s;
101}
102
103/* Each warning */
104#network.disconnected,
105#memory.warning,
106#cpu.warning,
107#temperature.warning,
108#battery.warning.discharging {
109 color: @warning;
110}
111
112/* And now modules themselves in their respective order */
113
114/* Current sway mode (resize etc) */
115#mode {
116 color: @white;
117 background: @mode;
118}
119
120/* Workspaces stuff */
121#workspaces button {
122 /*font-weight: bold;*/
123 padding-left: 2pt;
124 padding-right: 2pt;
125 color: @white;
126 background: @unfocused;
127}
128
129/* Inactive (on unfocused output) */
130#workspaces button.visible {
131 color: @white;
132 background: @inactive;
133}
134
135/* Active (on focused output) */
136#workspaces button.focused {
137 color: @black;
138 background: @focused;
139}
140
141/* Contains an urgent window */
142#workspaces button.urgent {
143 color: @black;
144 background: @warning;
145}
146
147/* Style when cursor is on the button */
148#workspaces button:hover {
149 background: @black;
150 color: @white;
151}
152
153#window {
154 margin-right: 35pt;
155 margin-left: 35pt;
156}
157
158#pulseaudio {
159 background: @sound;
160 color: @black;
161}
162
163#network {
164 background: @network;
165 color: @white;
166}
167
168#memory {
169 background: @memory;
170 color: @black;
171}
172
173#cpu {
174 background: @cpu;
175 color: @white;
176}
177
178#temperature {
179 background: @temp;
180 color: @black;
181}
182
183#language {
184 background: @layout;
185 color: @black;
186}
187
188#battery {
189 background: @battery;
190 color: @white;
191}
192
193#tray {
194 background: @tray;
195}
196
197#clock.date {
198 background: @date;
199 color: @black;
200}
201
202#clock.time {
203 background: @time;
204 color: @white;
205}
diff --git a/files/.emacs.d/.gitignore b/files/.emacs.d/.gitignore
new file mode 100644
index 0000000..10f87ad
--- /dev/null
+++ b/files/.emacs.d/.gitignore
@@ -0,0 +1,5 @@
1*
2!init.el
3!jd
4!jd/*
5!.gitignore \ No newline at end of file
diff --git a/files/.emacs.d/init.el b/files/.emacs.d/init.el
new file mode 100755
index 0000000..090592f
--- /dev/null
+++ b/files/.emacs.d/init.el
@@ -0,0 +1,146 @@
1;;; Dotfiles --- Jakub Dlugosz emacs config
2;;; Commentary:
3
4;;; Code:
5
6;; Minimize garbage collection during startup
7(setq gc-cons-threshold most-positive-fixnum)
8
9;; Lower threshold back to 8 MiB (default is 800kB)
10(add-hook 'emacs-startup-hook
11 (lambda ()
12 (setq gc-cons-threshold (expt 2 23))))
13
14(defvar jd/manifest-list
15 nil
16 "List that contain Emacs packages for GNU/Guix." )
17
18(defvar jd/exwm-p
19 (or (not (null (getenv "JD_EXWM")))
20 (and (seq-contains command-line-args "exwm" #'string-match)
21 t))
22 "Is non-nil when Emacs is run as a window manager.")
23
24(defvar jd/guix-p
25 (and (eq system-type 'gnu/linux)
26 (file-exists-p "/etc/os-release")
27 (with-temp-buffer
28 (insert-file-contents "/etc/os-release")
29 (search-forward "ID=guix" nil t))
30 t)
31 "Is non-nil when Emacs packages are installed by GNU/Guix package manager.")
32
33(defun jd/add-package-to-manifest (guix-package-name)
34 "Add GUIX-PACKAGE-NAME to jd/manifest-list."
35 (unless (member guix-package-name jd/manifest-list)
36 (setq jd/manifest-list
37 (cons guix-package-name jd/manifest-list))))
38
39(add-to-list 'load-path (concat user-emacs-directory "/jd"))
40
41(defun jd/display-startup-time ()
42 (message "Emacs loaded in %s with %d garbage collections."
43 (format "%.2f seconds"
44 (float-time
45 (time-subtract after-init-time before-init-time)))
46 gcs-done))
47
48(defun jd-emacs/startup ()
49 "This procedure will run after Emacs startup."
50 (electric-pair-mode 1)
51 (global-company-mode 1)
52 (jd/display-startup-time))
53
54(add-hook 'emacs-startup-hook #'jd-emacs/startup)
55
56(setq user-full-name "Jakub Dlugosz"
57 user-mail-address "jdlugosz963@gmail.com")
58
59(setq backup-directory-alist '(("." . "~/.cache/emacs/backup"))
60 backup-by-copying t
61 version-control t
62 delete-old-versions t
63 kept-new-versions 20
64 kept-old-versions 5
65 custom-file (concat user-emacs-directory
66 "custom.el"))
67
68;; (setq user-emacs-directory "~/.cache/emacs")
69
70(require 'package)
71(setq package-archives '(("melpa" . "https://melpa.org/packages/")
72 ("org" . "https://orgmode.org/elpa/")
73 ("gnu-devel" . "https://elpa.gnu.org/devel/")
74 ("elpa" . "https://elpa.gnu.org/packages/")))
75(package-initialize)
76
77(unless package-archive-contents
78 (package-refresh-contents))
79
80(jd/add-package-to-manifest "emacs-use-package")
81(unless jd/guix-p
82 (unless (package-installed-p 'use-package)
83 (package-install 'use-package)))
84
85(require 'use-package)
86
87(setq use-package-always-ensure (not jd/guix-p))
88
89(defun jd/generate-manifest ()
90 "Generate GNU/Guix Emacs manifest to temp-buffer."
91 (interactive)
92 (with-output-to-temp-buffer "*guix-emacs-packages-manifest.scm*"
93 (princ (concat ";; This file is auto-generated by Emacs "
94 "function: jd/manifest-generate-to-file \n"))
95 (princ `(specifications->manifest
96 '(,@(mapcar #'(lambda (guix-package-name)
97 (concat "\""
98 guix-package-name
99 "\"\n"))
100 jd/manifest-list))))))
101
102(defun use-package-normalize/:guix-package (name keyword args)
103 (use-package-as-one (symbol-name keyword) args
104 #'(lambda (_label arg)
105 (cond
106 ((consp arg) arg)
107 ((stringp arg) (list arg))
108 ((use-package-non-nil-symbolp arg) (symbol-name arg))
109 (t
110 (use-package-error
111 ":pin wants an archive name (a string)"))))))
112
113(defun use-package-handler/:guix-package
114 (name _keyword args rest state)
115 (let ((body (use-package-process-keywords name rest state)))
116 (use-package-concat
117 (when (consp args)
118 (mapcar #'(lambda (arg)
119 `(jd/add-package-to-manifest ,arg))
120 args))
121 body)))
122
123(add-to-list 'use-package-keywords ':guix-package)
124
125(jd/add-package-to-manifest "emacs")
126(jd/add-package-to-manifest "emacs-guix")
127
128(require 'jd-keys)
129(require 'jd-ui)
130(require 'jd-org)
131(require 'jd-dev)
132(require 'jd-apps)
133(require 'jd-custom)
134(require 'jd-mu4e)
135(require 'jd-misc)
136(require 'jd-sway)
137
138(when jd/exwm-p
139 (require 'jd-exwm))
140
141;; (setq gc-cons-threshold (* 2 1000 1000))
142
143;;; init.el ends here
144(put 'upcase-region 'disabled nil)
145(put 'downcase-region 'disabled nil)
146(put 'set-goal-column 'disabled nil)
diff --git a/files/.emacs.d/jd/jd-apps.el b/files/.emacs.d/jd/jd-apps.el
new file mode 100755
index 0000000..f06430b
--- /dev/null
+++ b/files/.emacs.d/jd/jd-apps.el
@@ -0,0 +1,49 @@
1;;; Dotfiles --- Jakub Dlugosz emacs config
2;;; Commentary:
3
4;;; Code:
5
6(use-package vterm
7 :guix-package "emacs-vterm"
8 :init
9 (add-to-list 'project-switch-commands '(project-vterm "Vterm") t)
10 (add-to-list 'project-kill-buffer-conditions
11 '(major-mode . vterm-mode))
12 (setq vterm-copy-exclude-prompt t)
13 :config
14 (setq vterm-buffer-name "vterm")
15 ;; (evil-set-initial-state 'vterm-mode 'emacs)
16 (setq vterm-tramp-shells
17 (append '(("ssh" "/bin/bash")) vterm-tramp-shells))
18
19 )
20
21(use-package all-the-icons-dired
22 :guix-package "emacs-all-the-icons-dired"
23 :hook (dired-mode . all-the-icons-dired-mode))
24
25(use-package dired
26 :ensure nil
27 :commands (dired dired-jump)
28 :custom ((dired-listing-switches "-agho --group-directories-first"))
29 :config
30 (setq dired-kill-when-opening-new-dired-buffer t))
31
32(use-package pdf-tools
33 :guix-package
34 "emacs-pdf-tools")
35
36(use-package password-store
37 :guix-package "emacs-password-store"
38 :bind
39 ("C-c P p" . password-store-copy)
40 ("C-c P i" . password-store-insert)
41 ("C-c P g" . password-store-generate))
42
43(use-package shell
44 :bind
45 ("C-c C-<return>" . shell))
46
47(provide 'jd-apps)
48
49;;; jd-apps.el ends here
diff --git a/files/.emacs.d/jd/jd-custom.el b/files/.emacs.d/jd/jd-custom.el
new file mode 100755
index 0000000..a634baa
--- /dev/null
+++ b/files/.emacs.d/jd/jd-custom.el
@@ -0,0 +1,33 @@
1;;; Dotfiles --- Jakub Dlugosz emacs config
2;;; Commentary:
3
4;;; Code:
5
6(setq erc-nick "bobbma"
7 erc-user-full-name "Jakub Dlugosz"
8 erc-notify-list '("akuleszaa"))
9
10(defun hipis-znc ()
11 (interactive)
12 (erc :server "195.74.91.18"
13 :port "6697"))
14
15
16;; Repair load paths when tramp try to connect to guix instances
17(require 'tramp)
18
19(connection-local-set-profile-variables
20 'guix-system
21 '((tramp-remote-path . (tramp-own-remote-path))))
22
23(connection-local-set-profiles
24 '(:application tramp :protocol "sudo" :machine "localhost")
25 'guix-system)
26
27(connection-local-set-profiles
28 '(:application tramp :protocol "ssh" :machine "jdlugosz.com")
29 'guix-system)
30
31(provide 'jd-custom)
32
33;;; jd-custom.el ends here
diff --git a/files/.emacs.d/jd/jd-dev.el b/files/.emacs.d/jd/jd-dev.el
new file mode 100755
index 0000000..12cd21b
--- /dev/null
+++ b/files/.emacs.d/jd/jd-dev.el
@@ -0,0 +1,177 @@
1;;; Dotfiles --- Jakub Dlugosz emacs config
2;;; Commentary:
3
4;;; Code:
5
6;; (setq c-default-style "linux"
7;; c-basic-offset 8
8;; gdb-many-windows t)
9
10(use-package lsp-mode
11 :guix-package "emacs-lsp-mode"
12 :diminish t
13 :commands (lsp lsp-deferred)
14 :init
15 (setq lsp-headerline-breadcrumb-enable nil)
16 (setq lsp-diagnostics-provider :none)
17 (setq lsp-modeline-diagnostics-enable nil)
18 (setq lsp-keymap-prefix "C-c l")
19 :config
20 (lsp-enable-which-key-integration t)
21
22 (global-set-key (kbd "C-x ]")
23 #'(lambda ()
24 (interactive)
25 (forward-page)
26 (recenter-top-bottom 0)))
27
28 (global-set-key (kbd "C-x [")
29 #'(lambda ()
30 (interactive)
31 (backward-page)
32 (recenter-top-bottom 0)))
33
34 (define-key c-mode-map
35 (kbd "C-c C-c")
36 #'(lambda ()
37 (interactive)
38 (compile compile-command)))
39
40 (define-key c-mode-map
41 (kbd "C-c M-c")
42 'compile))
43
44(use-package lsp-ivy
45 :guix-package "emacs-lsp-ivy"
46 :after lsp)
47
48
49(use-package paredit
50 :guix-package "emacs-paredit")
51
52(defun jd/lisp-mode-setup ()
53 (rainbow-delimiters-mode)
54 (paredit-mode))
55
56(add-hook 'emacs-startup-hook
57 (lambda ()
58 (add-hook 'scheme-mode-hook 'jd/lisp-mode-setup)
59 (add-hook 'emacs-lisp-mode-hook 'jd/lisp-mode-setup)
60 (add-hook 'clojure-mode-hook 'jd/lisp-mode-setup)
61 (add-hook 'lisp-mode-hook 'jd/lisp-mode-setup)))
62
63(use-package rainbow-delimiters
64 :guix-package "emacs-rainbow-delimiters")
65
66(use-package sly
67 :guix-package "emacs-sly")
68
69(use-package geiser
70 :guix-package "emacs-geiser")
71
72(use-package geiser-racket
73 :guix-package "emacs-geiser-racket")
74
75(use-package racket-mode
76 :guix-package "emacs-racket-mode")
77
78(use-package geiser-guile
79 :guix-package "emacs-geiser-guile"
80 :config
81 (when jd/guix-p
82 (defun jd/guix-repl ()
83 (interactive)
84 (let ((geiser-guile-binary '("guix" "repl"))
85 (geiser-guile-load-path (cons "~/dotfiles/guix" geiser-guile-load-path)))
86 (geiser 'guile)))))
87
88(use-package pyvenv
89 :guix-package "emacs-pyvenv"
90 :after python-mode)
91
92(use-package typescript-mode
93 :guix-package "emacs-typescript-mode"
94 :mode ("\\.ts\\'")
95 :config
96 (setq typescript-indent-level 2))
97
98(use-package cider
99 :guix-package "emacs-cider")
100
101(use-package tide
102 :guix-package "emacs-tide"
103 :after (typescript-mode company web-mode))
104
105(use-package flycheck
106 :guix-package "emacs-flycheck"
107 :hook ((after-init . global-flycheck-mode)))
108
109(use-package web-mode
110 :guix-package "emacs-web-mode"
111 :mode
112 ("\\.ejs\\'" "\\.hbs\\'" "\\.html\\'" "\\.php\\'" "\\.[jt]sx?\\'")
113 :config
114 (setq web-mode-content-types-alist '(("jsx" . "\\.[jt]sx?\\'")))
115 (setq web-mode-markup-indent-offset 2)
116 (setq web-mode-css-indent-offset 2)
117 (setq web-mode-code-indent-offset 2)
118 (setq web-mode-script-padding 2)
119 (setq web-mode-block-padding 2)
120 (setq web-mode-style-padding 2)
121 (setq web-mode-enable-auto-pairing t)
122 (setq web-mode-enable-auto-closing t)
123 (setq web-mode-enable-current-element-highlight t))
124
125(use-package yaml-mode
126 :guix-package "emacs-yaml-mode")
127
128(use-package docker
129 :guix-package "emacs-docker"
130 :bind
131 ("C-c D d" . docker-containers)
132 ("C-c D D" . docker))
133
134(use-package company
135 :guix-package "emacs-company"
136 :diminish t
137 :after lsp-mode
138 :hook (lsp-mode . company-mode)
139 :bind (:map company-active-map
140 ("<tab>" . company-complete-selection))
141 (:map lsp-mode-map
142 ("<tab>" . company-indent-or-complete-common))
143 :custom
144 (company-minimum-prefix-length 1)
145 (company-idle-delay 0.0)
146 :config
147 (global-company-mode))
148
149(use-package projectile
150 :guix-package "emacs-projectile"
151 :diminish projectile-mode
152 :init
153 (when (file-directory-p "~/Documents/code")
154 (setq projectile-project-search-path '("~/Documents/code/")))
155 :custom ((projectile-Completion-system 'ivy))
156 :config
157 (setq projectile-switch-project-action #'projectile-dired)
158 (projectile-mode))
159
160(use-package magit
161 :guix-package "emacs-magit"
162 :custom
163 (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1))
164
165(use-package restclient
166 :guix-package "emacs-restclient")
167
168(setq sql-connection-alist
169 '(("net47-abaks"
170 (sql-product 'postgres)
171 (sql-user "kuba")
172 (sql-database "net47")
173 (sql-server "net47.abaks.pl"))))
174
175(provide 'jd-dev)
176
177;;; jd-dev.el ends here
diff --git a/files/.emacs.d/jd/jd-exwm.el b/files/.emacs.d/jd/jd-exwm.el
new file mode 100755
index 0000000..7731b01
--- /dev/null
+++ b/files/.emacs.d/jd/jd-exwm.el
@@ -0,0 +1,177 @@
1;;; Dotfiles --- Jakub Dlugosz emacs config
2;;; Commentary:
3
4;;; Code:
5
6
7(use-package perspective
8 :guix-package "emacs-perspective")
9
10(use-package exwm
11 :guix-package "emacs-exwm"
12 :config
13 (defun jd/exwm-update-class ()
14 (exwm-workspace-rename-buffer exwm-class-name))
15
16 (defun jd-exwm/run-in-background (command)
17 (let ((command-parts (split-string command "[ ]+")))
18 (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
19
20 (defun jd-exwm/restart-process (program-name)
21 (call-process "killall" nil nil nil program-name)
22 (jd-exwm/run-in-background program-name))
23
24 (defun jd-exwm/exwm-init-hook ()
25 (jd-exwm/run-in-background "nitrogen --restore")
26 (start-process-shell-command "xinput" nil "xinput set-prop 'ETPS/2 Elantech Touchpad' 'Synaptics Tap Action' 1 1 1 2 1")
27 (start-process-shell-command "syndaemon" nil "syndaemon -i 0.8 -K -R -d")
28
29 (jd-exwm/restart-process "polybar")
30 (jd-exwm/restart-process "nm-applet")
31 (jd-exwm/restart-process "redshift-gtk -l 54.37:18.6")
32 (jd-exwm/restart-process "blueman-applet"))
33
34 (defun jd-exwm/exwm-update-title ()
35 (exwm-workspace-rename-buffer exwm-title))
36
37 (defun jd-exwm/configure-window-by-class ()
38 (interactive)
39 (pcase exwm-class-name
40 ("firefox" (exwm-workspace-move-window 2))
41 ("Brave" (exwm-workspace-move-window 2))
42 ("qutebrowser" (exwm-workspace-move-window 2))
43 ("discord" (exwm-workspace-move-window 5))
44 ("obs" (exwm-workspace-move-window 5))
45 ("Virt-manager" (exwm-workspace-move-window 4))))
46
47 (setq exwm-workspace-number 10)
48
49 ;; (add-hook 'exwm-init-hook #'jd-exwm/exwm-init-hook)
50 (add-hook 'exwm-update-class-hook #'jd/exwm-update-class)
51 (add-hook 'exwm-update-title-hook #'jd-exwm/exwm-update-title)
52 (add-hook 'exwm-manage-finish-hook #'jd-exwm/configure-window-by-class)
53
54 (require 'exwm-randr)
55 (setq exwm-randr-workspace-monitor-plist '(9 "eDP-1" 0 "eDP-1"))
56 (exwm-randr-enable)
57
58 (setq exwm-input-simulation-keys
59 '(([?\C-b] . [left])
60 ([?\C-f] . [right])
61 ([?\C-p] . [up])
62 ([?\C-n] . [down])
63 ([?\C-a] . [home])
64 ([?\C-e] . [end])
65 ([?\C-k] . [S-end delete])
66 ([?\M-w] . [C-c])
67 ([?\C-y] . [C-v])
68 ([?\C-v] . [next])
69 ([?\M-v] . [prior])
70 ))
71
72 (setq exwm-input-prefix-keys
73 '(?\C-x
74 ?\C-u
75 ?\C-h
76 ?\M-x
77 ?\M-`
78 ?\M-&
79 ?\M-!
80 ?\C-g
81 ?\M-:
82 ?\C-\M-j
83 ?\C-\ ))
84
85 (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
86 (exwm-input-set-key (kbd "s-p") 'counsel-linux-app)
87
88 (setq exwm-input-global-keys
89 `(([?\s-R] . exwm-reset)
90
91
92 ([?\s-r] . (lambda (command)
93 (interactive (list (read-shell-command "$ ")))
94 (start-process-shell-command command nil command)))
95
96 ([?\s-W] . exwm-workspace-move-window)
97 ([?\s-w] . exwm-workspace-switch)
98
99 ,@(mapcar (lambda (i)
100 `(,(kbd (format "s-%d" i)) .
101 (lambda ()
102 (interactive)
103 (exwm-workspace-switch-create ,i))))
104 (number-sequence 0 9))))
105
106 (exwm-enable)
107 (require 'exwm-systemtray)
108 (exwm-systemtray-enable))
109
110(use-package desktop-environment
111 :guix-package "emacs-desktop-environment"
112 :after exwm
113 :custom
114 (desktop-environment-brightness-small-increment "2%+")
115 (desktop-environment-brightness-small-decrement "2%-")
116 (desktop-environment-brightness-normal-increment "5%+")
117 (desktop-environment-brightness-normal-decrement "5%-")
118
119 :config
120 (defun jd/dunst-show-history ()
121 (interactive)
122 (start-process-shell-command "dunstctl" nil "dunstctl history-pop"))
123 (global-set-key (kbd "C-c N h") #'jd/dunst-show-history)
124
125 (defun jd/dunst-close ()
126 (interactive)
127 (start-process-shell-command "dunstctl" nil "dunstctl close"))
128 (global-set-key (kbd "C-c N c") #'jd/dunst-close)
129
130 (defun jd/dunst-close-all ()
131 (interactive)
132 (start-process-shell-command "dunstctl" nil "dunstctl close-all"))
133 (global-set-key (kbd "C-c N a") #'jd/dunst-close-all)
134
135 (desktop-environment-mode))
136
137;; (set-frame-parameter (selected-frame) 'alpha '(90 . 90))
138;; (add-to-list 'default-frame-alist `(alpha . (90 . 90)))
139;; (set-frame-parameter (selected-frame) 'fullscreen 'maximized)
140;; (add-to-list 'default-frame-alist '(fullscreen . maximized))
141
142(defun jd-exwm/get-color (ATTRIBUTE)
143 (face-attribute 'default ATTRIBUTE))
144
145(defun theme-to-xresources ()
146 (interactive)
147 (require 'term)
148 (with-temp-buffer
149 (insert "! Generated by theme-to-xresources\n")
150 (dolist (spec
151 '(("emacs.background" :background "E6")
152 ("emacs.foreground" :foreground "")))
153 (let ((color (jd-exwm/get-color (cadr spec))))
154 (insert (format "%s: #%s%s\n"
155 (car spec)
156 (caddr spec)
157 (string-remove-prefix "#" color))))
158 jd
159 (write-region (point-min) (point-max) "~/.Xresources")))
160 (call-process "xrdb" nil nil nil "-merge" (expand-file-name "~/.Xresources")))
161
162(defun jd/theme-sync ()
163 (interactive)
164 (theme-to-xresources)
165 (setq org-confirm-babel-evaluate nil)
166 (org-babel-tangle-file "~/dotfiles/Desktop.org")
167 (setq org-confirm-babel-evaluate 't)
168 (call-process "killall" nil nil nil "dunst") ;; TODO: prevent clear notification history
169 (jd-exwm/restart-process "polybar"))
170
171;; (add-hook 'jd/load-theme-hook #'jd/theme-sync)
172;; (add-hook 'exwm-init-hook #'jd/theme-sync)
173
174(provide 'jd-exwm)
175
176;;; jd-exwm.el ends here
177
diff --git a/files/.emacs.d/jd/jd-gym.el b/files/.emacs.d/jd/jd-gym.el
new file mode 100755
index 0000000..581bf65
--- /dev/null
+++ b/files/.emacs.d/jd/jd-gym.el
@@ -0,0 +1,120 @@
1;;; jd-gym.el --- Gym workout manager.
2;;; Commentary:
3;; It will be a gym workout manager in the future.
4;;; code:
5
6(require 'emacsql-sqlite)
7
8(defconst jd-gym/db--tables-schema
9 '((workout-plans
10 [(id integer :primary-key :autoincrement)
11 (name text)])
12
13 (workouts
14 [(id integer :primary-key :autoincrement)
15 (workout-plan-id integer :not-null)
16 (day integer :not-null)
17 (month integer :not-null)
18 (year integer :not-null)]
19 (:foreign-key [workout-plan-id] :references workout-plans [id] :on-delete :cascade))
20
21 (muscle-part
22 [(id integer :primary-key :autoincrement)
23 (name text :not-null)])
24
25 (exercises
26 [(id integer :primary-key :autoincrement)
27 (name text :not-null)
28 (muscle-part-id integer :not-null)]
29 (:foreign-key [muscle-part-id] :references muscle-part [id] :on-delete :cascade))
30
31 (workout-plan-exercise-map
32 [(id integer :primary-key :autoincrement)
33 (week-day integer :not-null)
34 (workout-plan-id integer :not-null)
35 (exercise-id integer :not-null)]
36 (:foreign-key [workout-plan-id] :references workout-plans [id] :on-delete :cascade)
37 (:foreign-key [exercise-id] :references exercises [id] :on-delete :cascade))
38
39 (workout-sets
40 [(id integer :primary-key :autoincrement)
41 (reps integer :not-null)
42 (weight integer :not-null)
43 (workout-plan-exercise-map-id integer :not-null)
44 (comment text)]
45 (:foreign-key [workout-plan-exercise-map-id] :references workout-plan-exercise-map [id] :on-delete :cascade))))
46
47(defconst jd-gym/db--test-data
48 '((workout-plans
49 ([nil "Push pull"]))
50 (workouts
51 ([nil 1 3 1 2023]))
52 (muscle-part
53 ([nil "glutes"]
54 [nil "chest"]))
55 (exercises
56 ([nil "Bench press" 2]
57 [nil "RDL" 1]))
58 (workout-plan-exercise-map
59 ([nil 0 1 1] ; Monday, Push pull, Bench press
60 [nil 1 1 2] ; Tuesday, Push pull, RDL
61 [nil 3 1 1] ; Thursday, Push pull, Bench press
62 [nil 4 1 2] ; Friday, Push pull, RDL
63 ))
64 (workout-sets
65 ([nil 7 70 1 "New PR!"]
66 [nil 8 110 2 "It was hard!"]))))
67
68(defun jd-gym/db--test-data-insert ()
69 "Insert test data to jd-gym database."
70 (mapc (lambda (table)
71 (let ((table-name (car table))
72 (table-data (cdr table)))
73 (emacsql jd-gym/db--conn [:insert :into $i1
74 :values $v2]
75 table-name table-data)))
76 jd-gym/db--test-data))
77
78(defvar jd-gym/db-path "~/Documents/Gym/gym.sqlite"
79 "Path can be relative or absolute.")
80
81(defvar jd-gym/db--conn nil
82 "Store connection to jd-gym database.")
83
84(defun jd-gym/db--conn-p ()
85 "Check if jd-gym is connected to db."
86 (and (emacsql-sqlite-connection-p jd-gym/db--conn)
87 (emacsql-live-p jd-gym/db--conn)))
88
89(defun jd-gym/db--connect ()
90 "Connect to db if there is no connection yet."
91 (unless (jd-gym/db--conn-p)
92 (setq jd-gym/db--conn (emacsql-sqlite jd-gym/db-path))))
93
94(defun jd-gym/db--close ()
95 "Close db connection."
96 (when (jd-gym/db--conn-p)
97 (emacsql-close jd-gym/db--conn)))
98
99(defun jd-gym/db--init ()
100 "Initialize database structure."
101 (when (jd-gym/db--conn-p)
102 (emacsql jd-gym/db--conn [:pragma (= foreign_keys ON)])
103 (emacsql jd-gym/db--conn "PRAGMA foreign_keys=ON")
104 (mapc (lambda (table)
105 (let ((table-name (car table))
106 (table-schema (cdr table)))
107 (emacsql jd-gym/db--conn [:create-table $i1 $S2] table-name table-schema)))
108 jd-gym/db--tables-schema)))
109
110(defun jd-gym/db ()
111 "Entrypoint to jd-gym db."
112 (unless (file-exists-p jd-gym/db-path)
113 (jd-gym/db--close)
114 (jd-gym/db--connect) ; Restart connection
115 (jd-gym/db--init)))
116
117
118(provide 'jd-gym)
119
120;;; jd-gym.el ends here
diff --git a/files/.emacs.d/jd/jd-keys.el b/files/.emacs.d/jd/jd-keys.el
new file mode 100755
index 0000000..8c1c4cb
--- /dev/null
+++ b/files/.emacs.d/jd/jd-keys.el
@@ -0,0 +1,49 @@
1;;; Dotfiles --- Jakub Dlugosz emacs config
2;;; Commentary:
3;; Custom keysets used in my emacs
4;;; Code:
5
6(use-package multiple-cursors
7 :guix-package "emacs-multiple-cursors"
8 :config
9 (global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
10 (global-set-key (kbd "C->") 'mc/mark-next-like-this)
11 (global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
12 (global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this))
13
14(use-package hydra
15 :guix-package "emacs-hydra"
16 ;; :defer t
17 :config
18 (defun jd/text-scale-increase ()
19 (interactive)
20 (let ((old-face-attribute (face-attribute 'default :height)))
21 (set-face-attribute 'default nil :height (+ old-face-attribute 10))))
22
23 (defun jd/text-scale-decrease ()
24 (interactive)
25 (let ((old-face-attribute (face-attribute 'default :height)))
26 (set-face-attribute 'default nil :height (- old-face-attribute 10))))
27
28 (defhydra hydra-text-scale-global (:timeout 4)
29 "scale text"
30 ("j" jd/text-scale-increase "in")
31 ("k" jd/text-scale-decrease "out")
32 ("q" nil "finished" :exit t)) ;; TODO not working
33
34 (defhydra hydra-text-scale (:timeout 4)
35 "scale text"
36 ("j" text-scale-increase "in")
37 ("k" text-scale-decrease "out")
38 ("q" nil "finished" :exit t)))
39
40(use-package undo-tree
41 :guix-package "emacs-undo-tree"
42 :diminish
43 :config
44 (setq undo-tree-auto-save-history nil)
45 (global-undo-tree-mode 1))
46
47(provide 'jd-keys)
48
49;;; jd-keys.el ends here
diff --git a/files/.emacs.d/jd/jd-misc.el b/files/.emacs.d/jd/jd-misc.el
new file mode 100644
index 0000000..2b7d1bd
--- /dev/null
+++ b/files/.emacs.d/jd/jd-misc.el
@@ -0,0 +1,34 @@
1;;; Dotfiles --- Jakub Dlugosz emacs config
2;;; Commentary:
3
4;;; Code:
5
6(defun jd/generete-qr-from-clipboard ()
7 (interactive)
8 (let ((clipboard-value (x-get-clipboard))
9 (clipboard-file-path "/tmp/clipboard_value.txt")
10 (clipboard-out-image "/tmp/qr.png"))
11 (with-temp-file clipboard-file-path
12 (insert clipboard-value))
13 (shell-command (concat
14 "qrencode -o "
15 clipboard-out-image
16 " < "
17 clipboard-file-path))
18 (find-file clipboard-out-image)))
19
20(defun jd/dired-open-file-in-kill-ring ()
21 (interactive)
22 (let* ((last-killed (car kill-ring))
23 (exists-p (file-exists-p last-killed))
24 (dir-p (file-directory-p last-killed)))
25 (cond
26 ((not exists-p) (message "File doesn't exists!"))
27 (dir-p (dired last-killed))
28 ((not dir-p) (find-file last-killed)))))
29
30(global-set-key (kbd "C-c O") #'jd/dired-open-file-in-kill-ring)
31
32(provide 'jd-misc)
33
34;;; jd-misc.el ends here
diff --git a/files/.emacs.d/jd/jd-mu4e.el b/files/.emacs.d/jd/jd-mu4e.el
new file mode 100755
index 0000000..b388201
--- /dev/null
+++ b/files/.emacs.d/jd/jd-mu4e.el
@@ -0,0 +1,84 @@
1;;; Dotfiles --- Jakub Dlugosz emacs config
2;;; Commentary:
3
4;;; Code:
5
6(use-package htmlize
7 :guix-package "emacs-htmlize")
8
9(use-package mu4e
10 :guix-package ("mu" "isync")
11 :defer 10
12 :ensure nil
13 :bind
14 ("C-c M" . mu4e)
15 :config
16 ;a (require 'org-mu4e)
17
18 (unless jd/guix-p
19 (add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e")
20 (setq mu4e-mu-binary "/usr/local/bin/mu"))
21
22 (setq mu4e-update-interval (* 10 60))
23 (setq mu4e-get-mail-command "mbsync -a")
24 (setq mu4e-maildir "~/Mail")
25
26 (setq mu4e-completing-read-function #'ivy-completing-read)
27
28 (setq mu4e-change-filenames-when-moving t)
29
30 (setq mu4e-contexts
31 `(,(make-mu4e-context
32 :name "Abaks"
33 :match-func (lambda (msg) (when msg
34 (string-prefix-p "/abaks" (mu4e-message-field msg :maildir))))
35 :vars '(
36 (user-full-name . "Jakub Dlugosz")
37 (user-mail-address . "jakub@abaks.pl")
38 (mu4e-sent-folder . "/abaks/Sent Items")
39 (mu4e-trash-folder . "/abaks/Trash")
40 (mu4e-drafts-folder . "/abaks/Drafts")
41 (mu4e-refile-folder . "/abaks/Archive")
42 (mu4e-sent-messages-behavior . sent)
43 (smtpmail-local-domain . "pl")
44 (smtpmail-smtp-server . "smtp.abaks.pl")
45 (smtpmail-smtp-user . "jakub@abaks.pl")))
46 ,(make-mu4e-context
47 :name "Gmail"
48 :match-func (lambda (msg) (when msg
49 (string-prefix-p "/gmail" (mu4e-message-field msg :maildir))))
50 :vars '(
51 (user-full-name . "Jakub Dlugosz")
52 (user-mail-address . "jdlugosz963@gmail.com")
53 (mu4e-sent-folder . "/gmail/\[Gmail\]/Wys\&AUI-ane")
54 (mu4e-trash-folder . "/gmail/\[Gmail\]/Kosz")
55 (mu4e-drafts-folder . "/gmail/\[Gmail\]/Wersje\ robocze")
56 (mu4e-refile-folder . "/gmail/Archive")
57 (smtpmail-local-domain . "com")
58 (smtpmail-smtp-server . "smtp.gmail.com")
59 (smtpmail-smtp-user . "jdlugosz963@gmail.com")
60 (mu4e-sent-messages-behavior . sent)))))
61
62 (setq mail-user-agent 'mu4e-user-agent
63 mail-host-address nil
64 message-send-mail-function 'smtpmail-send-it
65 smtpmail-smtp-service 465
66 smtpmail-stream-type 'ssl
67 smtpmail-servers-requiring-authorization ".*")
68
69 (setq mu4e-compose-signature (concat
70 "Pozdrawiam,\n"
71 "Jakub Długosz"))
72
73 (mu4e t)
74 (mu4e-modeline-mode nil))
75
76(use-package mu4e-alert
77 :guix-package "emacs-mu4e-alert"
78 :defer 20
79 :config
80 (mu4e-alert-set-default-style 'libnotify)
81 (mu4e-alert-enable-mode-line-display)
82 (mu4e-alert-enable-notifications))
83
84(provide 'jd-mu4e)
diff --git a/files/.emacs.d/jd/jd-org.el b/files/.emacs.d/jd/jd-org.el
new file mode 100755
index 0000000..400d00c
--- /dev/null
+++ b/files/.emacs.d/jd/jd-org.el
@@ -0,0 +1,224 @@
1;;; Dotfiles --- Jakub Dlugosz emacs config
2;;; Commentary:
3
4;;; Code:
5
6(defvar jd/org-home "~/Notes")
7(defvar jd/org-roam-home (concat jd/org-home "/roam"))
8(defvar jd/org-sync (concat jd/org-home "/sync"))
9(defvar jd/org-roam-daily-home (concat jd/org-roam-home "/daily"))
10
11(defun jd/org-mode-init ()
12 (org-indent-mode)
13 (variable-pitch-mode 1)
14 (visual-line-mode 1))
15
16(defun jd-emacs/org-insert-date (&optional date)
17 (org-insert-time-stamp (org-read-date nil t (or date "+0d"))))
18
19(use-package org-pomodoro
20 :guix-package "emacs-org-pomodoro")
21
22(use-package org-caldav
23 :guix-package "emacs-org-caldav"
24 :config
25 (setq org-caldav-url "http://caldav.jdlugosz.com/radicale/admin/"
26 org-caldav-files nil
27 org-icalendar-timezone "Europe/Warsaw")
28
29 (defun jd/caldav-calendar-sync ()
30 (interactive)
31 (let ((org-caldav-calendar-id "0c54a523-c7aa-2f26-2c18-a12b69c2bc86")
32 (org-caldav-inbox (concat jd/org-sync
33 "/calendar.org")))
34 (org-caldav-sync)))
35
36 (defun jd/caldav-journal-sync ()
37 (interactive)
38 (let ((org-caldav-calendar-id "3cc70419-a787-5f84-28c6-96f15fc606d9")
39 (org-caldav-inbox (concat jd/org-sync
40 "/journal.org")))
41 (org-caldav-sync)))
42
43 (defun jd/caldav-tasks-sync ()
44 (interactive)
45 (let ((org-caldav-calendar-id "372cbbb3-14f7-fc15-9f7b-cae04114920c")
46 (org-caldav-inbox (concat jd/org-sync
47 "/tasks.org")))
48 (org-caldav-sync))))
49
50(use-package org
51 :guix-package "emacs-org"
52 :pin org
53 :commands (org-capture org-agenda)
54 :hook (org-mode . jd/org-mode-init)
55 :bind
56 ("C-c o c" . #'org-capture)
57 ("C-c o p" . #'org-mobile-pull)
58 ("C-c o P" . #'org-mobile-push)
59 ("C-c o a" . #'org-agenda)
60 :config
61 (defun jd/org-mode-file (file-name) (concat org-directory "/" file-name ".org"))
62 (setq org-directory (file-truename "~/Notes")
63 org-mobile-directory (concat org-directory "/Mobile")
64 org-mobile-inbox-for-pull (concat org-directory "/flagged.org") ;; TODO: ??
65
66 org-refile-targets '((org-agenda-files :maxlevel . 1))
67 org-outline-path-complete-in-steps nil
68 org-refile-use-outline-path t
69 org-agenda-files '("Personal.org" "Work.org" "Inbox.org")
70 org-ellipsis " ▾"
71 org-agenda-start-with-log-mode t
72 org-log-done 'time
73 org-log-into-drawer t
74 org-return-follows-link t
75 org-latex-listings 'minted
76 org-latex-packages-alist '(("" "minted"))
77
78 org-agenda-custom-commands
79 `(("p" "Planning"
80 ((tags-todo "+planning"
81 ((org-agenda-overriding-header "Planning Tasks")))
82 (tags-todo "-{.*}"
83 ((org-agenda-overriding-header "Untagged Tasks")))
84 (todo "*" ((org-agenda-files '(,(jd/org-mode-file "Inbox")))
85 (org-agenda-overriding-header "Unprocessed Inbox Items")))))
86
87 ("d" "Daily Agenda"
88 ((agenda "" ((org-agenda-span 'day)
89 (org-deadline-warning-days 7)))
90 (tags-todo "+PRIORITY=\"A\""
91 ((org-agenda-overriding-header "High Priority Tasks")))))
92
93 ("w" "Weekly Review"
94 ((agenda ""
95 ((org-agenda-overriding-header "Completed Tasks")
96 (org-agenda-skip-function '(org-agenda-skip-entry-if 'nottodo 'done))
97 (org-agenda-span 'week)))
98
99 (agenda ""
100 ((org-agenda-overriding-header "Unfinished Scheduled Tasks")
101 (org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
102 (org-agenda-span 'week))))))
103
104 org-capture-templates
105 `(("i" "Capture to Inbox" entry (file+olp ,(jd/org-mode-file "Inbox") "Inbox")
106 "* TODO %?\n %t\n" :empty-lines 1))
107
108 org-latex-pdf-process
109 '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
110 "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
111
112 (require 'org-tempo)
113
114 (defun jd/org-font-setup ()
115 ;; Replace list hyphen with dot
116 ;; (font-lock-add-keywords 'org-mode
117 ;; '(("^ *\\([.]\\) "
118 ;; (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•-"))))))
119
120 ;; Set faces for heading levels
121 (dolist (face '((org-level-1 . 1.3)
122 (org-level-2 . 1.2)
123 (org-level-3 . 1.1)
124 (org-level-4 . 1.0)
125 (org-level-5 . 1.0)
126 (org-level-6 . 1.0)
127 (org-level-7 . 1.0)
128 (org-level-8 . 1.0)))
129 (set-face-attribute (car face) nil :font "Terminus" :weight 'Bold :height (cdr face)))
130
131 ;; Ensure that anything that should be fixed-pitch in Org files appears that way
132 (set-face-attribute 'org-block nil :font "Terminus" :inherit 'fixed-pitch :height 100)
133 (set-face-attribute 'org-table nil :inherit 'fixed-pitch)
134 (set-face-attribute 'org-formula nil :inherit 'fixed-pitch)
135 (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
136 (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
137 (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
138 (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
139 (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)
140 (set-face-attribute 'line-number nil :inherit 'fixed-pitch)
141 (set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch))
142
143 (with-eval-after-load 'org (jd/org-font-setup))
144
145 (defun jd-emacs/org-timer-stop ()
146 (start-process-shell-command "notify-send" nil "notify-send Zakonczono odliczanie"))
147
148 (add-hook 'org-timer-stop-hook #'jd-emacs/org-timer-stop)
149
150 (defun jd/org-tempo-setup ()
151 (dolist (template '(("s" . "src")
152 ("sql" . "src sql")
153 ("sh" . "src sh")
154 ("el" . "src emacs-lisp")
155 ("li" . "src lisp")
156 ("sc" . "src scheme")
157 ("ts" . "src typescript")
158 ("py" . "src python")
159 ("go" . "src go")
160 ("yaml" . "src yaml")))
161 (add-to-list 'org-structure-template-alist template)))
162
163 (with-eval-after-load 'org-tempo (jd/org-tempo-setup))
164
165 (org-babel-do-load-languages
166 'org-babel-load-languages
167 '((emacs-lisp . t)
168 (python . t)
169 (shell . t))))
170
171(use-package org-superstar
172 :guix-package "emacs-org-superstar"
173 :hook (org-mode . org-superstar-mode)
174 :init
175 (setq org-superstar-special-todo-items t)
176 (setq org-superstar-remove-leading-stars t)
177 (setq org-superstar-headline-bullets-list '("◉" "○" "●" "○" "●" "○" "●")))
178
179(use-package org-roam
180 :guix-package "emacs-org-roam"
181 :custom
182 (org-roam-directory (file-truename jd/org-roam-home))
183 :bind (("C-c n l" . org-roam-buffer-toggle)
184 ("C-c n f" . org-roam-node-find)
185 ("C-c n g" . org-roam-graph)
186 ("C-c n i" . org-roam-node-insert)
187 ("C-c n c" . org-roam-capture)
188 ;; Dailies
189 ("C-c n j" . org-roam-dailies-capture-today))
190 :bind-keymap
191 ("C-c n d" . org-roam-dailies-map)
192 :config
193 (require 'org-roam-dailies)
194
195 (defun jd/org-roam-filter-by-tag (tag-name)
196 (lambda (node)
197 (member tag-name (org-roam-node-tags node))))
198
199 (defun jd/org-roam-list-notes-by-tag (tag-name)
200 (mapcar #'org-roam-node-file
201 (seq-filter
202 (jd/org-roam-filter-by-tag tag-name)
203 (org-roam-node-list))))
204
205 (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
206 (setq org-roam-capture-templates
207 '(("d" "default" plain "%?"
208 :target (file+head
209 "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n\n* ${title}\n %?") ;; TODO: point cursor to the end of the file, it should be: `%?`
210 :unnarrowed t)
211 ;; ("n" "insert node" plain (file "~/Documents/roam/study/templates/research.org")
212 ;; :target (file+head "study/%<%Y%m%d%H%M%S>-${slug}.org"
213 ;; "#+title: ${title}\n")
214 ;; :unnarrowed t)
215 ))
216
217 (org-roam-db-autosync-mode))
218
219(use-package ox-pandoc
220 :guix-package "emacs-ox-pandoc")
221
222(provide 'jd-org)
223
224;;; jd-org.el ends here
diff --git a/files/.emacs.d/jd/jd-sway.el b/files/.emacs.d/jd/jd-sway.el
new file mode 100644
index 0000000..cdfb667
--- /dev/null
+++ b/files/.emacs.d/jd/jd-sway.el
@@ -0,0 +1,18 @@
1;;; Dotfiles --- Jakub Dlugosz emacs config
2;;; Commentary:
3
4;;; Code:
5
6(defun use-package-normalize/:diminish (name keyword args)
7 (use-package-as-one (symbol-name keyword) args
8 (apply-partially #'use-package-normalize-diminish name) t))
9
10(use-package shackle
11 :guix-package "emacs-shackle")
12
13(use-package sway
14 :guix-package "emacs-sway")
15
16(provide 'jd-sway)
17
18;;; jd-sway.el ends here
diff --git a/files/.emacs.d/jd/jd-ui.el b/files/.emacs.d/jd/jd-ui.el
new file mode 100755
index 0000000..4e388c9
--- /dev/null
+++ b/files/.emacs.d/jd/jd-ui.el
@@ -0,0 +1,104 @@
1;; Dotfiles --- Jakub Dlugosz emacs config
2;;; Commentary:
3
4;;; Code:
5
6(setq inhibit-startup-message t)
7(setq visible-bell t)
8(scroll-bar-mode -1)
9(tool-bar-mode -1)
10(tooltip-mode -1)
11(menu-bar-mode -1)
12(set-fringe-mode 10)
13
14;; (set-frame-parameter (selected-frame) 'alpha '(92 . 92))
15;; (add-to-list 'default-frame-alist '(alpha . (92 . 92)))
16
17(let ((height (if (string-equal (system-name)
18 "berserker")
19 175
20 125)))
21 (custom-set-faces
22 `(default ((t (:inherit nil :height ,height :family "Terminus"))))
23 `(line-number ((t (:inherit nil :height ,height :family "Terminus"))))
24 `(line-number-current-line ((t (:inherit nil :height ,height :family "Terminus"))))))
25
26(add-hook 'prog-mode-hook 'menu-bar--display-line-numbers-mode-relative)
27
28(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
29
30(global-prettify-symbols-mode 1)
31
32(defalias 'yes-or-no-p 'y-or-n-p)
33
34(require 'diminish)
35
36(use-package doom-modeline
37 :guix-package "emacs-doom-modeline"
38 :config
39 (doom-modeline-mode))
40
41(use-package solarized-theme
42 :guix-package "emacs-solarized-theme"
43 :config
44 (load-theme 'solarized-dark-high-contrast t))
45
46
47(use-package diminish
48 :guix-package "emacs-diminish")
49
50(use-package hl-todo
51 :guix-package "emacs-hl-todo"
52 :init
53 (setq hl-todo-keyword-faces
54 '(("TODO" . "#FF0000")
55 ("FIXME" . "#FF0000")
56 ("DEBUG" . "#A020F0")))
57 :config
58 (global-hl-todo-mode 1))
59
60(defvar jd/load-theme-hook nil)
61(defun jd/load-theme ()
62 (interactive)
63 (counsel-load-theme)
64 (run-hooks 'jd/load-theme-hook))
65
66(use-package ivy
67 :guix-package "emacs-ivy"
68 :diminish
69 :bind
70 (("C-s" . swiper))
71 :config
72 (ivy-mode 1))
73
74(use-package counsel
75 :guix-package "emacs-counsel"
76 :diminish t
77 :config
78 (counsel-mode 1))
79
80(use-package which-key
81 :guix-package "emacs-which-key"
82 :diminish
83 :config
84 (which-key-mode)
85 (setq which-key-idle-delay 0.3))
86
87(use-package all-the-icons
88 :guix-package "emacs-all-the-icons")
89
90(use-package beacon
91 :guix-package "emacs-beacon"
92 :config
93 (beacon-mode 1))
94
95(setq display-time-string-forms
96 '(" " 24-hours ":" minutes " "))
97
98(when jd/exwm-p
99 (display-battery-mode)
100 (display-time-mode))
101
102(provide 'jd-ui)
103
104;;; jd-ui.el ends here
diff --git a/files/.gitignore b/files/.gitignore
new file mode 100644
index 0000000..f3fe7e5
--- /dev/null
+++ b/files/.gitignore
@@ -0,0 +1,7 @@
1__pycache__/
2elpa/
3auto-save-list/
4eln-cache/
5url/
6**/#*
7**/*~
diff --git a/files/.guile b/files/.guile
new file mode 100644
index 0000000..2076bd2
--- /dev/null
+++ b/files/.guile
@@ -0,0 +1,2 @@
1 (use-modules (ice-9 readline))
2 (activate-readline) \ No newline at end of file
diff --git a/files/.mbsyncrc b/files/.mbsyncrc
new file mode 100644
index 0000000..20a8692
--- /dev/null
+++ b/files/.mbsyncrc
@@ -0,0 +1,47 @@
1IMAPStore abaks-remote
2Host imap.abaks.pl
3Port 143
4SSLType None
5AuthMechs LOGIN
6User jakub@abaks.pl
7PassCmd "pass email/jakub@abaks.pl"
8CertificateFile /etc/ssl/certs/ca-certificates.crt
9
10MaildirStore abaks-local
11Path ~/Mail/abaks/
12Inbox ~/Mail/abaks/INBOX
13Subfolders Verbatim
14
15Channel abaks
16Far :abaks-remote:
17Near :abaks-local:
18Patterns INBOX * !Sync*
19Expunge None
20CopyArrivalDate yes
21Sync All
22Create Near
23SyncState *
24
25IMAPStore gmail-remote
26Host imap.gmail.com
27Port 993
28SSLType IMAPS
29AuthMechs LOGIN
30User jdlugosz963@gmail.com
31PassCmd "pass email/jdlugosz963@gmail.com"
32CertificateFile /etc/ssl/certs/ca-certificates.crt
33
34MaildirStore gmail-local
35Path ~/Mail/gmail/
36Inbox ~/Mail/gmail/INBOX
37Subfolders Verbatim
38
39Channel gmail
40Far :gmail-remote:
41Near :gmail-local:
42Patterns INBOX * !Sync*
43Expunge None
44CopyArrivalDate yes
45Sync All
46Create Near
47SyncState *
diff --git a/files/.nix-channels b/files/.nix-channels
new file mode 100644
index 0000000..46c3d72
--- /dev/null
+++ b/files/.nix-channels
@@ -0,0 +1 @@
https://nixos.org/channels/nixos-23.11 nixos
diff --git a/files/.stumpwm.d/.gitignore b/files/.stumpwm.d/.gitignore
new file mode 100644
index 0000000..4c478cf
--- /dev/null
+++ b/files/.stumpwm.d/.gitignore
@@ -0,0 +1 @@
stumpwm.log* \ No newline at end of file
diff --git a/files/.stumpwm.d/init.lisp b/files/.stumpwm.d/init.lisp
new file mode 100755
index 0000000..0970718
--- /dev/null
+++ b/files/.stumpwm.d/init.lisp
@@ -0,0 +1,360 @@
1(in-package :stumpwm)
2
3
4(setq *message-window-gravity* :center)
5(setq *message-window-input-gravity* :center)
6(setq *input-window-gravity* :center)
7(setq *window-border-style* :none)
8
9(set-bg-color :gray10)
10(setq *mode-line-background-color* "Gray10")
11
12(set-prefix-key (kbd "C-z"))
13(setq *float-window-modifier* :super)
14
15(define-key *top-map* (kbd "s-w") "gselect")
16
17(defcommand lock () ()
18 (run-shell-command "slock"))
19
20(define-key *top-map* (kbd "s-l") "lock")
21
22(defcommand server-start () ()
23 (slynk:create-server :port 4005)
24 (message "server started at port: \"4005\"!"))
25
26
27(define-key *root-map* (kbd "C-q") "send-raw-key")
28
29(define-key *root-map* (kbd "M") "mode-line")
30(define-key *root-map* (kbd "C-n") "fnext")
31(define-key *root-map* (kbd "C-p") "fprev")
32(define-key *root-map* (kbd "b") "windowlist")
33
34
35
36;; (run-commands "gnew Code"
37;; "gnew Web"
38;; "gnew Music"
39;; "gnew Game"
40;; "gnew School")
41
42(define-remapped-keys
43 '(("(Firefox|Chrome|qutebrowser)"
44 ("C-n" . "Down")
45 ("C-p" . "Up")
46 ("C-f" . "Right")
47 ("C-b" . "Left")
48 ("C-v" . "Next")
49 ("M-v" . "Prior")
50 ("M-w" . "C-c")
51 ("C-w" . "C-x")
52 ("C-y" . "C-v")
53 ("M-<" . "Home")
54 ("M->" . "End")
55 ("C-a" . "Home")
56 ("C-e" . "End")
57 ("C-M-b" . "M-Left")
58 ("C-M-f" . "M-Right")
59 ("C-g" . "ESC")
60 ("C-k" . ("C-S-End" "C-x")))))
61
62(define-frame-preference "chat"
63 (0 NIL T :create T :class "quassel")
64 (1 NIL T :create T :class "discord")
65 (2 NIL T :create T :class "nheko"))
66
67(define-frame-preference "vm"
68 (0 NIL T :create T :class ".virt-manager-real"))
69
70(run-shell-command "~/.fehbg")
71
72(require :pamixer)
73(require :pass)
74
75(require :screenshot)
76(pamixer:volume-down 10)
77
78(defun get-brightness ()
79 (let ((c (parse-integer (string-trim
80 (string #\newline)
81 (run-shell-command "brightnessctl g" t))))
82 (m (parse-integer (string-trim
83 (string #\newline)
84 (run-shell-command "brightnessctl m" t)))))
85 (format nil "~3,1f%" (* (/ c m) 100))))
86
87(defun set-brightness (x)
88 (run-shell-command (concat "brightnessctl s " x))
89 (message (concat "Brightness: " (get-brightness))))
90
91(defcommand my-volume-down () ()
92 (pamixer:volume-down 5)
93 (message (format nil "Volume: ~s%" (pamixer:get-volume))))
94
95(defcommand my-volume-up () ()
96 (pamixer:volume-up 5)
97 (message (format nil "Volume: ~s%" (pamixer:get-volume))))
98
99(defcommand my-toggle-mute () ()
100 (pamixer:toggle-mute)
101 (if (pamixer:get-mute)
102 (message "Mute: ^2ON")
103 (message "Mute: ^1OFF")))
104
105(defcommand my-brightness-up () ()
106 (set-brightness "+5%"))
107
108(defcommand my-brightness-down () ()
109 (set-brightness "5%-"))
110
111(defcommand my-brightness-one () ()
112 (set-brightness "1"))
113
114
115(define-key *top-map* (kbd "XF86AudioMute") "my-toggle-mute")
116(define-key *top-map* (kbd "XF86AudioRaiseVolume") "my-volume-up")
117(define-key *top-map* (kbd "XF86AudioLowerVolume") "my-volume-down")
118
119(define-key *top-map* (kbd "XF86MonBrightnessUp") "my-brightness-up")
120(define-key *top-map* (kbd "XF86MonBrightnessDown") "my-brightness-down")
121
122(defun my-screenshoot-command-wrapper (screenshot-command ss-name)
123 (apply screenshot-command (list (concat
124 "~/Pictures/Screenshots/"
125 (string-trim
126 (string #\newline)
127 (run-shell-command "date +%Y-%M-%d-%T" t))
128 "-" (or ss-name "untitled")
129 ".png"))))
130
131
132(defcommand my-screenshot-area (ss-name)
133 ((:string "Screenshot name: "))
134 (my-screenshoot-command-wrapper #'screenshot:screenshot-area ss-name))
135
136(defcommand my-screenshot-window (ss-name)
137 ((:string "Screenshot name: "))
138 (my-screenshoot-command-wrapper #'screenshot:screenshot-window ss-name))
139
140(defcommand my-screenshot (ss-name)
141 ((:string "Screenshot name: "))
142 (my-screenshoot-command-wrapper #'screenshot:screenshot ss-name))
143
144(defvar *misc-keymap*
145 (let ((m (make-sparse-keymap)))
146 (define-key m (kbd "0") "my-toggle-mute")
147 (define-key m (kbd "+") "my-volume-up")
148 (define-key m (kbd "=") "my-volume-up")
149 (define-key m (kbd "-") "my-volume-down")
150
151 (define-key m (kbd "p") "pass-copy-menu")
152 (define-key m (kbd "C-p") "pass-copy-menu")
153 (define-key m (kbd "g") "pass-generate")
154 (define-key m (kbd "C-g") "pass-generate")
155
156 (define-key m (kbd "C-a") "my-screenshot-area")
157 (define-key m (kbd "a") "my-screenshot-area")
158 (define-key m (kbd "C-w") "my-screenshot-window")
159 (define-key m (kbd "w") "my-screenshot-window")
160 (define-key m (kbd "C-s") "my-screenshot")
161 (define-key m (kbd "s") "my-screenshot")
162
163 m))
164
165
166
167
168(define-key *root-map* (kbd "C-m") '*misc-keymap*)
169
170;;
171;; ;;; MODE-LINE
172(require :cpu)
173(require :mem)
174(require :net)
175
176(require :stumptray)
177(stumptray:add-mode-line-hooks)
178
179(defun update-stumptray-position (&rest args)
180 (setf (symbol-value (find-symbol "*TRAY-HEAD-SELECTION-FN*" :stumptray))
181 (if (>= (list-length (stumpwm:screen-heads (stumpwm:current-screen))) 2)
182 #'second
183 #'first)))
184
185(stumpwm:add-hook stumpwm:*new-head-hook* 'update-stumptray-position)
186(update-stumptray-position)
187
188(defun get-battery-status ()
189 (let* ((state (string-trim
190 (string #\newline)
191 (run-shell-command
192 (concat "upower -i /org/freedesktop/UPower/devices/battery_BAT0 "
193 "| grep state: "
194 "| awk '{print $2}'")
195 t)))
196 (perc (string-trim
197 (string #\newline)
198 (run-shell-command (concat
199 "upower -i /org/freedesktop/UPower/devices/battery_BAT0 "
200 "| grep perc "
201 "| awk '{print $2}'")
202 t)))
203 (perc-num (parse-integer (aref (nth-value 1 (cl-ppcre:scan-to-strings "^(.*)\%$" perc)) 0))))
204 (format
205 nil
206 (concat
207 "BAT: "
208 (cond
209 ((and (equal state "discharging")
210 (<= perc-num 20))
211 "^1[-~a]^]")
212 ((equal state "discharging") "[-~a]")
213 ((equal state "charging") "[+~a]")
214 ((equal state "fully-charged") "[~a]")
215 (t (concat state " [~a]"))))
216 perc)))
217
218
219
220(setq *screen-mode-line-format* (list "[^B%n^b] %W ^> %C | %M | %l | "
221 '(:eval (get-battery-status))
222 " " ;; empty space for stumptray icons
223 ))
224
225(require :yason) ;; json parser
226(require :drakma) ;; http client
227
228
229(defcommand kto-hakuje-p () ()
230 (let* ((response (yason:parse
231 (flexi-streams:octets-to-string
232 (drakma:http-request "https://whois.at.hsp.sh/api/now"))))
233 (users (gethash "users" response))
234 (unknown-devices (gethash "unknown_devices" response)))
235 (message (cond
236 ((and (= (list-length users) 0)
237 (= unknown-devices 0))
238 "Spejs jest pusty!")
239 ((and (= (list-length users) 0)
240 (> unknown-devices 0))
241 (format nil "W spejsie jest nieznanych ~a urzadzen." unknown-devices))
242 ((and (> (list-length users) 0)
243 (= unknown-devices 0))
244 (format nil "W spejsie jest ~a." users))
245 ((and (> (list-length users) 0)
246 (> unknown-devices 0))
247 (format nil "W spejsie jest ~a oraz ~a nieznane urzadzenia." users unknown-devices))))))
248
249
250(define-key *misc-keymap* (kbd "h") "kto-hakuje-p")
251(define-key *misc-keymap* (kbd "C-h") "kto-hakuje-p")
252
253
254(defun emacs-server-p ()
255 (let ((status-code (caddr
256 (multiple-value-list
257 (uiop:run-program "ls /run/user/$(id -u)/emacs/server"
258 :ignore-error-status T)))))
259 (= status-code 0)))
260
261(stumpwm:defcommand emacs-start-server (&optional (show-message T) (wait-for-start NIL)) ()
262 (let ((mess (if (not (emacs-server-p))
263 (progn (stumpwm:run-shell-command "emacs --daemon" wait-for-start)
264 "Emacs server is starting....")
265 "Emacs server is running already!")))
266 (when show-message (message mess))))
267
268(stumpwm:defcommand emacs-stop-server (&optional (show-message T)) ()
269 (let ((mess (if (emacs-server-p)
270 (progn (stumpwm:run-shell-command "emacsclient -e \"(server-force-delete)\"")
271 "Emacs server gone away :(....")
272 "Emacs server wasn't alive!")))
273 (when show-message (message mess))))
274
275
276(stumpwm:defcommand emacs-restart-server (&optional (show-message T)) ()
277 (emacs-stop-server NIL)
278 (emacs-start-server show-message))
279
280(defun postwalk (fun tree)
281 (if (consp tree)
282 (loop :for a :in tree
283 :if (consp a)
284 :collect (postwalk fun a)
285 :else
286 :collect (funcall fun a))
287 (funcall fun tree)))
288
289(defmacro eval-emacs-sexp (sexp
290 &key (create-new-frame NIL))
291 `(stumpwm:run-shell-command
292 (format nil "emacsclient~{ ~A~} '~A'"
293 (list ,(if create-new-frame "-c" "")
294 "-e")
295 (postwalk (lambda (x)
296 (cond
297 ((stringp x) (concat "\"" x "\""))
298 ((symbolp x) (string-downcase (string x)))
299 (T x)))
300 ,sexp))
301 ,(not create-new-frame)))
302
303
304(defmacro defcommand-from-emacs (name
305 (&rest args)
306 (&rest interactive-args)
307 (&key (create-new-frame T) (output-wrapper NIL))
308 &body body)
309 `(stumpwm:defcommand ,name ,args ,interactive-args
310 (when (not (emacs-server-p))
311 (emacs-start-server NIL T))
312
313 ,(let ((x `(eval-emacs-sexp (progn ,@body)
314 :create-new-frame ,create-new-frame)))
315 (cond
316 ((and create-new-frame output-wrapper)
317 (error "Cannot wrap the output, becaouse create-new-frame is T."))
318 (output-wrapper `(funcall ,output-wrapper ,x))
319 (T `(funcall (lambda (x) (progn x nil)) ,x))))))
320
321
322(defcommand-from-emacs emacs-client () () ()
323 nil)
324
325(defcommand-from-emacs emacs-calc () () ()
326 '(full-calc))
327
328(defcommand-from-emacs emacs-org-agenda () () ()
329 '(org-agenda-list))
330
331(defcommand-from-emacs emacs-mu4e () () ()
332 '(mu4e))
333
334(defcommand-from-emacs emacs-shell () () ()
335 '(shell))
336
337(defcommand-from-emacs emacs-eshell () () ()
338 '(eshell))
339
340(defvar *emacs-keymap*
341 (let ((e (make-sparse-keymap)))
342 (define-key e (kbd "a") "emacs-org-agenda")
343 (define-key e (kbd "C-a") "emacs-org-agenda")
344 (define-key e (kbd "c") "emacs-calc")
345 (define-key e (kbd "C-c") "emacs-calc")
346 (define-key e (kbd "m") "emacs-mu4e")
347 (define-key e (kbd "C-m") "emacs-mu4e")
348
349 e))
350
351
352
353
354(define-key *root-map* (kbd "C-e") '*emacs-keymap*)
355(define-key *root-map* (kbd "e") "emacs-client")
356(define-key *root-map* (kbd "c") "emacs-shell")
357(define-key *root-map* (kbd "C") "emacs-eshell")
358
359
360(emacs-start-server nil)