From 45bb0d11161b1c5077a1415eed6dbd0fd25ccb6a Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Fri, 20 Sep 2024 14:16:56 +0200 Subject: Change dotfiles structure, and add guix-channels declaration. --- .Xmodmap | 2 - .bash_profile | 17 - .bin/arduino-cli | 14 - .bin/chiaki | 21 -- .bin/clean.sh | 3 - .bin/download_music.sh | 26 -- .bin/esp_upload.sh | 6 - .bin/file_upload.sh | 38 --- .bin/home-reconfigure | 3 - .bin/jd-arduino-cli.Dockerfile | 16 - .bin/oath | 14 - .bin/profile-add-all | 9 - .bin/stumpish | 196 ----------- .bin/system-reconfigure | 3 - .bin/update.sh | 4 - .bin/whois-at-hsp | 84 ----- .config/dunst/dunstrc | 177 ---------- .config/guix/.gitignore | 1 - .config/guix/channels.scm | 10 - .config/picom/picom.conf | 117 ------- .config/polybar/config.ini | 122 ------- .config/qtile/autorc | 31 -- .config/qtile/config.py | 232 ------------- .config/qtile/mdt_shell | 1 - .config/qtile/photos/desktop.png | Bin 1555228 -> 0 bytes .config/qtile/python.png | Bin 52166 -> 0 bytes .config/qtile/readme.org | 5 - .config/sway/config | 193 ----------- .config/waybar/config | 159 --------- .config/waybar/style.css | 205 ------------ .emacs.d/.gitignore | 3 - .emacs.d/init.el | 146 --------- .emacs.d/jd/jd-apps.el | 49 --- .emacs.d/jd/jd-custom.el | 33 -- .emacs.d/jd/jd-dev.el | 155 --------- .emacs.d/jd/jd-exwm.el | 177 ---------- .emacs.d/jd/jd-gym.el | 120 ------- .emacs.d/jd/jd-keys.el | 50 --- .emacs.d/jd/jd-mu4e.el | 84 ----- .emacs.d/jd/jd-org.el | 217 ------------- .emacs.d/jd/jd-ui.el | 100 ------ .gitignore | 7 - .guile | 2 - .guix-channel | 13 + .mbsyncrc | 47 --- .stumpwm.d/.gitignore | 1 - .stumpwm.d/init.lisp | 360 --------------------- files/.Xmodmap | 2 + files/.bash_profile | 17 + files/.bin/arduino-cli | 14 + files/.bin/chiaki | 21 ++ files/.bin/clean.sh | 3 + files/.bin/download_music.sh | 26 ++ files/.bin/esp_upload.sh | 6 + files/.bin/file_upload.sh | 38 +++ files/.bin/guix-container | 8 + files/.bin/home-reconfigure | 3 + files/.bin/jd-arduino-cli.Dockerfile | 16 + files/.bin/mount-nas-abaks | 1 + files/.bin/oath | 14 + files/.bin/profile-add-all | 9 + files/.bin/stumpish | 196 +++++++++++ files/.bin/system-reconfigure | 3 + files/.bin/update.sh | 4 + files/.bin/whois-at-hsp | 84 +++++ files/.config/alacritty/alacritty.toml | 46 +++ files/.config/alacritty/alacritty.toml.old | 23 ++ files/.config/alacritty/alacritty.yaml | 27 ++ .../source-registry.conf.d/50-user-lisp.conf | 1 + files/.config/dunst/dunstrc | 177 ++++++++++ files/.config/guix/.gitignore | 1 + files/.config/guix/channels.scm | 19 ++ files/.config/guix/shell-authorized-directories | 10 + files/.config/picom/picom.conf | 117 +++++++ files/.config/polybar/config.ini | 122 +++++++ files/.config/qtile/autorc | 31 ++ files/.config/qtile/config.py | 232 +++++++++++++ files/.config/qtile/mdt_shell | 1 + files/.config/qtile/photos/desktop.png | Bin 0 -> 1555228 bytes files/.config/qtile/python.png | Bin 0 -> 52166 bytes files/.config/qtile/readme.org | 5 + files/.config/sway/config | 195 +++++++++++ files/.config/waybar/config | 159 +++++++++ files/.config/waybar/style.css | 205 ++++++++++++ files/.emacs.d/.gitignore | 5 + files/.emacs.d/init.el | 146 +++++++++ files/.emacs.d/jd/jd-apps.el | 49 +++ files/.emacs.d/jd/jd-custom.el | 33 ++ files/.emacs.d/jd/jd-dev.el | 177 ++++++++++ files/.emacs.d/jd/jd-exwm.el | 177 ++++++++++ files/.emacs.d/jd/jd-gym.el | 120 +++++++ files/.emacs.d/jd/jd-keys.el | 49 +++ files/.emacs.d/jd/jd-misc.el | 34 ++ files/.emacs.d/jd/jd-mu4e.el | 84 +++++ files/.emacs.d/jd/jd-org.el | 224 +++++++++++++ files/.emacs.d/jd/jd-sway.el | 18 ++ files/.emacs.d/jd/jd-ui.el | 104 ++++++ files/.gitignore | 7 + files/.guile | 2 + files/.mbsyncrc | 47 +++ files/.nix-channels | 1 + files/.stumpwm.d/.gitignore | 1 + files/.stumpwm.d/init.lisp | 360 +++++++++++++++++++++ guix/jd/desktops/base.scm | 55 ++-- guix/jd/desktops/berserker.scm | 36 ++- guix/jd/home/services/desktop.scm | 20 +- guix/jd/packages/linux.scm | 51 +++ 107 files changed, 3606 insertions(+), 3303 deletions(-) delete mode 100644 .Xmodmap delete mode 100644 .bash_profile delete mode 100755 .bin/arduino-cli delete mode 100755 .bin/chiaki delete mode 100755 .bin/clean.sh delete mode 100755 .bin/download_music.sh delete mode 100755 .bin/esp_upload.sh delete mode 100755 .bin/file_upload.sh delete mode 100755 .bin/home-reconfigure delete mode 100644 .bin/jd-arduino-cli.Dockerfile delete mode 100755 .bin/oath delete mode 100755 .bin/profile-add-all delete mode 100755 .bin/stumpish delete mode 100755 .bin/system-reconfigure delete mode 100755 .bin/update.sh delete mode 100755 .bin/whois-at-hsp delete mode 100644 .config/dunst/dunstrc delete mode 100644 .config/guix/.gitignore delete mode 100755 .config/guix/channels.scm delete mode 100644 .config/picom/picom.conf delete mode 100644 .config/polybar/config.ini delete mode 100755 .config/qtile/autorc delete mode 100644 .config/qtile/config.py delete mode 100755 .config/qtile/mdt_shell delete mode 100644 .config/qtile/photos/desktop.png delete mode 100644 .config/qtile/python.png delete mode 100644 .config/qtile/readme.org delete mode 100644 .config/sway/config delete mode 100644 .config/waybar/config delete mode 100644 .config/waybar/style.css delete mode 100644 .emacs.d/.gitignore delete mode 100755 .emacs.d/init.el delete mode 100755 .emacs.d/jd/jd-apps.el delete mode 100755 .emacs.d/jd/jd-custom.el delete mode 100755 .emacs.d/jd/jd-dev.el delete mode 100755 .emacs.d/jd/jd-exwm.el delete mode 100755 .emacs.d/jd/jd-gym.el delete mode 100755 .emacs.d/jd/jd-keys.el delete mode 100755 .emacs.d/jd/jd-mu4e.el delete mode 100755 .emacs.d/jd/jd-org.el delete mode 100755 .emacs.d/jd/jd-ui.el delete mode 100644 .gitignore delete mode 100644 .guile create mode 100644 .guix-channel delete mode 100644 .mbsyncrc delete mode 100644 .stumpwm.d/.gitignore delete mode 100755 .stumpwm.d/init.lisp create mode 100644 files/.Xmodmap create mode 100644 files/.bash_profile create mode 100755 files/.bin/arduino-cli create mode 100755 files/.bin/chiaki create mode 100755 files/.bin/clean.sh create mode 100755 files/.bin/download_music.sh create mode 100755 files/.bin/esp_upload.sh create mode 100755 files/.bin/file_upload.sh create mode 100755 files/.bin/guix-container create mode 100755 files/.bin/home-reconfigure create mode 100644 files/.bin/jd-arduino-cli.Dockerfile create mode 100755 files/.bin/mount-nas-abaks create mode 100755 files/.bin/oath create mode 100755 files/.bin/profile-add-all create mode 100755 files/.bin/stumpish create mode 100755 files/.bin/system-reconfigure create mode 100755 files/.bin/update.sh create mode 100755 files/.bin/whois-at-hsp create mode 100644 files/.config/alacritty/alacritty.toml create mode 100644 files/.config/alacritty/alacritty.toml.old create mode 100644 files/.config/alacritty/alacritty.yaml create mode 100644 files/.config/common-lisp/source-registry.conf.d/50-user-lisp.conf create mode 100644 files/.config/dunst/dunstrc create mode 100644 files/.config/guix/.gitignore create mode 100755 files/.config/guix/channels.scm create mode 100644 files/.config/guix/shell-authorized-directories create mode 100644 files/.config/picom/picom.conf create mode 100644 files/.config/polybar/config.ini create mode 100755 files/.config/qtile/autorc create mode 100644 files/.config/qtile/config.py create mode 100755 files/.config/qtile/mdt_shell create mode 100644 files/.config/qtile/photos/desktop.png create mode 100644 files/.config/qtile/python.png create mode 100644 files/.config/qtile/readme.org create mode 100644 files/.config/sway/config create mode 100644 files/.config/waybar/config create mode 100644 files/.config/waybar/style.css create mode 100644 files/.emacs.d/.gitignore create mode 100755 files/.emacs.d/init.el create mode 100755 files/.emacs.d/jd/jd-apps.el create mode 100755 files/.emacs.d/jd/jd-custom.el create mode 100755 files/.emacs.d/jd/jd-dev.el create mode 100755 files/.emacs.d/jd/jd-exwm.el create mode 100755 files/.emacs.d/jd/jd-gym.el create mode 100755 files/.emacs.d/jd/jd-keys.el create mode 100644 files/.emacs.d/jd/jd-misc.el create mode 100755 files/.emacs.d/jd/jd-mu4e.el create mode 100755 files/.emacs.d/jd/jd-org.el create mode 100644 files/.emacs.d/jd/jd-sway.el create mode 100755 files/.emacs.d/jd/jd-ui.el create mode 100644 files/.gitignore create mode 100644 files/.guile create mode 100644 files/.mbsyncrc create mode 100644 files/.nix-channels create mode 100644 files/.stumpwm.d/.gitignore create mode 100755 files/.stumpwm.d/init.lisp create mode 100644 guix/jd/packages/linux.scm diff --git a/.Xmodmap b/.Xmodmap deleted file mode 100644 index cb4706f..0000000 --- a/.Xmodmap +++ /dev/null @@ -1,2 +0,0 @@ -clear lock -keycode 0x42 = Escape diff --git a/.bash_profile b/.bash_profile deleted file mode 100644 index 14802fe..0000000 --- a/.bash_profile +++ /dev/null @@ -1,17 +0,0 @@ -# Honor per-interactive-shell startup file -if [ -f ~/.bashrc ]; then . ~/.bashrc; fi - -export GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles - -for i in $GUIX_EXTRA_PROFILES/*; do - profile=$i/$(basename "$i") - if [ -f "$profile"/etc/profile ]; then - GUIX_PROFILE="$profile" - . "$GUIX_PROFILE"/etc/profile - fi - unset profile -done - -export NIX_PATH=~/.nix-defexpr/channels/nixos/ - -. .profile diff --git a/.bin/arduino-cli b/.bin/arduino-cli deleted file mode 100755 index 7c0d41a..0000000 --- a/.bin/arduino-cli +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -if [[ $(docker images | grep jd-arduino-cli | wc -l) -eq 0 ]] -then - docker build -f "$SCRIPT_DIR/jd-arduino-cli.Dockerfile" -t jd-arduino-cli . -fi - -docker run --rm --network none -it --privileged \ - -v $(pwd):/src \ - -v jd-arduino-cli-tmp:/tmp \ - -v /dev:/dev jd-arduino-cli \ - arduino-cli $@ diff --git a/.bin/chiaki b/.bin/chiaki deleted file mode 100755 index 5fa6547..0000000 --- a/.bin/chiaki +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -CHIAKI_SHELL=/tmp/.chiaki.nix - -cat < $CHIAKI_SHELL -let - nixgl = import (fetchTarball https://github.com/guibou/nixGL/archive/main.tar.gz) { }; -in -{ nixpkgs ? import {} }: -with nixpkgs; mkShell { - buildInputs = [ - chiaki - nixgl.auto.nixGLDefault - ]; - shellHook = '' - nixGL chiaki && exit; - ''; -} -EOF - -nix-shell $CHIAKI_SHELL diff --git a/.bin/clean.sh b/.bin/clean.sh deleted file mode 100755 index 3e6bbfd..0000000 --- a/.bin/clean.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -sudo emerge --ask --depclean; diff --git a/.bin/download_music.sh b/.bin/download_music.sh deleted file mode 100755 index e3a3601..0000000 --- a/.bin/download_music.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -BOLD="\e[1"; -ENDCOLOR="\e[0m"; -Green="32"; -LightRed="31"; - -if ! [ $1 ]; then - echo "" - echo -e $BOLD";"";"$LightRed"m Please provide music url!"$ENDCOLOR - echo "" - exit -fi - -MUSIC_DIR="~/Documents/Music/%(artist)s/%(album)s/%(title)s-%(id)s.%(ext)s" -if [ $2 ]; then - MUSIC_DIR="${a}/%(artist)s/%(album)s/%(title)s-%(id)s.%(ext)s" -fi - -echo "" -echo -e $BOLD";"";"$Green"m Music will download to ${MUSIC_DIR} directory!"$ENDCOLOR -echo "" - -sleep 1 - -yt-dlp -x --audio-format mp3 --embed-metadata -o $MUSIC_DIR $1 diff --git a/.bin/esp_upload.sh b/.bin/esp_upload.sh deleted file mode 100755 index 27d8d41..0000000 --- a/.bin/esp_upload.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# rm /tmp/arduino-sketch-*/ -r -~/.local/bin/arduino-cli cache clean -~/.local/bin/arduino-cli compile --fqbn esp8266:esp8266:nodemcuv2 -~/.local/bin/arduino-cli upload -p /dev/ttyUSB0 --fqbn esp8266:esp8266:nodemcuv2 diff --git a/.bin/file_upload.sh b/.bin/file_upload.sh deleted file mode 100755 index 0ff6c57..0000000 --- a/.bin/file_upload.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -BOLD="\e[1"; -ENDCOLOR="\e[0m"; -Green="32m"; -LightRed="31m"; - -echo "" -echo -e $BOLD";"";"$Green" FILE UPLOADER"$ENDCOLOR -echo "" - -if ! [ $1 ]; then - echo "" - echo -e $BOLD";"";"$LightRed" Please provide file path!"$ENDCOLOR - echo "" - exit -fi - -if [ $1 ]; then - echo -e " Are u sure u want upload this file: "$BOLD";"";"$Green" '$1'"$ENDCOLOR"? [y/N]: " - read -p " " input - echo "" - # read -r -p " " input - case $input in - [yY][eE][sS]|[yY]) - URL=$(curl -s -F "file=@$1" https://0x0.st); - echo -e " URL: "$BOLD";"";"$Green"$URL"$ENDCOLOR; - ;; - [nN][oO]|[nN]) - echo -e $BOLD";"";"$Green" OK"$ENDCOLOR; - ;; - *) - echo -e $BOLD";"";"$LightRed" Invalid input..."$ENDCOLOR; - exit 1 - ;; - esac - echo "" -fi; diff --git a/.bin/home-reconfigure b/.bin/home-reconfigure deleted file mode 100755 index f3a4e5f..0000000 --- a/.bin/home-reconfigure +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -JD_HOME=1 guix home -L $HOME/dotfiles/guix reconfigure $HOME/dotfiles/guix/jd/desktops/$(hostname).scm diff --git a/.bin/jd-arduino-cli.Dockerfile b/.bin/jd-arduino-cli.Dockerfile deleted file mode 100644 index cb8eb91..0000000 --- a/.bin/jd-arduino-cli.Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM python:3.12-rc-slim - -RUN apt update && apt install -y wget && \ - wget https://downloads.arduino.cc/arduino-cli/nightly/arduino-cli_nightly-latest_Linux_64bit.tar.gz && \ - tar -C /usr/bin/ -xf arduino-cli_nightly-latest_Linux_64bit.tar.gz - -RUN mkdir ~/.arduino15 && \ - echo "board_manager:" > ~/.arduino15/arduino-cli.yaml && \ - echo " additional_urls:" >> ~/.arduino15/arduino-cli.yaml && \ - echo " - http://arduino.esp8266.com/stable/package_esp8266com_index.json" >> ~/.arduino15/arduino-cli.yaml - - -RUN arduino-cli core update-index && \ - arduino-cli core install esp8266:esp8266 - -WORKDIR /src \ No newline at end of file diff --git a/.bin/oath b/.bin/oath deleted file mode 100755 index 7444993..0000000 --- a/.bin/oath +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -if [[ $1 ]]; then - PASS=$(oathtool -b --totp $(pass show "oath/$1")) - printf $PASS | wl-copy - echo "pass: $PASS" - echo "Password should be in your clipboard!" -else - echo "Usage: oath " - echo "Available pass:" - pass oath -fi - - diff --git a/.bin/profile-add-all b/.bin/profile-add-all deleted file mode 100755 index bca4178..0000000 --- a/.bin/profile-add-all +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles -for i in $HOME/.config/guix/manifests/*; do - echo $i - MANIFEST_NAME=$(basename $i .scm) - mkdir -p "$GUIX_EXTRA_PROFILES"/"$MANIFEST_NAME" - guix package --manifest=$i --profile="$GUIX_EXTRA_PROFILES/$MANIFEST_NAME/$MANIFEST_NAME" -done diff --git a/.bin/stumpish b/.bin/stumpish deleted file mode 100755 index 9e95c0c..0000000 --- a/.bin/stumpish +++ /dev/null @@ -1,196 +0,0 @@ -#!/bin/sh - -# Copyright (C) 2007 Jonathan Moore Liles -# -# Maintainer: Jonathan Moore Liles -# -# stumpish is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# stumpish is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this software; see the file COPYING. If not, see -# . - -### STUMPwm Interactive SHell. - -DELAY=0.01 - -if ! sleep $DELAY 2>/dev/null >&2 -then - DELAY=1 -fi - -# replace -E with -r option for old versions of GNU sed -if ! sed -E 1p /dev/null 2>/dev/null; then - sed() { shift; command sed -r "$@"; } -fi - -# parse C-style backslash sequences by default -if [ "$(echo -e foo)" = foo ]; then - echo() { builtin echo -e "$@"; } -fi - -wait_result () -{ - while true - do - RESULT=$(xprop -root -f STUMPWM_COMMAND_RESULT 8s \ - STUMPWM_COMMAND_RESULT 2>/dev/null | - sed -E 's/\\([[:digit:]]+)/\\0\1/g') - if echo "$RESULT" | grep -v -q 'not found.$' - then - break - fi - - sleep $DELAY - done - - xprop -root -remove STUMPWM_COMMAND_RESULT - - if echo "$RESULT" | grep -q '= $' - then - return 0 - fi - - echo "$RESULT" | - sed -E 's/[^"\\n]+"// - /^"[[:space:]]*$/d - s/(^|[^\\])\\n/\1\ -/g - s/\\(["\\n])/\1/g - s/\^([*[:digit:]]+|[Bbn])//g' -} - -send_cmd () -{ - local cmd="$1" - - if [ "$cmd" = "stumpwm-quit" ] - then - cmd=quit - elif [ "$cmd" = "quit" ] - then - exit - fi - - xprop -root -f STUMPWM_COMMAND 8s -set STUMPWM_COMMAND "$cmd" - - wait_result -} - -usage () -{ - cat <&2 -} - -tput () -{ - local cap1=$1 cap2=$2 - shift 2 - - command tput $cap1 $@ 2>/dev/null || - command tput $cap2 $@ 2>/dev/null -} - -READLINE=yes - -if [ "x$1" = "x-r" ] -then - READLINE=no - shift 1 -fi - -if [ $# -gt 0 ] -then - [ "$1" = "--help" ] && usage - if [ "$1" = "-e" ] - then - if [ $# -ne 2 ] - then - echo "'-e' requires exactly one argument!" - exit - fi - shift 1 - IFS='' - ARGS=$(cat /dev/stdin) - send_cmd "$1 $ARGS" - else - IFS=' ' - send_cmd "$*" - fi -else - if [ -t 0 ] - then - if ! type rlwrap 2>/dev/null >&2 - then - warn rlwrap not found, command completion won\'t work - elif [ $READLINE = yes ] - then - COMMANDS="${TMPDIR:-/tmp}/stumpish.commands.$$" - echo $(send_cmd "commands") | - sed -E 's/[[:space:]]+/\ -/g' | - sort > "$COMMANDS" - trap 'rm -f "$COMMANDS"' exit int term - rlwrap -b '' -f "$COMMANDS" "$0" -r - exit - fi - - tput AF setaf 5 - echo Welcome to the STUMPwm Interactive SHell. - tput me sgr0 - echo 'Type \c' - tput AF setaf 2 - echo 'commands\c' - tput me sgr0 - echo \ for a list of commands. - - while read -p '> ' REPLY - do - tput md bold - tput AF setaf 2 - send_cmd "$REPLY" - tput me sgr0 - done - else - while read REPLY - do - send_cmd "$REPLY" - done - fi -fi diff --git a/.bin/system-reconfigure b/.bin/system-reconfigure deleted file mode 100755 index c4c1a05..0000000 --- a/.bin/system-reconfigure +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -sudo -E guix system -L $HOME/dotfiles/guix reconfigure $HOME/dotfiles/guix/jd/desktops/$(hostname).scm \ No newline at end of file diff --git a/.bin/update.sh b/.bin/update.sh deleted file mode 100755 index e6f9f8d..0000000 --- a/.bin/update.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -sudo emerge --sync -sudo emerge --ask --verbose --update --newuse --deep @world; diff --git a/.bin/whois-at-hsp b/.bin/whois-at-hsp deleted file mode 100755 index 0cd03f7..0000000 --- a/.bin/whois-at-hsp +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env -S guix shell guile guile-json -- guile --no-auto-compile -e main -s --*- scheme -*- -!# - -(use-modules (srfi srfi-1) - (ice-9 iconv) - (ice-9 receive) - (web client) - (json)) - -(define whois-at-hsp-endpoint "https://whois.at.hsp.sh/api/now") - -(define (http-get-serialize-json url) - (receive (response data) (http-request url) - (values (json-string->scm (bytevector->string data "UTF-8")) - response))) - -(define (whois-data->users whois-data) - (assoc-ref whois-data "users")) - -(define (whois-data->unknown-devices whois-data) - (assoc-ref whois-data "unknown_devices")) - -(define (whois-data->head-count whois-data) - (assoc-ref whois-data "headcount")) - -(define (whois-data->formated-users whois-data) - (let ((users (vector->list (whois-data->users whois-data)))) - (if (> (length users) 0) - (fold-right - (lambda (a b) (string-append a " " b)) - "" - users) - "No visible users!"))) - -(define (whois-data->summary whois-data) - (string-append - "Unknown devices: " - (number->string (whois-data->unknown-devices whois-data)) - "\nUsers: [" (number->string (whois-data->head-count whois-data)) "] " - (whois-data->formated-users whois-data))) - -(define (notify data) - (system* "notify-send" - "WHOIS AT HSP" - (whois-data->summary data))) - -(define (command-line-option? option args) - (> (length (or (member option args) - '())) - 0)) - -(define-syntax-rule (command-line-args-handle args default ((option ...) body ...) ...) - (let ((option? (lambda (o) (command-line-option? o args))) - (something-executed? #f)) - (when (or (option? option) ...) - (set! something-executed? #t) - body ...) ... - (when (not something-executed?) - default))) - -(define (main args) - (let ((whois-data (http-get-serialize-json whois-at-hsp-endpoint))) - (command-line-args-handle args - (begin (display (whois-data->summary whois-data)) - (newline)) - (("-h" "--help") - (display (string-append "-h, --help Help message\n" - "-n, --notify Notification massage with whois information.\n" - "-u Get users\n" - "-H Get head count\n" - "-U Get unknown devices\n"))) - (("-n" "--notify") - (notify whois-data)) - (("-u") - (display (whois-data->formated-users whois-data)) - (newline)) - (("-H") - (display (whois-data->head-count whois-data)) - (newline)) - (("-U") - (display (whois-data->unknown-devices whois-data)) - (newline))))) - diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc deleted file mode 100644 index b3b93b6..0000000 --- a/.config/dunst/dunstrc +++ /dev/null @@ -1,177 +0,0 @@ -[global] -frame_width = 2 -frame_color = "#39bae6" -font = sourcecodepro - -# Allow a small subset of html markup: -# bold -# italic -# strikethrough -# underline -# -# For a complete reference see -# . -# If markup is not allowed, those tags will be stripped out of the -# message. -markup = yes - -# The format of the message. Possible variables are: -# %a appname -# %s summary -# %b body -# %i iconname (including its path) -# %I iconname (without its path) -# %p progress value if set ([ 0%] to [100%]) or nothing -# Markup is allowed -format = "%s %p\n%b" - -# Sort messages by urgency. -sort = yes - -# Show how many messages are currently hidden (because of geometry). -indicate_hidden = yes - -# Alignment of message text. -# Possible values are "left", "center" and "right". -alignment = left - -# The frequency with wich text that is longer than the notification -# window allows bounces back and forth. -# This option conflicts with "word_wrap". -# Set to 0 to disable. -bounce_freq = 5 - - -# Show age of message if message is older than show_age_threshold -# seconds. -# Set to -1 to disable. -show_age_threshold = 60 - -# Split notifications into multiple lines if they don't fit into -# geometry. -word_wrap = no - -# Ignore newlines '\n' in notifications. -ignore_newline = no - - -# The geometry of the window: -# [{width}]x{height}[+/-{x}+/-{y}] -# The geometry of the message window. -# The height is measured in number of notifications everything else -# in pixels. If the width is omitted but the height is given -# ("-geometry x2"), the message window expands over the whole screen -# (dmenu-like). If width is 0, the window expands to the longest -# message displayed. A positive x is measured from the left, a -# negative from the right side of the screen. Y is measured from -# the top and down respectevly. -# The width can be negative. In this case the actual width is the -# screen width minus the width defined in within the geometry option. -geometry = "500x10-10+50" - -# Shrink window if it's smaller than the width. Will be ignored if -# width is 0. -shrink = yes - -# The transparency of the window. Range: [0; 100]. -# This option will only work if a compositing windowmanager is -# present (e.g. xcompmgr, compiz, etc.). -transparency = 15 - -# Don't remove messages, if the user is idle (no mouse or keyboard input) -# for longer than idle_threshold seconds. -# Set to 0 to disable. -# default 120 -idle_threshold = 120 - -# Which monitor should the notifications be displayed on. -monitor = 0 - -# Display notification on focused monitor. Possible modes are: -# mouse: follow mouse pointer -# keyboard: follow window with keyboard focus -# none: don't follow anything -# -# "keyboard" needs a windowmanager that exports the -# _NET_ACTIVE_WINDOW property. -# This should be the case for almost all modern windowmanagers. -# -# If this option is set to mouse or keyboard, the monitor option -# will be ignored. -follow = mouse - -# Should a notification popped up from history be sticky or timeout -# as if it would normally do. -sticky_history = yes - -# Maximum amount of notifications kept in history -history_length = 20 - -# Display indicators for URLs (U) and actions (A). -show_indicators = yes - -# The height of a single line. If the height is smaller than the -# font height, it will get raised to the font height. -# This adds empty space above and under the text. -line_height = 0 - -# Draw a line of "separator_height" pixel height between two -# notifications. -# Set to 0 to disable. -separator_height = 1 - -# Padding between text and separator. -# padding = 8 -padding = 8 - -# Horizontal padding. -horizontal_padding = 10 - -# Define a color for the separator. -# possible values are: -# * auto: dunst tries to find a color fitting to the background; -# * foreground: use the same color as the foreground; -# * frame: use the same color as the frame; -# * anything else will be interpreted as a X color. -separator_color = #263238 - -# Print a notification on startup. -# This is mainly for error detection, since dbus (re-)starts dunst -# automatically after a crash. -startup_notification = false - -# dmenu path. -dmenu = /usr/bin/dmenu -p dunst: - -# Browser for opening urls in context menu. -browser = palemoon - -# Align icons left/right/off -icon_position = left - -# Limit icons size. -max_icon_size=128 - -[urgency_low] -# IMPORTANT: colors have to be defined in quotation marks. -# Otherwise the "#" and following would be interpreted as a comment. -background "#0d1017" -foreground = "#888888" -timeout = 10 -# Icon for notifications with low urgency, uncomment to enable -#icon = /path/to/icon - -[urgency_normal] -background = "#1e2128" -foreground = "#ffffff" -timeout = 10 -# Icon for notifications with normal urgency, uncomment to enable -#icon = /path/to/icon - -[urgency_critical] -background = "#900000" -foreground = "#ffffff" -frame_color = "#ff0000" -timeout = 0 -# Icon for notifications with critical urgency, uncomment to enable -#icon = /path/to/icon diff --git a/.config/guix/.gitignore b/.config/guix/.gitignore deleted file mode 100644 index 1f4ddec..0000000 --- a/.config/guix/.gitignore +++ /dev/null @@ -1 +0,0 @@ -current \ No newline at end of file diff --git a/.config/guix/channels.scm b/.config/guix/channels.scm deleted file mode 100755 index 0554922..0000000 --- a/.config/guix/channels.scm +++ /dev/null @@ -1,10 +0,0 @@ -(cons* (channel - (name 'nonguix) - (url "https://gitlab.com/nonguix/nonguix") - ;; Enable signature verification: - (introduction - (make-channel-introduction - "897c1a470da759236cc11798f4e0a5f7d4d59fbc" - (openpgp-fingerprint - "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5")))) - %default-channels) diff --git a/.config/picom/picom.conf b/.config/picom/picom.conf deleted file mode 100644 index 0f3fe1d..0000000 --- a/.config/picom/picom.conf +++ /dev/null @@ -1,117 +0,0 @@ -# ____ _____ -# | _ \_ _| Derek Taylor (DistroTube) -# | | | || | http://www.youtube.com/c/DistroTube -# | |_| || | http://www.gitlab.com/dwt1/ -# |____/ |_| -# -# My config. Not much to see here; just some pretty standard stuff. - -# Enabled client-side shadows on windows. Note desktop windows -# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, -# unless explicitly requested using the wintypes option. -# -shadow = true; - -# The blur radius for shadows, in pixels. (defaults to 12) -shadow-radius = 8; - -# The opacity of shadows. (0.0 - 1.0, defaults to 0.75) -shadow-opacity = .6 - -# The left offset for shadows, in pixels. (defaults to -15) -shadow-offset-x = -3; - -# The top offset for shadows, in pixels. (defaults to -15) -shadow-offset-y = -3; - -# Specify a list of conditions of windows that should have no shadow. -# -# examples: -# shadow-exclude = "n:e:Notification"; -# -# shadow-exclude = [] -shadow-exclude = [ - "name = 'Notification'", - "class_g = 'Conky'", - "class_g ?= 'Notify-osd'", - "class_g = 'Cairo-clock'", - "class_g = 'slop'", - "class_g = 'Polybar'", - "_GTK_FRAME_EXTENTS@:c" -]; - - -# Fade windows in/out when opening/closing and when opacity changes, -# unless no-fading-openclose is used. -# fading = false -fading = true; - -# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) -# fade-in-step = 0.028 -fade-in-step = 0.3; - -# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03) -# fade-out-step = 0.03 -fade-out-step = 0.3; - -# The time between steps in fade step, in milliseconds. (> 0, defaults to 10) -# fade-delta = 10 - -# Specify a list of conditions of windows that should not be faded. -# don't need this, we disable fading for all normal windows with wintypes: {} -fade-exclude = [ - "class_g = 'slop'" # maim -] - -# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0) -inactive-opacity = 0.9 -# inactive-opacity = 1.0; - -# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default) -# frame-opacity = 1.0 -frame-opacity = 0.7; - -# Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0) -# menu-opacity = 1.0 -# menu-opacity is depreciated use dropdown-menu and popup-menu instead. - -#If using these 2 below change their values in line 510 & 511 aswell -popup_menu = { opacity = 0.8; } -dropdown_menu = { opacity = 0.8; } - - -# Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows. -# inactive-opacity-override = true -inactive-opacity-override = false; - -# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0) -active-opacity = 1.0; - -# Dim inactive windows. (0.0 - 1.0, defaults to 0.0) -# inactive-dim = 0.0 - -# Specify a list of conditions of windows that should always be considered focused. -# focus-exclude = [] -focus-exclude = [ - "class_g = 'Cairo-clock'", - "class_g = 'Bar'", # lemonbar - "class_g = 'slop'" # maim -]; - -opacity-rule = [ - "100:class_g = 'XTerm'", - "100:class_g = 'URxvt'", - "100:class_g = 'firefox'", - "100:class_g = 'Thunderbird'" -]; - -wintypes: -{ - normal = { fade = false; shadow = true; } - tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; - dock = { shadow = false; } - dnd = { shadow = true; } - popup_menu = { opacity = 0.8; } - dropdown_menu = { opacity = 0.8; } -}; - diff --git a/.config/polybar/config.ini b/.config/polybar/config.ini deleted file mode 100644 index d43ee51..0000000 --- a/.config/polybar/config.ini +++ /dev/null @@ -1,122 +0,0 @@ -[settings] -screenchange-reload = true - -[colors] -background = ${xrdb:emacs.background} -foreground = ${xrdb:emacs.foreground} -primary = #7fd962 -disabled = #707880 - -[bar/example] -width = 100% -height = 18pt - -background = ${colors.background} -foreground = ${colors.foreground} - -line-size = 1.5pt - -padding-left = 0 -padding-right = 1 - -module-margin = 1 - -separator = | -separator-foreground = ${colors.disabled} - -font-0 = "Terminus:size=15" -font-1 = "FontAwesome" - -modules-left = xworkspaces -modules-right = memory cpu battery date - -cursor-click = pointer -cursor-scroll = ns-resize - -enable-ipc = true - -tray-position = right - -[module/xworkspaces] -type = internal/xworkspaces - -icon-0 = 1;0 -icon-1 = 2;1 -icon-2 = 3;2 -icon-3 = 4;3 -icon-4 = 5;4 -icon-5 = 6;5 -icon-6 = 7;6 -icon-7 = 8;7 -icon-8 = 9;8 -icon-9 = 10;9 - -label-active = %icon% -label-active-background = ${colors.background-alt} -label-active-underline= ${colors.primary} -label-active-padding = 1 - -label-occupied = %icon% -label-occupied-padding = 1 - -label-urgent = %icon% -label-urgent-background = ${colors.alert} -label-urgent-padding = 1 - -label-empty = %icon% -label-empty-foreground = ${colors.disabled} -label-empty-padding = 1 - -[module/battery] -type = internal/battery -battery = BAT0 -adapter = ADP1 - -format-charging = -format-discharging = -format-low = -format-full = - -label-charging = %percentage%% -label-discharging = %percentage%% -label-low = LOW %percentage%% -label-full = FULL %percentage%% - -ramp-capacity-0 =  -ramp-capacity-1 =  -ramp-capacity-2 =  -ramp-capacity-3 =  -ramp-capacity-4 =  -ramp-capacity-foreground = ${colors.primary} - -animation-charging-0 =  -animation-charging-1 =  -animation-charging-2 =  -animation-charging-3 =  -animation-charging-4 =  -animation-charging-foreground = ${colors.primary} -animation-charging-framerate = 750 - -[module/memory] -type = internal/memory -interval = 2 -format-prefix = "RAM " -format-prefix-foreground = ${colors.primary} -label = %percentage_used:2%% - -[module/cpu] -type = internal/cpu -interval = 2 -format-prefix = "CPU " -format-prefix-foreground = ${colors.primary} -label = %percentage:2%% - -[module/date] -type = internal/date -interval = 1 - -date = %H:%M -date-alt = %Y-%m-%d %H:%M:%S - -label = %date% -label-foreground = ${colors.primary} diff --git a/.config/qtile/autorc b/.config/qtile/autorc deleted file mode 100755 index c54f683..0000000 --- a/.config/qtile/autorc +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -function monitor_settings() { - sleep .5 - monitor_status=$(xrandr | grep "HDMI-1-4 connected" | wc -l) - - if [ $monitor_status == 1 ]; - then - # xrandr --auto - # xrandr --output eDP-1 --off - xrandr --output eDP-1-1 --auto --output HDMI-0 --auto --left-of eDP-1-1 - fi -} - -function caps_to_esc(){ xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'; } - -function start() { - killall $1 - sleep .5 - $($1 $2) & -} - -# monitor_settings -caps_to_esc - -start nitrogen "--restore" -start picom "" -start spotifyd "" -start rclone "mount remote:/sync /home/jakub/Sync" -start emacs "--daemon" -xinput set-prop 11 344 1 diff --git a/.config/qtile/config.py b/.config/qtile/config.py deleted file mode 100644 index 9106731..0000000 --- a/.config/qtile/config.py +++ /dev/null @@ -1,232 +0,0 @@ -import os -import subprocess - -from typing import List - -from libqtile import bar, layout, widget -from libqtile.config import Click, Drag, Group, Key, Match, Screen, KeyChord -from libqtile import extension -from libqtile.lazy import lazy -from libqtile.utils import guess_terminal -from libqtile import hook - -MOD = "mod4" - -TERMINAL = guess_terminal() - -DMENU_FLAGS = '-l 16 -p run -c -i' - -BAR = '#282a36' -LIGHT_BAR = '#393b37' -YELLOW = '#f1fa8c' -RED = '#ff5555' -LIGHT_RED = '#ff9999' -GREEN = '#50fa7b' -CYAN = '#8be9fd' -LIGHT_CYAN = '#abfbff' - -@hook.subscribe.startup_once -def autostart(): - home = os.path.expanduser('~/.config/qtile/autorc') - subprocess.run([home]) - -keys = [ - Key([MOD], "h", lazy.layout.left(), desc="Move focus to left"), - Key([MOD], "l", lazy.layout.right(), desc="Move focus to right"), - Key([MOD], "j", lazy.layout.down(), desc="Move focus down"), - Key([MOD], "k", lazy.layout.up(), desc="Move focus up"), - Key([MOD], "s", lazy.next_screen() ), - Key([MOD], "space", lazy.window.toggle_floating(), - desc="Move window focus to other window"), - - Key([MOD, "shift"], "h", lazy.layout.shuffle_left(), - desc="Move window to the left"), - Key([MOD, "shift"], "l", lazy.layout.shuffle_right(), - desc="Move window to the right"), - Key([MOD, "shift"], "j", lazy.layout.shuffle_down(), - desc="Move window down"), - Key([MOD, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"), - - Key([MOD, "control"], "h", lazy.layout.grow_left(), - desc="Grow window to the left"), - Key([MOD, "control"], "l", lazy.layout.grow_right(), - desc="Grow window to the right"), - Key([MOD, "control"], "j", lazy.layout.grow_down(), - desc="Grow window down"), - Key([MOD, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"), - Key([MOD], "n", lazy.layout.normalize(), desc="Reset all window sizes"), - - Key([MOD, "shift"], "Return", lazy.layout.toggle_split(), - desc="Toggle between split and unsplit sides of stack"), - Key([MOD], "Return", lazy.spawn(TERMINAL), desc="Launch terminal"), - - Key([MOD], "Tab", lazy.next_layout(), desc="Toggle between layouts"), - Key([MOD], "c", lazy.window.kill(), desc="Kill focused window"), - - Key([MOD, "control"], "r", lazy.restart(), desc="Restart Qtile"), - Key([MOD, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), - - Key([MOD], "F12", os.system("xbacklight -inc 10"), desc="Inc backlight"), - Key([MOD], "F11", os.system("xbacklight -dec 10"), desc="Dec backlight"), - - Key([MOD], "r", lazy.spawncmd(), - desc="Spawn a command using a prompt widget"), - - KeyChord([MOD], "p", [ - Key([], "p", lazy.spawn(f"dmenu_run {DMENU_FLAGS}"), desc="Spawn dmenu run"), - Key([], "n", lazy.spawn(f"networkmanager_dmenu {DMENU_FLAGS}"), desc="Spawn dmenu for network manager"), - ]), - - Key([MOD, "mod1"], "q", lazy.spawn("qutebrowser"), desc="Spawn qutebrowser"), - Key([MOD, "mod1"], "b", lazy.spawn("brave"), desc="Spawn brave"), - Key([MOD, "mod1"], "f", lazy.spawn("firefox"), desc="Spawn firefox"), - - KeyChord([MOD], "e", [ - Key([], "e", lazy.spawn("emacsclient -c -a 'emacs'"), desc="Spawn Emacsclient"), - Key([], "d", lazy.spawn("emacsclient -c -a 'emacs' --eval '(dired nil)'"), desc='Emacsclient Dired'), - Key([], "m", lazy.spawn("emacsclient -c -a 'emacs' --eval '(emms-browser)'"), desc='Emacsclient Dired'), - ]), - - Key([MOD, "mod1"], "s", lazy.spawn("alacritty -e spt"), desc="Spawn spt (spotify clent)"), - Key([MOD, "mod1"], "l", lazy.spawn("slock"), desc="lock desktop"), - Key([MOD, "mod1"], "r", lazy.spawn("alacritty -e ranger"), desc="Spawn ranger (file manager)"), - Key([MOD, "mod1"], "p", lazy.spawn("alacritty -e pulsemixer"), desc="Spawn pulsemixer"), -] - -groups_names = [ - "dev", - "www", - "music", - "virt", - "sys", - "other" -] - -groups = [Group(i) for i in groups_names] -for i, group in enumerate(groups): - keys.extend([ - Key([MOD], str(i+1), lazy.group[group.name].toscreen(), - desc="Switch to group {}".format(group.name)), - - Key([MOD, "shift"], str(i+1), lazy.window.togroup(group.name, switch_group=True), - desc="Switch to & move focused window to group {}".format(group.name)), - ]) - -mouse = [ - Drag([MOD], "Button1", lazy.window.set_position_floating(), - start=lazy.window.get_position()), - Drag([MOD], "Button3", lazy.window.set_size_floating(), - start=lazy.window.get_size()), - Click([MOD], "Button2", lazy.window.bring_to_front()) -] - -layout_cfg = { - 'border_width': 2, - 'border_normal': "#bb8888", - 'border_focus': "884444", - 'margin': 8 -} - -layouts = [ - # layout.Columns(**layout_cfg), - # layout.Max(), - layout.Stack(num_stacks=1, **layout_cfg), - # layout.Bsp(), - # layout.Matrix(), - layout.MonadTall(**layout_cfg), - # layout.MonadWide(), - # layout.RatioTile(), - # layout.Tile(), - # layout.TreeTab(), - # layout.VerticalTile(), - # layout.Zoomy(), -] - -widget_defaults = dict( - font='sans', - fontsize=12, - padding=6, -) - -transparent_sep = { - 'foreground': BAR, - 'margin': 2 -} - -soft_sep = { - 'foreground': '44475a', - 'padding': 2, - 'margin': 4 -} - -screens = [ - Screen( - top=bar.Bar( - [ - widget.Sep(**transparent_sep), - widget.Image(filename="~/.config/qtile/python.png", margin=4), - widget.Sep(**transparent_sep), - widget.CurrentLayout(), - widget.Sep(**transparent_sep), - widget.GroupBox( - margin_y = 3, - margin_x = 0, - padding_y = 5, - padding_x = 3, - borderwidth = 3, - rounded = False, - highlight_color = LIGHT_BAR, - highlight_method = "line", - this_current_screen_border = CYAN, - this_screen_border = CYAN, - other_current_screen_border = LIGHT_BAR, - other_screen_border = LIGHT_BAR, - ), - widget.Prompt(), - widget.Sep(**transparent_sep), - widget.WindowName(), - widget.Net(format="🌐 ↓{down} ↑{up}", foreground=YELLOW), - widget.Sep(**soft_sep), - widget.CPU(format='💻 {load_percent}%', fontsize=12, foreground=RED), - widget.Sep(**soft_sep), - widget.Battery(format='🔋 {char} {percent:2.0%} {hour:d}:{min:02d} {watt:.2f} W', foreground=GREEN), - widget.Sep(**soft_sep), - widget.Clock(format='📅 %B %-d, %H:%M', foreground=CYAN), - widget.Sep(**soft_sep), - widget.CurrentScreen(), - widget.Sep(**soft_sep), - widget.Systray() - ], - 24, - margin=8, - background=BAR, - border_color=CYAN, - border_width=1 - ), - ), -] - -floating_layout = layout.Floating(float_rules=[ - # Run the utility of `xprop` to see the wm class and name of an X client. - *layout.Floating.default_float_rules, - Match(wm_class='confirmreset'), # gitk - Match(wm_class='makebranch'), # gitk - Match(wm_class='maketag'), # gitk - Match(wm_class='ssh-askpass'), # ssh-askpass - Match(title='branchdialog'), # gitk - Match(title='pinentry'), # GPG key password entry -]) - -dgroups_key_binder = None -dgroups_app_rules = [] - -follow_mouse_focus = True -bring_front_click = False -cursor_warp = False -auto_fullscreen = True -focus_on_window_activation = "smart" -reconfigure_screens = True - -auto_minimize = True - -wmname = "LG3D" diff --git a/.config/qtile/mdt_shell b/.config/qtile/mdt_shell deleted file mode 100755 index 90fa6f3..0000000 --- a/.config/qtile/mdt_shell +++ /dev/null @@ -1 +0,0 @@ -TERM=xterm-256color /home/jakub/.local/bin/mdt shell diff --git a/.config/qtile/photos/desktop.png b/.config/qtile/photos/desktop.png deleted file mode 100644 index 8fca190..0000000 Binary files a/.config/qtile/photos/desktop.png and /dev/null differ diff --git a/.config/qtile/python.png b/.config/qtile/python.png deleted file mode 100644 index 9a4b1ed..0000000 Binary files a/.config/qtile/python.png and /dev/null differ diff --git a/.config/qtile/readme.org b/.config/qtile/readme.org deleted file mode 100644 index 235dd47..0000000 --- a/.config/qtile/readme.org +++ /dev/null @@ -1,5 +0,0 @@ -#+title: Config - -* Qtile conifg -- My personal qtile config ;) - [[./photos/desktop.png]] diff --git a/.config/sway/config b/.config/sway/config deleted file mode 100644 index 2807f08..0000000 --- a/.config/sway/config +++ /dev/null @@ -1,193 +0,0 @@ -set $mod Mod4 - -set $left h -set $down j -set $up k -set $right l - -set $term alacritty -set $emacs emacsclient -c -set $menu fuzzel -r0 -b 282828f2 -C 458588f2 -B 3 -s 458588f2 -S 282828FF --font "Terminus:size=12" -p "run: " - -set $laptop-display eDP-1 -set $generic-display HDMI-A-1 -set $primary-home-display 'Iiyama North America PLE2407HDSD 0x01010101' -set $secondary-home-display 'Dell Inc. DELL E190S M8VPV186CELI' - -set $primary-display-layout $primary-home-display $generic-display $laptop-display -set $secondary-display-layout $secondary-home-display $laptop-display - -output * bg SPOILER_33.png fill - -output $laptop-display resolution 1920x1080 position 1920,0 -output $generic-display resolution 1920x1080 position 0,0 -output $primary-home-display resolution 1920x1080 position 0,0 -output $secondary-home-display resolution 1280x1024 position 1920,0 -set $opacity 0.9 - -client.focused #002b36 #586e75 #eee8d5 #268bd2 -client.focused_inactive #002b36 #073642 #93a1a1 #268bd2 -client.unfocused #002b36 #073642 #93a1a1 #268bd2 -client.urgent #002b36 #dc322f #fdf6e3 #002b36 - -input type:keyboard { - xkb_layout pl,us -} - -input type:touchpad { - tap enabled - middle_emulation enabled -} - -bindsym $mod+Shift+s output $laptop-display toggle - -set $swaylock 'swaylock -f -c 000000 --font "Terminus"' -exec swayidle -w \ - timeout 280 $swaylock \ - timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ - before-sleep $swaylock - -# inhibit_idle fullscreen - -bindsym $mod+Escape exec $swaylock - -bindsym XF86MonBrightnessUp exec brightnessctl set 5%+ -bindsym XF86MonBrightnessDown exec brightnessctl set 5%- - -bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle -bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% -bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% - -bindsym XF86AudioNext exec playerctl next -bindsym XF86AudioPrev exec playerctl previous -bindsym XF86AudioPlay exec playerctl play-pause -bindsym XF86AudioPause exec playerctl pause - -bindsym print exec grimshot --notify copy area -bindsym $mod+print exec grimshot --notify copy output - -bindsym $mod+Return exec $term - -bindsym $mod+Shift+q kill - -floating_modifier $mod normal - -bindsym $mod+Shift+c reload -bindsym $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' - -bindsym $mod+$left focus left -bindsym $mod+$down focus down -bindsym $mod+$up focus up -bindsym $mod+$right focus right - -bindsym $mod+Shift+$left move left -bindsym $mod+Shift+$down move down -bindsym $mod+Shift+$up move up -bindsym $mod+Shift+$right move right - -workspace 1 output $primary-display-layout -workspace 2 output $primary-display-layout -workspace 3 output $secondary-display-layout -workspace 4 output $secondary-display-layout -workspace 9 output $primary-display-layout -workspace 10 output $secondary-display-layout - -bindsym $mod+1 workspace number 1 -bindsym $mod+2 workspace number 2 -bindsym $mod+3 workspace number 3 -bindsym $mod+4 workspace number 4 -bindsym $mod+5 workspace number 5 -bindsym $mod+6 workspace number 6 -bindsym $mod+7 workspace number 7 -bindsym $mod+8 workspace number 8 -bindsym $mod+9 workspace number 9 -bindsym $mod+0 workspace number 10 - -bindsym $mod+Shift+1 move container to workspace number 1 -bindsym $mod+Shift+2 move container to workspace number 2 -bindsym $mod+Shift+3 move container to workspace number 3 -bindsym $mod+Shift+4 move container to workspace number 4 -bindsym $mod+Shift+5 move container to workspace number 5 -bindsym $mod+Shift+6 move container to workspace number 6 -bindsym $mod+Shift+7 move container to workspace number 7 -bindsym $mod+Shift+8 move container to workspace number 8 -bindsym $mod+Shift+9 move container to workspace number 9 -bindsym $mod+Shift+0 move container to workspace number 10 - -assign [app_id="(firefox-default|qutebrowser|Chromium-browser)"] 2 -assign [instance="(chromium-browser)"] 2 -assign [instance="(spotify)"] 3 -assign [app_id=".blueman-manager-real"] 3 -assign [app_id="pavucontrol"] 3 -assign [app_id="(org.telegram.desktop)"] 4 -assign [app_id="vesktop"] 4 -assign [app_id="com.ktechpit.whatsie"] 4 -assign [instance="(discord)"] 4 - -for_window [app_id="vesktop"] opacity $opacity - - -bindsym $mod+b splith -bindsym $mod+v splitv - -bindsym $mod+s layout stacking -bindsym $mod+w layout tabbed -bindsym $mod+e layout toggle split - -bindsym $mod+f fullscreen -bindsym $mod+Shift+space floating toggle -bindsym $mod+space focus mode_toggle -bindsym $mod+a focus parent - -bindsym $mod+Shift+minus move scratchpad -bindsym $mod+minus scratchpad show - -mode "resize" { - bindsym $left resize shrink width 10px - bindsym $down resize grow height 10px - bindsym $up resize shrink height 10px - bindsym $right resize grow width 10px - - bindsym Return mode "default" - bindsym Control+g mode "default" - bindsym Escape mode "default" -} -bindsym $mod+r mode "resize" - -set $default swaymsg mode default -mode "menu" { - bindsym --no-repeat e exec '$default; $emacs;' - bindsym --no-repeat w exec "$default; whois-at-hsp -n" - - bindsym Return mode "default" - bindsym Control+g mode "default" - bindsym Escape mode "default" - -} -bindsym $mod+o mode "menu" - - -workspace_layout tabbed - -default_border normal 3 -gaps outer 0 -gaps inner 6 -font Terminus (TTF) 12 -corner_radius 4 -blur_xray disable -blur enable -layer_effects "waybar" blur enable -bindsym $mod+p exec $menu - - -# Taken from dawivil dotfiles. -exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway - -# exec udiskie -t -exec mako --font "Terminus (TTF)" --outer-margin=5 --margin=3 --border-size=3 --default-timeout=7000 --background="#282828e0" - -exec nm-applet --indicator -exec blueman-applet -exec waybar -exec udiskie -t -exec wlsunset -l 51.919438 -L 19.145136 diff --git a/.config/waybar/config b/.config/waybar/config deleted file mode 100644 index 5ebee30..0000000 --- a/.config/waybar/config +++ /dev/null @@ -1,159 +0,0 @@ -{ - "layer": "top", - "position": "top", - - "modules-left": [ - "sway/workspaces", - "sway/mode" - ], - - "modules-right": [ -// "custom/whois", - "pulseaudio", - "network", - "memory", - "cpu", - "temperature", - "battery", - "sway/language", - "clock#date", - "clock#time", - "idle_inhibitor", - "tray" - ], - - // Modules - "idle_inhibitor": { - "format": "{icon}", - "format-icons": { - "activated": "", - "deactivated": "" - } - }, - - "battery": { - "interval": 10, - "states": { - "warning": 30, - "critical": 15 - }, - "format-time": "{H}:{M:02}", - "format": "{icon} {capacity}% ({time})", - "format-charging": " {capacity}% ({time})", - "format-charging-full": " {capacity}%", - "format-full": "{icon} {capacity}%", - "format-alt": "{icon} {power}W", - "format-icons": [ - "", - "", - "", - "", - "" - ], - "tooltip": false - }, - - "clock#time": { - "interval": 10, - "format": "{:%H:%M}", - "tooltip": false - }, - - "clock#date": { - "interval": 20, - "format": " {:%e %b %Y}", - "tooltip": false - //"tooltip-format": "{:%e %B %Y}" - }, - - "cpu": { - "interval": 5, - "tooltip": false, - "format": " {usage}%", - "format-alt": " {load}", - "states": { - "warning": 70, - "critical": 90 - } - }, - - "sway/language": { - "format": " {}", - "min-length": 5, - "on-click": "swaymsg 'input * xkb_switch_layout next'", - "tooltip": false - }, - - "memory": { - "interval": 5, - "format": " {used:0.1f}G/{total:0.1f}G", - "states": { - "warning": 70, - "critical": 90 - }, - "tooltip": false - }, - - "network": { - "interval": 5, - "format-wifi": " {essid} ({signalStrength}%)", - "format-ethernet": " {ifname}", - "format-disconnected": "No connection", - "format-alt": " {ipaddr}/{cidr}", - "tooltip": false - }, - - "sway/mode": { - "format": "{}", - "tooltip": false - }, - - "sway/window": { - "format": "{}", - "max-length": 30, - "tooltip": false - }, - - "sway/workspaces": { - "disable-scroll-wraparound": true, - "smooth-scrolling-threshold": 4, - "enable-bar-scroll": true, - "format": "{name}" - }, - - "pulseaudio": { - "format": "{icon} {volume}%", - "format-bluetooth": "{icon} {volume}%", - "format-muted": "", - "format-icons": { - "headphone": "", - "hands-free": "", - "headset": "", - "phone": "", - "portable": "", - "car": "", - "default": ["", ""] - }, - "scroll-step": 1, - "on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle", - "tooltip": false - }, - - "temperature": { - "critical-threshold": 90, - "interval": 5, - "format": "{icon} {temperatureC}°", - "format-icons": [ - "", - "", - "", - "", - "" - ], - "tooltip": false - }, - - "tray": { - "icon-size": 18, - } -} diff --git a/.config/waybar/style.css b/.config/waybar/style.css deleted file mode 100644 index 53d732b..0000000 --- a/.config/waybar/style.css +++ /dev/null @@ -1,205 +0,0 @@ -/* Keyframes */ - -@keyframes blink-critical { - to { - /*color: @white;*/ - background-color: @critical; - } -} - - -/* Styles */ - -/* Colors (gruvbox) */ -@define-color black #073642; -@define-color red #dc322f; -@define-color green #859900; -@define-color yellow #b58900; -@define-color blue #268bd2; -@define-color purple #d33682; -@define-color aqua #00afaf; -@define-color gray #1c1c1c; -@define-color brgray #928374; -@define-color brred #cb4b16; -@define-color brgreen #586e75; -@define-color bryellow #657b83; -@define-color brblue #839496; -@define-color brpurple #6c71c4; -@define-color braqua #93a1a1; -@define-color white #eee8d5; -@define-color bg1 #073642; -@define-color bg2 #002b36; - - -@define-color warning @bryellow; -@define-color critical @red; -@define-color mode @bg2; -@define-color unfocused @bg2; -@define-color focused @blue; -@define-color inactive @purple; -@define-color sound @green; -@define-color network @yellow; -@define-color memory @aqua; -@define-color cpu @blue; -@define-color temp @brpurple; -@define-color layout @green; -@define-color battery @yellow; -@define-color date @aqua; -@define-color time @bg2; -@define-color tray @bg2; - -/* Reset all styles */ -* { - border: none; - border-radius: 0; - min-height: 0; - margin: 0; - padding: 0; - box-shadow: none; - text-shadow: none; - icon-shadow: none; -} - -/* The whole bar */ -#waybar { - background: @bg2; - color: @white; - font-family: "Terminus (TTF)", FontAwesome; - font-size: 12pt; -} - -/* Each module */ -#battery, -#clock, -#cpu, -#language, -#memory, -#mode, -#network, -#pulseaudio, -#temperature, -#tray, -#backlight, -#idle_inhibitor, -#disk, -#user, -#mpris { - padding-left: 8pt; - padding-right: 8pt; -} - -/* Each critical module */ -#memory.critical, -#cpu.critical, -#temperature.critical, -#battery.critical.discharging { - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - animation-name: blink-critical; - animation-duration: 1s; -} - -/* Each warning */ -#network.disconnected, -#memory.warning, -#cpu.warning, -#temperature.warning, -#battery.warning.discharging { - color: @warning; -} - -/* And now modules themselves in their respective order */ - -/* Current sway mode (resize etc) */ -#mode { - color: @white; - background: @mode; -} - -/* Workspaces stuff */ -#workspaces button { - /*font-weight: bold;*/ - padding-left: 2pt; - padding-right: 2pt; - color: @white; - background: @unfocused; -} - -/* Inactive (on unfocused output) */ -#workspaces button.visible { - color: @white; - background: @inactive; -} - -/* Active (on focused output) */ -#workspaces button.focused { - color: @black; - background: @focused; -} - -/* Contains an urgent window */ -#workspaces button.urgent { - color: @black; - background: @warning; -} - -/* Style when cursor is on the button */ -#workspaces button:hover { - background: @black; - color: @white; -} - -#window { - margin-right: 35pt; - margin-left: 35pt; -} - -#pulseaudio { - background: @sound; - color: @black; -} - -#network { - background: @network; - color: @white; -} - -#memory { - background: @memory; - color: @black; -} - -#cpu { - background: @cpu; - color: @white; -} - -#temperature { - background: @temp; - color: @black; -} - -#language { - background: @layout; - color: @black; -} - -#battery { - background: @battery; - color: @white; -} - -#tray { - background: @tray; -} - -#clock.date { - background: @date; - color: @black; -} - -#clock.time { - background: @time; - color: @white; -} diff --git a/.emacs.d/.gitignore b/.emacs.d/.gitignore deleted file mode 100644 index f51c6b4..0000000 --- a/.emacs.d/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!init.el -!jd/ \ No newline at end of file diff --git a/.emacs.d/init.el b/.emacs.d/init.el deleted file mode 100755 index 090592f..0000000 --- a/.emacs.d/init.el +++ /dev/null @@ -1,146 +0,0 @@ -;;; Dotfiles --- Jakub Dlugosz emacs config -;;; Commentary: - -;;; Code: - -;; Minimize garbage collection during startup -(setq gc-cons-threshold most-positive-fixnum) - -;; Lower threshold back to 8 MiB (default is 800kB) -(add-hook 'emacs-startup-hook - (lambda () - (setq gc-cons-threshold (expt 2 23)))) - -(defvar jd/manifest-list - nil - "List that contain Emacs packages for GNU/Guix." ) - -(defvar jd/exwm-p - (or (not (null (getenv "JD_EXWM"))) - (and (seq-contains command-line-args "exwm" #'string-match) - t)) - "Is non-nil when Emacs is run as a window manager.") - -(defvar jd/guix-p - (and (eq system-type 'gnu/linux) - (file-exists-p "/etc/os-release") - (with-temp-buffer - (insert-file-contents "/etc/os-release") - (search-forward "ID=guix" nil t)) - t) - "Is non-nil when Emacs packages are installed by GNU/Guix package manager.") - -(defun jd/add-package-to-manifest (guix-package-name) - "Add GUIX-PACKAGE-NAME to jd/manifest-list." - (unless (member guix-package-name jd/manifest-list) - (setq jd/manifest-list - (cons guix-package-name jd/manifest-list)))) - -(add-to-list 'load-path (concat user-emacs-directory "/jd")) - -(defun jd/display-startup-time () - (message "Emacs loaded in %s with %d garbage collections." - (format "%.2f seconds" - (float-time - (time-subtract after-init-time before-init-time))) - gcs-done)) - -(defun jd-emacs/startup () - "This procedure will run after Emacs startup." - (electric-pair-mode 1) - (global-company-mode 1) - (jd/display-startup-time)) - -(add-hook 'emacs-startup-hook #'jd-emacs/startup) - -(setq user-full-name "Jakub Dlugosz" - user-mail-address "jdlugosz963@gmail.com") - -(setq backup-directory-alist '(("." . "~/.cache/emacs/backup")) - backup-by-copying t - version-control t - delete-old-versions t - kept-new-versions 20 - kept-old-versions 5 - custom-file (concat user-emacs-directory - "custom.el")) - -;; (setq user-emacs-directory "~/.cache/emacs") - -(require 'package) -(setq package-archives '(("melpa" . "https://melpa.org/packages/") - ("org" . "https://orgmode.org/elpa/") - ("gnu-devel" . "https://elpa.gnu.org/devel/") - ("elpa" . "https://elpa.gnu.org/packages/"))) -(package-initialize) - -(unless package-archive-contents - (package-refresh-contents)) - -(jd/add-package-to-manifest "emacs-use-package") -(unless jd/guix-p - (unless (package-installed-p 'use-package) - (package-install 'use-package))) - -(require 'use-package) - -(setq use-package-always-ensure (not jd/guix-p)) - -(defun jd/generate-manifest () - "Generate GNU/Guix Emacs manifest to temp-buffer." - (interactive) - (with-output-to-temp-buffer "*guix-emacs-packages-manifest.scm*" - (princ (concat ";; This file is auto-generated by Emacs " - "function: jd/manifest-generate-to-file \n")) - (princ `(specifications->manifest - '(,@(mapcar #'(lambda (guix-package-name) - (concat "\"" - guix-package-name - "\"\n")) - jd/manifest-list)))))) - -(defun use-package-normalize/:guix-package (name keyword args) - (use-package-as-one (symbol-name keyword) args - #'(lambda (_label arg) - (cond - ((consp arg) arg) - ((stringp arg) (list arg)) - ((use-package-non-nil-symbolp arg) (symbol-name arg)) - (t - (use-package-error - ":pin wants an archive name (a string)")))))) - -(defun use-package-handler/:guix-package - (name _keyword args rest state) - (let ((body (use-package-process-keywords name rest state))) - (use-package-concat - (when (consp args) - (mapcar #'(lambda (arg) - `(jd/add-package-to-manifest ,arg)) - args)) - body))) - -(add-to-list 'use-package-keywords ':guix-package) - -(jd/add-package-to-manifest "emacs") -(jd/add-package-to-manifest "emacs-guix") - -(require 'jd-keys) -(require 'jd-ui) -(require 'jd-org) -(require 'jd-dev) -(require 'jd-apps) -(require 'jd-custom) -(require 'jd-mu4e) -(require 'jd-misc) -(require 'jd-sway) - -(when jd/exwm-p - (require 'jd-exwm)) - -;; (setq gc-cons-threshold (* 2 1000 1000)) - -;;; init.el ends here -(put 'upcase-region 'disabled nil) -(put 'downcase-region 'disabled nil) -(put 'set-goal-column 'disabled nil) diff --git a/.emacs.d/jd/jd-apps.el b/.emacs.d/jd/jd-apps.el deleted file mode 100755 index f06430b..0000000 --- a/.emacs.d/jd/jd-apps.el +++ /dev/null @@ -1,49 +0,0 @@ -;;; Dotfiles --- Jakub Dlugosz emacs config -;;; Commentary: - -;;; Code: - -(use-package vterm - :guix-package "emacs-vterm" - :init - (add-to-list 'project-switch-commands '(project-vterm "Vterm") t) - (add-to-list 'project-kill-buffer-conditions - '(major-mode . vterm-mode)) - (setq vterm-copy-exclude-prompt t) - :config - (setq vterm-buffer-name "vterm") - ;; (evil-set-initial-state 'vterm-mode 'emacs) - (setq vterm-tramp-shells - (append '(("ssh" "/bin/bash")) vterm-tramp-shells)) - - ) - -(use-package all-the-icons-dired - :guix-package "emacs-all-the-icons-dired" - :hook (dired-mode . all-the-icons-dired-mode)) - -(use-package dired - :ensure nil - :commands (dired dired-jump) - :custom ((dired-listing-switches "-agho --group-directories-first")) - :config - (setq dired-kill-when-opening-new-dired-buffer t)) - -(use-package pdf-tools - :guix-package - "emacs-pdf-tools") - -(use-package password-store - :guix-package "emacs-password-store" - :bind - ("C-c P p" . password-store-copy) - ("C-c P i" . password-store-insert) - ("C-c P g" . password-store-generate)) - -(use-package shell - :bind - ("C-c C-" . shell)) - -(provide 'jd-apps) - -;;; jd-apps.el ends here diff --git a/.emacs.d/jd/jd-custom.el b/.emacs.d/jd/jd-custom.el deleted file mode 100755 index a634baa..0000000 --- a/.emacs.d/jd/jd-custom.el +++ /dev/null @@ -1,33 +0,0 @@ -;;; Dotfiles --- Jakub Dlugosz emacs config -;;; Commentary: - -;;; Code: - -(setq erc-nick "bobbma" - erc-user-full-name "Jakub Dlugosz" - erc-notify-list '("akuleszaa")) - -(defun hipis-znc () - (interactive) - (erc :server "195.74.91.18" - :port "6697")) - - -;; Repair load paths when tramp try to connect to guix instances -(require 'tramp) - -(connection-local-set-profile-variables - 'guix-system - '((tramp-remote-path . (tramp-own-remote-path)))) - -(connection-local-set-profiles - '(:application tramp :protocol "sudo" :machine "localhost") - 'guix-system) - -(connection-local-set-profiles - '(:application tramp :protocol "ssh" :machine "jdlugosz.com") - 'guix-system) - -(provide 'jd-custom) - -;;; jd-custom.el ends here diff --git a/.emacs.d/jd/jd-dev.el b/.emacs.d/jd/jd-dev.el deleted file mode 100755 index 569b12f..0000000 --- a/.emacs.d/jd/jd-dev.el +++ /dev/null @@ -1,155 +0,0 @@ -;;; Dotfiles --- Jakub Dlugosz emacs config -;;; Commentary: - -;;; Code: - -(setq c-default-style "linux" - c-basic-offset 8 - gdb-many-windows t) - -(use-package lsp-mode - :guix-package "emacs-lsp-mode" - :diminish t - :commands (lsp lsp-deferred) - :init - (setq lsp-headerline-breadcrumb-enable nil) - (setq lsp-diagnostics-provider :none) - (setq lsp-modeline-diagnostics-enable nil) - (setq lsp-keymap-prefix "C-c l") - :config - (lsp-enable-which-key-integration t)) - -(use-package lsp-ivy - :guix-package "emacs-lsp-ivy" - :after lsp) - - -(use-package paredit - :guix-package "emacs-paredit") - -(defun jd/lisp-mode-setup () - (rainbow-delimiters-mode) - (paredit-mode)) - -(add-hook 'emacs-startup-hook - (lambda () - (add-hook 'scheme-mode-hook 'jd/lisp-mode-setup) - (add-hook 'emacs-lisp-mode-hook 'jd/lisp-mode-setup) - (add-hook 'clojure-mode-hook 'jd/lisp-mode-setup) - (add-hook 'lisp-mode-hook 'jd/lisp-mode-setup))) - -(use-package rainbow-delimiters - :guix-package "emacs-rainbow-delimiters") - -(use-package sly - :guix-package "emacs-sly") - -(use-package geiser - :guix-package "emacs-geiser") - -(use-package geiser-racket - :guix-package "emacs-geiser-racket") - -(use-package racket-mode - :guix-package "emacs-racket-mode") - -(use-package geiser-guile - :guix-package "emacs-geiser-guile" - :config - (when jd/guix-p - (defun jd/guix-repl () - (interactive) - (let ((geiser-guile-binary '("guix" "repl")) - (geiser-guile-load-path (cons "~/dotfiles/guix" geiser-guile-load-path))) - (geiser 'guile))))) - -(use-package pyvenv - :guix-package "emacs-pyvenv" - :after python-mode) - -(use-package typescript-mode - :guix-package "emacs-typescript-mode" - :mode ("\\.ts\\'") - :config - (setq typescript-indent-level 2)) - -(use-package cider - :guix-package "emacs-cider") - -(use-package tide - :guix-package "emacs-tide" - :after (typescript-mode company web-mode)) - -(use-package flycheck - :guix-package "emacs-flycheck" - :hook ((after-init . global-flycheck-mode))) - -(use-package web-mode - :guix-package "emacs-web-mode" - :mode - ("\\.ejs\\'" "\\.hbs\\'" "\\.html\\'" "\\.php\\'" "\\.[jt]sx?\\'") - :config - (setq web-mode-content-types-alist '(("jsx" . "\\.[jt]sx?\\'"))) - (setq web-mode-markup-indent-offset 2) - (setq web-mode-css-indent-offset 2) - (setq web-mode-code-indent-offset 2) - (setq web-mode-script-padding 2) - (setq web-mode-block-padding 2) - (setq web-mode-style-padding 2) - (setq web-mode-enable-auto-pairing t) - (setq web-mode-enable-auto-closing t) - (setq web-mode-enable-current-element-highlight t)) - -(use-package yaml-mode - :guix-package "emacs-yaml-mode") - -(use-package docker - :guix-package "emacs-docker" - :bind - ("C-c D d" . docker-containers) - ("C-c D D" . docker)) - -(use-package company - :guix-package "emacs-company" - :diminish t - :after lsp-mode - :hook (lsp-mode . company-mode) - :bind (:map company-active-map - ("" . company-complete-selection)) - (:map lsp-mode-map - ("" . company-indent-or-complete-common)) - :custom - (company-minimum-prefix-length 1) - (company-idle-delay 0.0) - :config - (global-company-mode)) - -(use-package projectile - :guix-package "emacs-projectile" - :diminish projectile-mode - :init - (when (file-directory-p "~/Documents/code") - (setq projectile-project-search-path '("~/Documents/code/"))) - :custom ((projectile-Completion-system 'ivy)) - :config - (setq projectile-switch-project-action #'projectile-dired) - (projectile-mode)) - -(use-package magit - :guix-package "emacs-magit" - :custom - (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) - -(use-package restclient - :guix-package "emacs-restclient") - -(setq sql-connection-alist - '(("net47-abaks" - (sql-product 'postgres) - (sql-user "kuba") - (sql-database "net47") - (sql-server "net47.abaks.pl")))) - -(provide 'jd-dev) - -;;; jd-dev.el ends here diff --git a/.emacs.d/jd/jd-exwm.el b/.emacs.d/jd/jd-exwm.el deleted file mode 100755 index 7731b01..0000000 --- a/.emacs.d/jd/jd-exwm.el +++ /dev/null @@ -1,177 +0,0 @@ -;;; Dotfiles --- Jakub Dlugosz emacs config -;;; Commentary: - -;;; Code: - - -(use-package perspective - :guix-package "emacs-perspective") - -(use-package exwm - :guix-package "emacs-exwm" - :config - (defun jd/exwm-update-class () - (exwm-workspace-rename-buffer exwm-class-name)) - - (defun jd-exwm/run-in-background (command) - (let ((command-parts (split-string command "[ ]+"))) - (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) - - (defun jd-exwm/restart-process (program-name) - (call-process "killall" nil nil nil program-name) - (jd-exwm/run-in-background program-name)) - - (defun jd-exwm/exwm-init-hook () - (jd-exwm/run-in-background "nitrogen --restore") - (start-process-shell-command "xinput" nil "xinput set-prop 'ETPS/2 Elantech Touchpad' 'Synaptics Tap Action' 1 1 1 2 1") - (start-process-shell-command "syndaemon" nil "syndaemon -i 0.8 -K -R -d") - - (jd-exwm/restart-process "polybar") - (jd-exwm/restart-process "nm-applet") - (jd-exwm/restart-process "redshift-gtk -l 54.37:18.6") - (jd-exwm/restart-process "blueman-applet")) - - (defun jd-exwm/exwm-update-title () - (exwm-workspace-rename-buffer exwm-title)) - - (defun jd-exwm/configure-window-by-class () - (interactive) - (pcase exwm-class-name - ("firefox" (exwm-workspace-move-window 2)) - ("Brave" (exwm-workspace-move-window 2)) - ("qutebrowser" (exwm-workspace-move-window 2)) - ("discord" (exwm-workspace-move-window 5)) - ("obs" (exwm-workspace-move-window 5)) - ("Virt-manager" (exwm-workspace-move-window 4)))) - - (setq exwm-workspace-number 10) - - ;; (add-hook 'exwm-init-hook #'jd-exwm/exwm-init-hook) - (add-hook 'exwm-update-class-hook #'jd/exwm-update-class) - (add-hook 'exwm-update-title-hook #'jd-exwm/exwm-update-title) - (add-hook 'exwm-manage-finish-hook #'jd-exwm/configure-window-by-class) - - (require 'exwm-randr) - (setq exwm-randr-workspace-monitor-plist '(9 "eDP-1" 0 "eDP-1")) - (exwm-randr-enable) - - (setq exwm-input-simulation-keys - '(([?\C-b] . [left]) - ([?\C-f] . [right]) - ([?\C-p] . [up]) - ([?\C-n] . [down]) - ([?\C-a] . [home]) - ([?\C-e] . [end]) - ([?\C-k] . [S-end delete]) - ([?\M-w] . [C-c]) - ([?\C-y] . [C-v]) - ([?\C-v] . [next]) - ([?\M-v] . [prior]) - )) - - (setq exwm-input-prefix-keys - '(?\C-x - ?\C-u - ?\C-h - ?\M-x - ?\M-` - ?\M-& - ?\M-! - ?\C-g - ?\M-: - ?\C-\M-j - ?\C-\ )) - - (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) - (exwm-input-set-key (kbd "s-p") 'counsel-linux-app) - - (setq exwm-input-global-keys - `(([?\s-R] . exwm-reset) - - - ([?\s-r] . (lambda (command) - (interactive (list (read-shell-command "$ "))) - (start-process-shell-command command nil command))) - - ([?\s-W] . exwm-workspace-move-window) - ([?\s-w] . exwm-workspace-switch) - - ,@(mapcar (lambda (i) - `(,(kbd (format "s-%d" i)) . - (lambda () - (interactive) - (exwm-workspace-switch-create ,i)))) - (number-sequence 0 9)))) - - (exwm-enable) - (require 'exwm-systemtray) - (exwm-systemtray-enable)) - -(use-package desktop-environment - :guix-package "emacs-desktop-environment" - :after exwm - :custom - (desktop-environment-brightness-small-increment "2%+") - (desktop-environment-brightness-small-decrement "2%-") - (desktop-environment-brightness-normal-increment "5%+") - (desktop-environment-brightness-normal-decrement "5%-") - - :config - (defun jd/dunst-show-history () - (interactive) - (start-process-shell-command "dunstctl" nil "dunstctl history-pop")) - (global-set-key (kbd "C-c N h") #'jd/dunst-show-history) - - (defun jd/dunst-close () - (interactive) - (start-process-shell-command "dunstctl" nil "dunstctl close")) - (global-set-key (kbd "C-c N c") #'jd/dunst-close) - - (defun jd/dunst-close-all () - (interactive) - (start-process-shell-command "dunstctl" nil "dunstctl close-all")) - (global-set-key (kbd "C-c N a") #'jd/dunst-close-all) - - (desktop-environment-mode)) - -;; (set-frame-parameter (selected-frame) 'alpha '(90 . 90)) -;; (add-to-list 'default-frame-alist `(alpha . (90 . 90))) -;; (set-frame-parameter (selected-frame) 'fullscreen 'maximized) -;; (add-to-list 'default-frame-alist '(fullscreen . maximized)) - -(defun jd-exwm/get-color (ATTRIBUTE) - (face-attribute 'default ATTRIBUTE)) - -(defun theme-to-xresources () - (interactive) - (require 'term) - (with-temp-buffer - (insert "! Generated by theme-to-xresources\n") - (dolist (spec - '(("emacs.background" :background "E6") - ("emacs.foreground" :foreground ""))) - (let ((color (jd-exwm/get-color (cadr spec)))) - (insert (format "%s: #%s%s\n" - (car spec) - (caddr spec) - (string-remove-prefix "#" color)))) - jd - (write-region (point-min) (point-max) "~/.Xresources"))) - (call-process "xrdb" nil nil nil "-merge" (expand-file-name "~/.Xresources"))) - -(defun jd/theme-sync () - (interactive) - (theme-to-xresources) - (setq org-confirm-babel-evaluate nil) - (org-babel-tangle-file "~/dotfiles/Desktop.org") - (setq org-confirm-babel-evaluate 't) - (call-process "killall" nil nil nil "dunst") ;; TODO: prevent clear notification history - (jd-exwm/restart-process "polybar")) - -;; (add-hook 'jd/load-theme-hook #'jd/theme-sync) -;; (add-hook 'exwm-init-hook #'jd/theme-sync) - -(provide 'jd-exwm) - -;;; jd-exwm.el ends here - diff --git a/.emacs.d/jd/jd-gym.el b/.emacs.d/jd/jd-gym.el deleted file mode 100755 index 581bf65..0000000 --- a/.emacs.d/jd/jd-gym.el +++ /dev/null @@ -1,120 +0,0 @@ -;;; jd-gym.el --- Gym workout manager. -;;; Commentary: -;; It will be a gym workout manager in the future. -;;; code: - -(require 'emacsql-sqlite) - -(defconst jd-gym/db--tables-schema - '((workout-plans - [(id integer :primary-key :autoincrement) - (name text)]) - - (workouts - [(id integer :primary-key :autoincrement) - (workout-plan-id integer :not-null) - (day integer :not-null) - (month integer :not-null) - (year integer :not-null)] - (:foreign-key [workout-plan-id] :references workout-plans [id] :on-delete :cascade)) - - (muscle-part - [(id integer :primary-key :autoincrement) - (name text :not-null)]) - - (exercises - [(id integer :primary-key :autoincrement) - (name text :not-null) - (muscle-part-id integer :not-null)] - (:foreign-key [muscle-part-id] :references muscle-part [id] :on-delete :cascade)) - - (workout-plan-exercise-map - [(id integer :primary-key :autoincrement) - (week-day integer :not-null) - (workout-plan-id integer :not-null) - (exercise-id integer :not-null)] - (:foreign-key [workout-plan-id] :references workout-plans [id] :on-delete :cascade) - (:foreign-key [exercise-id] :references exercises [id] :on-delete :cascade)) - - (workout-sets - [(id integer :primary-key :autoincrement) - (reps integer :not-null) - (weight integer :not-null) - (workout-plan-exercise-map-id integer :not-null) - (comment text)] - (:foreign-key [workout-plan-exercise-map-id] :references workout-plan-exercise-map [id] :on-delete :cascade)))) - -(defconst jd-gym/db--test-data - '((workout-plans - ([nil "Push pull"])) - (workouts - ([nil 1 3 1 2023])) - (muscle-part - ([nil "glutes"] - [nil "chest"])) - (exercises - ([nil "Bench press" 2] - [nil "RDL" 1])) - (workout-plan-exercise-map - ([nil 0 1 1] ; Monday, Push pull, Bench press - [nil 1 1 2] ; Tuesday, Push pull, RDL - [nil 3 1 1] ; Thursday, Push pull, Bench press - [nil 4 1 2] ; Friday, Push pull, RDL - )) - (workout-sets - ([nil 7 70 1 "New PR!"] - [nil 8 110 2 "It was hard!"])))) - -(defun jd-gym/db--test-data-insert () - "Insert test data to jd-gym database." - (mapc (lambda (table) - (let ((table-name (car table)) - (table-data (cdr table))) - (emacsql jd-gym/db--conn [:insert :into $i1 - :values $v2] - table-name table-data))) - jd-gym/db--test-data)) - -(defvar jd-gym/db-path "~/Documents/Gym/gym.sqlite" - "Path can be relative or absolute.") - -(defvar jd-gym/db--conn nil - "Store connection to jd-gym database.") - -(defun jd-gym/db--conn-p () - "Check if jd-gym is connected to db." - (and (emacsql-sqlite-connection-p jd-gym/db--conn) - (emacsql-live-p jd-gym/db--conn))) - -(defun jd-gym/db--connect () - "Connect to db if there is no connection yet." - (unless (jd-gym/db--conn-p) - (setq jd-gym/db--conn (emacsql-sqlite jd-gym/db-path)))) - -(defun jd-gym/db--close () - "Close db connection." - (when (jd-gym/db--conn-p) - (emacsql-close jd-gym/db--conn))) - -(defun jd-gym/db--init () - "Initialize database structure." - (when (jd-gym/db--conn-p) - (emacsql jd-gym/db--conn [:pragma (= foreign_keys ON)]) - (emacsql jd-gym/db--conn "PRAGMA foreign_keys=ON") - (mapc (lambda (table) - (let ((table-name (car table)) - (table-schema (cdr table))) - (emacsql jd-gym/db--conn [:create-table $i1 $S2] table-name table-schema))) - jd-gym/db--tables-schema))) - -(defun jd-gym/db () - "Entrypoint to jd-gym db." - (unless (file-exists-p jd-gym/db-path) - (jd-gym/db--close) - (jd-gym/db--connect) ; Restart connection - (jd-gym/db--init))) - - -(provide 'jd-gym) - -;;; jd-gym.el ends here diff --git a/.emacs.d/jd/jd-keys.el b/.emacs.d/jd/jd-keys.el deleted file mode 100755 index a5b828b..0000000 --- a/.emacs.d/jd/jd-keys.el +++ /dev/null @@ -1,50 +0,0 @@ -;;; Dotfiles --- Jakub Dlugosz emacs config -;;; Commentary: -;; Custom keysets used in my emacs -;;; Code: - -(use-package multiple-cursors - :guix-package "emacs-multiple-cursors" - :config - (global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) - (global-set-key (kbd "C->") 'mc/mark-next-like-this) - (global-set-key (kbd "C-<") 'mc/mark-previous-like-this) - (global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)) - - -(use-package hydra - :guix-package "emacs-hydra" - ;; :defer t - :config - (defun jd/text-scale-increase () - (interactive) - (let ((old-face-attribute (face-attribute 'default :height))) - (set-face-attribute 'default nil :height (+ old-face-attribute 10)))) - - (defun jd/text-scale-decrease () - (interactive) - (let ((old-face-attribute (face-attribute 'default :height))) - (set-face-attribute 'default nil :height (- old-face-attribute 10)))) - - (defhydra hydra-text-scale-global (:timeout 4) - "scale text" - ("j" jd/text-scale-increase "in") - ("k" jd/text-scale-decrease "out") - ("q" nil "finished" :exit t)) ;; TODO not working - - (defhydra hydra-text-scale (:timeout 4) - "scale text" - ("j" text-scale-increase "in") - ("k" text-scale-decrease "out") - ("q" nil "finished" :exit t))) - -(use-package undo-tree - :guix-package "emacs-undo-tree" - :diminish - :config - (setq undo-tree-auto-save-history nil) - (global-undo-tree-mode 1)) - -(provide 'jd-keys) - -;;; jd-keys.el ends here diff --git a/.emacs.d/jd/jd-mu4e.el b/.emacs.d/jd/jd-mu4e.el deleted file mode 100755 index b388201..0000000 --- a/.emacs.d/jd/jd-mu4e.el +++ /dev/null @@ -1,84 +0,0 @@ -;;; Dotfiles --- Jakub Dlugosz emacs config -;;; Commentary: - -;;; Code: - -(use-package htmlize - :guix-package "emacs-htmlize") - -(use-package mu4e - :guix-package ("mu" "isync") - :defer 10 - :ensure nil - :bind - ("C-c M" . mu4e) - :config - ;a (require 'org-mu4e) - - (unless jd/guix-p - (add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e") - (setq mu4e-mu-binary "/usr/local/bin/mu")) - - (setq mu4e-update-interval (* 10 60)) - (setq mu4e-get-mail-command "mbsync -a") - (setq mu4e-maildir "~/Mail") - - (setq mu4e-completing-read-function #'ivy-completing-read) - - (setq mu4e-change-filenames-when-moving t) - - (setq mu4e-contexts - `(,(make-mu4e-context - :name "Abaks" - :match-func (lambda (msg) (when msg - (string-prefix-p "/abaks" (mu4e-message-field msg :maildir)))) - :vars '( - (user-full-name . "Jakub Dlugosz") - (user-mail-address . "jakub@abaks.pl") - (mu4e-sent-folder . "/abaks/Sent Items") - (mu4e-trash-folder . "/abaks/Trash") - (mu4e-drafts-folder . "/abaks/Drafts") - (mu4e-refile-folder . "/abaks/Archive") - (mu4e-sent-messages-behavior . sent) - (smtpmail-local-domain . "pl") - (smtpmail-smtp-server . "smtp.abaks.pl") - (smtpmail-smtp-user . "jakub@abaks.pl"))) - ,(make-mu4e-context - :name "Gmail" - :match-func (lambda (msg) (when msg - (string-prefix-p "/gmail" (mu4e-message-field msg :maildir)))) - :vars '( - (user-full-name . "Jakub Dlugosz") - (user-mail-address . "jdlugosz963@gmail.com") - (mu4e-sent-folder . "/gmail/\[Gmail\]/Wys\&AUI-ane") - (mu4e-trash-folder . "/gmail/\[Gmail\]/Kosz") - (mu4e-drafts-folder . "/gmail/\[Gmail\]/Wersje\ robocze") - (mu4e-refile-folder . "/gmail/Archive") - (smtpmail-local-domain . "com") - (smtpmail-smtp-server . "smtp.gmail.com") - (smtpmail-smtp-user . "jdlugosz963@gmail.com") - (mu4e-sent-messages-behavior . sent))))) - - (setq mail-user-agent 'mu4e-user-agent - mail-host-address nil - message-send-mail-function 'smtpmail-send-it - smtpmail-smtp-service 465 - smtpmail-stream-type 'ssl - smtpmail-servers-requiring-authorization ".*") - - (setq mu4e-compose-signature (concat - "Pozdrawiam,\n" - "Jakub Długosz")) - - (mu4e t) - (mu4e-modeline-mode nil)) - -(use-package mu4e-alert - :guix-package "emacs-mu4e-alert" - :defer 20 - :config - (mu4e-alert-set-default-style 'libnotify) - (mu4e-alert-enable-mode-line-display) - (mu4e-alert-enable-notifications)) - -(provide 'jd-mu4e) diff --git a/.emacs.d/jd/jd-org.el b/.emacs.d/jd/jd-org.el deleted file mode 100755 index 1126155..0000000 --- a/.emacs.d/jd/jd-org.el +++ /dev/null @@ -1,217 +0,0 @@ -;;; Dotfiles --- Jakub Dlugosz emacs config -;;; Commentary: - -;;; Code: - -(defvar jd/org-home "~/Documents/Org") -(defvar jd/org-roam-home (concat jd/org-home "/roam")) -(defvar jd/org-roam-agenda (concat jd/org-home "/agenda")) -(defvar jd/org-roam-daily-home (concat jd/org-roam-home "/daily")) - -(defun jd/org-mode-init () - (org-indent-mode) - (variable-pitch-mode 1) - (visual-line-mode 1)) - -(defun jd-emacs/org-insert-date (&optional date) - (org-insert-time-stamp (org-read-date nil t (or date "+0d")))) - -(use-package org-pomodoro - :guix-package "emacs-org-pomodoro") - -(use-package org-caldav - :guix-package "emacs-org-caldav" - :config - (setq org-caldav-url "http://jdlugosz.com:5232/jdlugosz" - org-caldav-calendar-id "841a6259-8fe5-a178-e326-ddbb7c767e22" - org-caldav-inbox (concat jd/org-roam-agenda - "/main.org") - org-caldav-files nil - org-icalendar-timezone "Europe/Warsaw")) - -(use-package org - :guix-package "emacs-org" - :pin org - :commands (org-capture org-agenda) - :hook (org-mode . jd/org-mode-init) - :bind - ("C-c o c" . #'org-capture) - ("C-c o p" . #'org-mobile-pull) - ("C-c o P" . #'org-mobile-push) - ("C-c o a" . #'org-agenda) - :config - (setq org-directory (file-truename "~/Documents/Org/")) - (setq org-mobile-inbox-for-pull (concat org-directory "flagged.org")) - (setq org-mobile-directory "~/Documents/Org/Mobile/") - (setq org-agenda-files '("Tasks.org" "Inbox.org" "Habits.org")) - (setq org-ellipsis " ▾") - (setq org-agenda-start-with-log-mode t) - (setq org-log-done 'time) - (setq org-log-into-drawer t) - (setq org-return-follows-link t) - (setq org-capture-templates - `(("t" "Tasks / Projects") - ("tt" "Task" entry (file+olp "Tasks.org" "Inbox") - "* TODO %?\n %t\n %a\n %i" :empty-lines 1) - ("tT" "Task for tomorow" entry (file+olp "Tasks.org" "Inbox") - "* TODO %?\n %t\n SCHEDULED: %(jd-emacs/org-insert-date \"+1d\")>\n %a\n %i" :empty-lines 1) - - ("m" "Metrics Capture") - ("mm" "Metrics" table-line (file+headline "Metrics.org" "Metrics") - "| %U | %^{Weight} | %^{Waist} | %^{Notes} |" :kill-buffer t) - ("sh" "School Homework" entry (file+olp "school/todo(jd-emacs/org-insert-date \"1\").org")))) - - (setq org-latex-listings 'minted - org-latex-packages-alist '(("" "minted")) - org-latex-pdf-process - '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" - "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) - (require 'org-tempo) - - (defun jd/org-font-setup () - ;; Replace list hyphen with dot - (font-lock-add-keywords 'org-mode - '(("^ *\\([-]\\) " - (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•-")))))) - - ;; Set faces for heading levels - (dolist (face '((org-level-1 . 1.3) - (org-level-2 . 1.2) - (org-level-3 . 1.1) - (org-level-4 . 1.0) - (org-level-5 . 1.0) - (org-level-6 . 1.0) - (org-level-7 . 1.0) - (org-level-8 . 1.0))) - (set-face-attribute (car face) nil :font "Terminus" :weight 'Bold :height (cdr face))) - - ;; Ensure that anything that should be fixed-pitch in Org files appears that way - (set-face-attribute 'org-block nil :font "Terminus" :inherit 'fixed-pitch :height 100) - (set-face-attribute 'org-table nil :inherit 'fixed-pitch) - (set-face-attribute 'org-formula nil :inherit 'fixed-pitch) - (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) - (set-face-attribute 'org-table nil :font "Terminus" :inherit '(shadow fixed-pitch)) - (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch)) - (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch)) - (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch)) - (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch) - (set-face-attribute 'line-number nil :inherit 'fixed-pitch) - (set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch)) - - (with-eval-after-load 'org (jd/org-font-setup)) - - (defun jd-emacs/org-timer-stop () - (start-process-shell-command "notify-send" nil "notify-send Zakonczono odliczanie")) - - - (add-hook 'org-timer-stop-hook #'jd-emacs/org-timer-stop) - - (defun jd/org-tempo-setup () - (dolist (template '(("s" . "src") - ("sql" . "src sql") - ("sh" . "src sh") - ("el" . "src emacs-lisp") - ("li" . "src lisp") - ("sc" . "src scheme") - ("ts" . "src typescript") - ("py" . "src python") - ("go" . "src go") - ("yaml" . "src yaml"))) - (add-to-list 'org-structure-template-alist template))) - - (with-eval-after-load 'org-tempo (jd/org-tempo-setup)) - - (org-babel-do-load-languages - 'org-babel-load-languages - '((emacs-lisp . t) - (python . t))) - - (defun jd/org-babel-tangle-config () - (when (string-equal (file-name-directory (buffer-file-name)) - (expand-file-name "~/dotfiles/")) - ;; Dynamic scoping to the rescue - (let ((org-confirm-babel-evaluate nil)) - (org-babel-tangle)))) - - (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'jd/org-babel-tangle-config)))) - -(use-package org-superstar - :guix-package "emacs-org-superstar" - :hook (org-mode . org-superstar-mode) - :init - (setq org-superstar-special-todo-items t) - (setq org-superstar-remove-leading-stars t) - (setq org-superstar-headline-bullets-list '("◉" "○" "●" "○" "●" "○" "●"))) - -(use-package org-roam - :guix-package "emacs-org-roam" - :custom - (org-roam-directory (file-truename jd/org-roam-home)) - :bind (("C-c n l" . org-roam-buffer-toggle) - ("C-c n f" . org-roam-node-find) - ("C-c n g" . org-roam-graph) - ("C-c n i" . org-roam-node-insert) - ("C-c n c" . org-roam-capture) - ;; Dailies - ("C-c n j" . org-roam-dailies-capture-today)) - :bind-keymap - ("C-c n d" . org-roam-dailies-map) - :config - (defun jd/org-roam-filter-by-tag (tag-name) - (lambda (node) - (member tag-name (org-roam-node-tags node)))) - - (defun jd/org-roam-list-notes-by-tag (tag-name) - (mapcar #'org-roam-node-file - (seq-filter - (jd/org-roam-filter-by-tag tag-name) - (org-roam-node-list)))) - - (defun jd/org-roam-refreshagenda-list () - (interactive) - (setq org-agenda-files (org-roam-list-files))) - - (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag))) - (setq org-roam-capture-templates - '(("a" "workstuff" plain (file (concat org-roam-directory "/work")) - :target (file+head "work/%<%Y%m%d%H%M%S>-${slug}.org" - "#+title: ${title}\n") - :unnarrowed t) - ("b" "research" plain (file "~/Documents/roam/study/templates/research.org") - :target (file+head "study/%<%Y%m%d%H%M%S>-${slug}.org" - "#+title: ${title}\n") - :unnarrowed t) - ("s" "School") - ("ss" "School General" plain nil - :target (file+head - "school/%<%Y%m%d%H%M%S>-${slug}.org" - "#+title: ${title}\n") - :unnarrowed t) - ("sp" "Polish Lesson" plain nil - :target (file+head - "school/polish/%<%Y%m%d%H%M%S>-${slug}.org" - "#+title: ${title}\n") - :unnarrowed t) - ("sw" "Wos Lesson" plain nil - :target (file+head - "school/wos/%<%Y%m%d%H%M%S>-${slug}.org" - "#+title: ${title}\n") - :unnarrowed t) - ("g" "Guitar" plain nil - :target (file+head - "guitar/%<%Y%m%d%H%M%S>-${slug}.org" - "#+title: ${title}\n") - :unnarrowed t) - ("d" "default" plain nil - :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" - "#+title: ${title}\n") - :unnarrowed t))) - - (org-roam-db-autosync-mode)) - -(use-package ox-pandoc - :guix-package "emacs-ox-pandoc") - -(provide 'jd-org) - -;;; jd-org.el ends here diff --git a/.emacs.d/jd/jd-ui.el b/.emacs.d/jd/jd-ui.el deleted file mode 100755 index 992ba17..0000000 --- a/.emacs.d/jd/jd-ui.el +++ /dev/null @@ -1,100 +0,0 @@ -;; Dotfiles --- Jakub Dlugosz emacs config -;;; Commentary: - -;;; Code: - -(setq inhibit-startup-message t) -(setq visible-bell t) -(scroll-bar-mode -1) -(tool-bar-mode -1) -(tooltip-mode -1) -(menu-bar-mode -1) -(set-fringe-mode 10) - -(set-frame-parameter (selected-frame) 'alpha '(92 . 92)) -(add-to-list 'default-frame-alist '(alpha . (92 . 92))) - -(custom-set-faces - '(default ((t (:inherit nil :height 125 :family "Terminus")))) - '(line-number ((t (:inherit nil :height 125 :family "Terminus")))) - '(line-number-current-line ((t (:inherit nil :height 125 :family "Terminus"))))) - -(add-hook 'prog-mode-hook 'menu-bar--display-line-numbers-mode-relative) - -(global-set-key (kbd "") 'keyboard-escape-quit) - -(global-prettify-symbols-mode 1) - -(defalias 'yes-or-no-p 'y-or-n-p) - -(require 'diminish) - -(use-package doom-modeline - :guix-package "emacs-doom-modeline" - :config - (doom-modeline-mode)) - -(use-package solarized-theme - :guix-package "emacs-solarized-theme" - :config - (load-theme 'solarized-dark-high-contrast t)) - - -(use-package diminish - :guix-package "emacs-diminish") - -(use-package hl-todo - :guix-package "emacs-hl-todo" - :init - (setq hl-todo-keyword-faces - '(("TODO" . "#FF0000") - ("FIXME" . "#FF0000") - ("DEBUG" . "#A020F0"))) - :config - (global-hl-todo-mode 1)) - -(defvar jd/load-theme-hook nil) -(defun jd/load-theme () - (interactive) - (counsel-load-theme) - (run-hooks 'jd/load-theme-hook)) - -(use-package ivy - :guix-package "emacs-ivy" - :diminish - :bind - (("C-s" . swiper)) - :config - (ivy-mode 1)) - -(use-package counsel - :guix-package "emacs-counsel" - :diminish t - :config - (counsel-mode 1)) - -(use-package which-key - :guix-package "emacs-which-key" - :diminish - :config - (which-key-mode) - (setq which-key-idle-delay 0.3)) - -(use-package all-the-icons - :guix-package "emacs-all-the-icons") - -(use-package beacon - :guix-package "emacs-beacon" - :config - (beacon-mode 1)) - -(setq display-time-string-forms - '(" " 24-hours ":" minutes " ")) - -(when jd/exwm-p - (display-battery-mode) - (display-time-mode)) - -(provide 'jd-ui) - -;;; jd-ui.el ends here diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f3fe7e5..0000000 --- a/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -__pycache__/ -elpa/ -auto-save-list/ -eln-cache/ -url/ -**/#* -**/*~ diff --git a/.guile b/.guile deleted file mode 100644 index 2076bd2..0000000 --- a/.guile +++ /dev/null @@ -1,2 +0,0 @@ - (use-modules (ice-9 readline)) - (activate-readline) \ No newline at end of file diff --git a/.guix-channel b/.guix-channel new file mode 100644 index 0000000..c788233 --- /dev/null +++ b/.guix-channel @@ -0,0 +1,13 @@ +(channel + (version 0) + (directory "guix") + (url "https://git.jdlugosz.com/personal/dotfiles/") + (dependencies + (channel + (name nonguix) + (url "https://gitlab.com/nonguix/nonguix") + (branch "master")) + (channel + (name rustup) + (url "https://github.com/declantsien/guix-rustup") + (branch "master")))) \ No newline at end of file diff --git a/.mbsyncrc b/.mbsyncrc deleted file mode 100644 index 20a8692..0000000 --- a/.mbsyncrc +++ /dev/null @@ -1,47 +0,0 @@ -IMAPStore abaks-remote -Host imap.abaks.pl -Port 143 -SSLType None -AuthMechs LOGIN -User jakub@abaks.pl -PassCmd "pass email/jakub@abaks.pl" -CertificateFile /etc/ssl/certs/ca-certificates.crt - -MaildirStore abaks-local -Path ~/Mail/abaks/ -Inbox ~/Mail/abaks/INBOX -Subfolders Verbatim - -Channel abaks -Far :abaks-remote: -Near :abaks-local: -Patterns INBOX * !Sync* -Expunge None -CopyArrivalDate yes -Sync All -Create Near -SyncState * - -IMAPStore gmail-remote -Host imap.gmail.com -Port 993 -SSLType IMAPS -AuthMechs LOGIN -User jdlugosz963@gmail.com -PassCmd "pass email/jdlugosz963@gmail.com" -CertificateFile /etc/ssl/certs/ca-certificates.crt - -MaildirStore gmail-local -Path ~/Mail/gmail/ -Inbox ~/Mail/gmail/INBOX -Subfolders Verbatim - -Channel gmail -Far :gmail-remote: -Near :gmail-local: -Patterns INBOX * !Sync* -Expunge None -CopyArrivalDate yes -Sync All -Create Near -SyncState * diff --git a/.stumpwm.d/.gitignore b/.stumpwm.d/.gitignore deleted file mode 100644 index 4c478cf..0000000 --- a/.stumpwm.d/.gitignore +++ /dev/null @@ -1 +0,0 @@ -stumpwm.log* \ No newline at end of file diff --git a/.stumpwm.d/init.lisp b/.stumpwm.d/init.lisp deleted file mode 100755 index 0970718..0000000 --- a/.stumpwm.d/init.lisp +++ /dev/null @@ -1,360 +0,0 @@ -(in-package :stumpwm) - - -(setq *message-window-gravity* :center) -(setq *message-window-input-gravity* :center) -(setq *input-window-gravity* :center) -(setq *window-border-style* :none) - -(set-bg-color :gray10) -(setq *mode-line-background-color* "Gray10") - -(set-prefix-key (kbd "C-z")) -(setq *float-window-modifier* :super) - -(define-key *top-map* (kbd "s-w") "gselect") - -(defcommand lock () () - (run-shell-command "slock")) - -(define-key *top-map* (kbd "s-l") "lock") - -(defcommand server-start () () - (slynk:create-server :port 4005) - (message "server started at port: \"4005\"!")) - - -(define-key *root-map* (kbd "C-q") "send-raw-key") - -(define-key *root-map* (kbd "M") "mode-line") -(define-key *root-map* (kbd "C-n") "fnext") -(define-key *root-map* (kbd "C-p") "fprev") -(define-key *root-map* (kbd "b") "windowlist") - - - -;; (run-commands "gnew Code" -;; "gnew Web" -;; "gnew Music" -;; "gnew Game" -;; "gnew School") - -(define-remapped-keys - '(("(Firefox|Chrome|qutebrowser)" - ("C-n" . "Down") - ("C-p" . "Up") - ("C-f" . "Right") - ("C-b" . "Left") - ("C-v" . "Next") - ("M-v" . "Prior") - ("M-w" . "C-c") - ("C-w" . "C-x") - ("C-y" . "C-v") - ("M-<" . "Home") - ("M->" . "End") - ("C-a" . "Home") - ("C-e" . "End") - ("C-M-b" . "M-Left") - ("C-M-f" . "M-Right") - ("C-g" . "ESC") - ("C-k" . ("C-S-End" "C-x"))))) - -(define-frame-preference "chat" - (0 NIL T :create T :class "quassel") - (1 NIL T :create T :class "discord") - (2 NIL T :create T :class "nheko")) - -(define-frame-preference "vm" - (0 NIL T :create T :class ".virt-manager-real")) - -(run-shell-command "~/.fehbg") - -(require :pamixer) -(require :pass) - -(require :screenshot) -(pamixer:volume-down 10) - -(defun get-brightness () - (let ((c (parse-integer (string-trim - (string #\newline) - (run-shell-command "brightnessctl g" t)))) - (m (parse-integer (string-trim - (string #\newline) - (run-shell-command "brightnessctl m" t))))) - (format nil "~3,1f%" (* (/ c m) 100)))) - -(defun set-brightness (x) - (run-shell-command (concat "brightnessctl s " x)) - (message (concat "Brightness: " (get-brightness)))) - -(defcommand my-volume-down () () - (pamixer:volume-down 5) - (message (format nil "Volume: ~s%" (pamixer:get-volume)))) - -(defcommand my-volume-up () () - (pamixer:volume-up 5) - (message (format nil "Volume: ~s%" (pamixer:get-volume)))) - -(defcommand my-toggle-mute () () - (pamixer:toggle-mute) - (if (pamixer:get-mute) - (message "Mute: ^2ON") - (message "Mute: ^1OFF"))) - -(defcommand my-brightness-up () () - (set-brightness "+5%")) - -(defcommand my-brightness-down () () - (set-brightness "5%-")) - -(defcommand my-brightness-one () () - (set-brightness "1")) - - -(define-key *top-map* (kbd "XF86AudioMute") "my-toggle-mute") -(define-key *top-map* (kbd "XF86AudioRaiseVolume") "my-volume-up") -(define-key *top-map* (kbd "XF86AudioLowerVolume") "my-volume-down") - -(define-key *top-map* (kbd "XF86MonBrightnessUp") "my-brightness-up") -(define-key *top-map* (kbd "XF86MonBrightnessDown") "my-brightness-down") - -(defun my-screenshoot-command-wrapper (screenshot-command ss-name) - (apply screenshot-command (list (concat - "~/Pictures/Screenshots/" - (string-trim - (string #\newline) - (run-shell-command "date +%Y-%M-%d-%T" t)) - "-" (or ss-name "untitled") - ".png")))) - - -(defcommand my-screenshot-area (ss-name) - ((:string "Screenshot name: ")) - (my-screenshoot-command-wrapper #'screenshot:screenshot-area ss-name)) - -(defcommand my-screenshot-window (ss-name) - ((:string "Screenshot name: ")) - (my-screenshoot-command-wrapper #'screenshot:screenshot-window ss-name)) - -(defcommand my-screenshot (ss-name) - ((:string "Screenshot name: ")) - (my-screenshoot-command-wrapper #'screenshot:screenshot ss-name)) - -(defvar *misc-keymap* - (let ((m (make-sparse-keymap))) - (define-key m (kbd "0") "my-toggle-mute") - (define-key m (kbd "+") "my-volume-up") - (define-key m (kbd "=") "my-volume-up") - (define-key m (kbd "-") "my-volume-down") - - (define-key m (kbd "p") "pass-copy-menu") - (define-key m (kbd "C-p") "pass-copy-menu") - (define-key m (kbd "g") "pass-generate") - (define-key m (kbd "C-g") "pass-generate") - - (define-key m (kbd "C-a") "my-screenshot-area") - (define-key m (kbd "a") "my-screenshot-area") - (define-key m (kbd "C-w") "my-screenshot-window") - (define-key m (kbd "w") "my-screenshot-window") - (define-key m (kbd "C-s") "my-screenshot") - (define-key m (kbd "s") "my-screenshot") - - m)) - - - - -(define-key *root-map* (kbd "C-m") '*misc-keymap*) - -;; -;; ;;; MODE-LINE -(require :cpu) -(require :mem) -(require :net) - -(require :stumptray) -(stumptray:add-mode-line-hooks) - -(defun update-stumptray-position (&rest args) - (setf (symbol-value (find-symbol "*TRAY-HEAD-SELECTION-FN*" :stumptray)) - (if (>= (list-length (stumpwm:screen-heads (stumpwm:current-screen))) 2) - #'second - #'first))) - -(stumpwm:add-hook stumpwm:*new-head-hook* 'update-stumptray-position) -(update-stumptray-position) - -(defun get-battery-status () - (let* ((state (string-trim - (string #\newline) - (run-shell-command - (concat "upower -i /org/freedesktop/UPower/devices/battery_BAT0 " - "| grep state: " - "| awk '{print $2}'") - t))) - (perc (string-trim - (string #\newline) - (run-shell-command (concat - "upower -i /org/freedesktop/UPower/devices/battery_BAT0 " - "| grep perc " - "| awk '{print $2}'") - t))) - (perc-num (parse-integer (aref (nth-value 1 (cl-ppcre:scan-to-strings "^(.*)\%$" perc)) 0)))) - (format - nil - (concat - "BAT: " - (cond - ((and (equal state "discharging") - (<= perc-num 20)) - "^1[-~a]^]") - ((equal state "discharging") "[-~a]") - ((equal state "charging") "[+~a]") - ((equal state "fully-charged") "[~a]") - (t (concat state " [~a]")))) - perc))) - - - -(setq *screen-mode-line-format* (list "[^B%n^b] %W ^> %C | %M | %l | " - '(:eval (get-battery-status)) - " " ;; empty space for stumptray icons - )) - -(require :yason) ;; json parser -(require :drakma) ;; http client - - -(defcommand kto-hakuje-p () () - (let* ((response (yason:parse - (flexi-streams:octets-to-string - (drakma:http-request "https://whois.at.hsp.sh/api/now")))) - (users (gethash "users" response)) - (unknown-devices (gethash "unknown_devices" response))) - (message (cond - ((and (= (list-length users) 0) - (= unknown-devices 0)) - "Spejs jest pusty!") - ((and (= (list-length users) 0) - (> unknown-devices 0)) - (format nil "W spejsie jest nieznanych ~a urzadzen." unknown-devices)) - ((and (> (list-length users) 0) - (= unknown-devices 0)) - (format nil "W spejsie jest ~a." users)) - ((and (> (list-length users) 0) - (> unknown-devices 0)) - (format nil "W spejsie jest ~a oraz ~a nieznane urzadzenia." users unknown-devices)))))) - - -(define-key *misc-keymap* (kbd "h") "kto-hakuje-p") -(define-key *misc-keymap* (kbd "C-h") "kto-hakuje-p") - - -(defun emacs-server-p () - (let ((status-code (caddr - (multiple-value-list - (uiop:run-program "ls /run/user/$(id -u)/emacs/server" - :ignore-error-status T))))) - (= status-code 0))) - -(stumpwm:defcommand emacs-start-server (&optional (show-message T) (wait-for-start NIL)) () - (let ((mess (if (not (emacs-server-p)) - (progn (stumpwm:run-shell-command "emacs --daemon" wait-for-start) - "Emacs server is starting....") - "Emacs server is running already!"))) - (when show-message (message mess)))) - -(stumpwm:defcommand emacs-stop-server (&optional (show-message T)) () - (let ((mess (if (emacs-server-p) - (progn (stumpwm:run-shell-command "emacsclient -e \"(server-force-delete)\"") - "Emacs server gone away :(....") - "Emacs server wasn't alive!"))) - (when show-message (message mess)))) - - -(stumpwm:defcommand emacs-restart-server (&optional (show-message T)) () - (emacs-stop-server NIL) - (emacs-start-server show-message)) - -(defun postwalk (fun tree) - (if (consp tree) - (loop :for a :in tree - :if (consp a) - :collect (postwalk fun a) - :else - :collect (funcall fun a)) - (funcall fun tree))) - -(defmacro eval-emacs-sexp (sexp - &key (create-new-frame NIL)) - `(stumpwm:run-shell-command - (format nil "emacsclient~{ ~A~} '~A'" - (list ,(if create-new-frame "-c" "") - "-e") - (postwalk (lambda (x) - (cond - ((stringp x) (concat "\"" x "\"")) - ((symbolp x) (string-downcase (string x))) - (T x))) - ,sexp)) - ,(not create-new-frame))) - - -(defmacro defcommand-from-emacs (name - (&rest args) - (&rest interactive-args) - (&key (create-new-frame T) (output-wrapper NIL)) - &body body) - `(stumpwm:defcommand ,name ,args ,interactive-args - (when (not (emacs-server-p)) - (emacs-start-server NIL T)) - - ,(let ((x `(eval-emacs-sexp (progn ,@body) - :create-new-frame ,create-new-frame))) - (cond - ((and create-new-frame output-wrapper) - (error "Cannot wrap the output, becaouse create-new-frame is T.")) - (output-wrapper `(funcall ,output-wrapper ,x)) - (T `(funcall (lambda (x) (progn x nil)) ,x)))))) - - -(defcommand-from-emacs emacs-client () () () - nil) - -(defcommand-from-emacs emacs-calc () () () - '(full-calc)) - -(defcommand-from-emacs emacs-org-agenda () () () - '(org-agenda-list)) - -(defcommand-from-emacs emacs-mu4e () () () - '(mu4e)) - -(defcommand-from-emacs emacs-shell () () () - '(shell)) - -(defcommand-from-emacs emacs-eshell () () () - '(eshell)) - -(defvar *emacs-keymap* - (let ((e (make-sparse-keymap))) - (define-key e (kbd "a") "emacs-org-agenda") - (define-key e (kbd "C-a") "emacs-org-agenda") - (define-key e (kbd "c") "emacs-calc") - (define-key e (kbd "C-c") "emacs-calc") - (define-key e (kbd "m") "emacs-mu4e") - (define-key e (kbd "C-m") "emacs-mu4e") - - e)) - - - - -(define-key *root-map* (kbd "C-e") '*emacs-keymap*) -(define-key *root-map* (kbd "e") "emacs-client") -(define-key *root-map* (kbd "c") "emacs-shell") -(define-key *root-map* (kbd "C") "emacs-eshell") - - -(emacs-start-server nil) diff --git a/files/.Xmodmap b/files/.Xmodmap new file mode 100644 index 0000000..cb4706f --- /dev/null +++ b/files/.Xmodmap @@ -0,0 +1,2 @@ +clear lock +keycode 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 @@ +# Honor per-interactive-shell startup file +if [ -f ~/.bashrc ]; then . ~/.bashrc; fi + +export GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles + +for i in $GUIX_EXTRA_PROFILES/*; do + profile=$i/$(basename "$i") + if [ -f "$profile"/etc/profile ]; then + GUIX_PROFILE="$profile" + . "$GUIX_PROFILE"/etc/profile + fi + unset profile +done + +export NIX_PATH=~/.nix-defexpr/channels/nixos/ + +. .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 @@ +#!/bin/sh + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +if [[ $(docker images | grep jd-arduino-cli | wc -l) -eq 0 ]] +then + docker build -f "$SCRIPT_DIR/jd-arduino-cli.Dockerfile" -t jd-arduino-cli . +fi + +docker run --rm --network none -it --privileged \ + -v $(pwd):/src \ + -v jd-arduino-cli-tmp:/tmp \ + -v /dev:/dev jd-arduino-cli \ + 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 @@ +#!/bin/sh + +CHIAKI_SHELL=/tmp/.chiaki.nix + +cat < $CHIAKI_SHELL +let + nixgl = import (fetchTarball https://github.com/guibou/nixGL/archive/main.tar.gz) { }; +in +{ nixpkgs ? import {} }: +with nixpkgs; mkShell { + buildInputs = [ + chiaki + nixgl.auto.nixGLDefault + ]; + shellHook = '' + nixGL chiaki && exit; + ''; +} +EOF + +nix-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 @@ +#!/bin/sh + +sudo 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 @@ +#!/bin/sh + +BOLD="\e[1"; +ENDCOLOR="\e[0m"; +Green="32"; +LightRed="31"; + +if ! [ $1 ]; then + echo "" + echo -e $BOLD";"";"$LightRed"m Please provide music url!"$ENDCOLOR + echo "" + exit +fi + +MUSIC_DIR="~/Documents/Music/%(artist)s/%(album)s/%(title)s-%(id)s.%(ext)s" +if [ $2 ]; then + MUSIC_DIR="${a}/%(artist)s/%(album)s/%(title)s-%(id)s.%(ext)s" +fi + +echo "" +echo -e $BOLD";"";"$Green"m Music will download to ${MUSIC_DIR} directory!"$ENDCOLOR +echo "" + +sleep 1 + +yt-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 @@ +#!/bin/sh + +# rm /tmp/arduino-sketch-*/ -r +~/.local/bin/arduino-cli cache clean +~/.local/bin/arduino-cli compile --fqbn esp8266:esp8266:nodemcuv2 +~/.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 @@ +#!/bin/sh + +BOLD="\e[1"; +ENDCOLOR="\e[0m"; +Green="32m"; +LightRed="31m"; + +echo "" +echo -e $BOLD";"";"$Green" FILE UPLOADER"$ENDCOLOR +echo "" + +if ! [ $1 ]; then + echo "" + echo -e $BOLD";"";"$LightRed" Please provide file path!"$ENDCOLOR + echo "" + exit +fi + +if [ $1 ]; then + echo -e " Are u sure u want upload this file: "$BOLD";"";"$Green" '$1'"$ENDCOLOR"? [y/N]: " + read -p " " input + echo "" + # read -r -p " " input + case $input in + [yY][eE][sS]|[yY]) + URL=$(curl -s -F "file=@$1" https://0x0.st); + echo -e " URL: "$BOLD";"";"$Green"$URL"$ENDCOLOR; + ;; + [nN][oO]|[nN]) + echo -e $BOLD";"";"$Green" OK"$ENDCOLOR; + ;; + *) + echo -e $BOLD";"";"$LightRed" Invalid input..."$ENDCOLOR; + exit 1 + ;; + esac + echo "" +fi; 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 @@ +#!/bin/sh + +guix shell -C -F -N \ + -E XDG_RUNTIME_DIR=/tmp \ + -E WAYLAND_DISPLAY \ + -E DISPLAY \ + --share=$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY=/tmp/$WAYLAND_DISPLAY \ + $@ 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 @@ +#!/bin/sh + +JD_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 @@ +FROM python:3.12-rc-slim + +RUN apt update && apt install -y wget && \ + wget https://downloads.arduino.cc/arduino-cli/nightly/arduino-cli_nightly-latest_Linux_64bit.tar.gz && \ + tar -C /usr/bin/ -xf arduino-cli_nightly-latest_Linux_64bit.tar.gz + +RUN mkdir ~/.arduino15 && \ + echo "board_manager:" > ~/.arduino15/arduino-cli.yaml && \ + echo " additional_urls:" >> ~/.arduino15/arduino-cli.yaml && \ + echo " - http://arduino.esp8266.com/stable/package_esp8266com_index.json" >> ~/.arduino15/arduino-cli.yaml + + +RUN arduino-cli core update-index && \ + arduino-cli core install esp8266:esp8266 + +WORKDIR /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 @@ +#!/bin/sh + +if [[ $1 ]]; then + PASS=$(oathtool -b --totp $(pass show "oath/$1")) + printf $PASS | wl-copy + echo "pass: $PASS" + echo "Password should be in your clipboard!" +else + echo "Usage: oath " + echo "Available pass:" + pass oath +fi + + 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 @@ +#!/bin/sh + +GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles +for i in $HOME/.config/guix/manifests/*; do + echo $i + MANIFEST_NAME=$(basename $i .scm) + mkdir -p "$GUIX_EXTRA_PROFILES"/"$MANIFEST_NAME" + guix package --manifest=$i --profile="$GUIX_EXTRA_PROFILES/$MANIFEST_NAME/$MANIFEST_NAME" +done 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 @@ +#!/bin/sh + +# Copyright (C) 2007 Jonathan Moore Liles +# +# Maintainer: Jonathan Moore Liles +# +# stumpish is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# stumpish is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this software; see the file COPYING. If not, see +# . + +### STUMPwm Interactive SHell. + +DELAY=0.01 + +if ! sleep $DELAY 2>/dev/null >&2 +then + DELAY=1 +fi + +# replace -E with -r option for old versions of GNU sed +if ! sed -E 1p /dev/null 2>/dev/null; then + sed() { shift; command sed -r "$@"; } +fi + +# parse C-style backslash sequences by default +if [ "$(echo -e foo)" = foo ]; then + echo() { builtin echo -e "$@"; } +fi + +wait_result () +{ + while true + do + RESULT=$(xprop -root -f STUMPWM_COMMAND_RESULT 8s \ + STUMPWM_COMMAND_RESULT 2>/dev/null | + sed -E 's/\\([[:digit:]]+)/\\0\1/g') + if echo "$RESULT" | grep -v -q 'not found.$' + then + break + fi + + sleep $DELAY + done + + xprop -root -remove STUMPWM_COMMAND_RESULT + + if echo "$RESULT" | grep -q '= $' + then + return 0 + fi + + echo "$RESULT" | + sed -E 's/[^"\\n]+"// + /^"[[:space:]]*$/d + s/(^|[^\\])\\n/\1\ +/g + s/\\(["\\n])/\1/g + s/\^([*[:digit:]]+|[Bbn])//g' +} + +send_cmd () +{ + local cmd="$1" + + if [ "$cmd" = "stumpwm-quit" ] + then + cmd=quit + elif [ "$cmd" = "quit" ] + then + exit + fi + + xprop -root -f STUMPWM_COMMAND 8s -set STUMPWM_COMMAND "$cmd" + + wait_result +} + +usage () +{ + cat <&2 +} + +tput () +{ + local cap1=$1 cap2=$2 + shift 2 + + command tput $cap1 $@ 2>/dev/null || + command tput $cap2 $@ 2>/dev/null +} + +READLINE=yes + +if [ "x$1" = "x-r" ] +then + READLINE=no + shift 1 +fi + +if [ $# -gt 0 ] +then + [ "$1" = "--help" ] && usage + if [ "$1" = "-e" ] + then + if [ $# -ne 2 ] + then + echo "'-e' requires exactly one argument!" + exit + fi + shift 1 + IFS='' + ARGS=$(cat /dev/stdin) + send_cmd "$1 $ARGS" + else + IFS=' ' + send_cmd "$*" + fi +else + if [ -t 0 ] + then + if ! type rlwrap 2>/dev/null >&2 + then + warn rlwrap not found, command completion won\'t work + elif [ $READLINE = yes ] + then + COMMANDS="${TMPDIR:-/tmp}/stumpish.commands.$$" + echo $(send_cmd "commands") | + sed -E 's/[[:space:]]+/\ +/g' | + sort > "$COMMANDS" + trap 'rm -f "$COMMANDS"' exit int term + rlwrap -b '' -f "$COMMANDS" "$0" -r + exit + fi + + tput AF setaf 5 + echo Welcome to the STUMPwm Interactive SHell. + tput me sgr0 + echo 'Type \c' + tput AF setaf 2 + echo 'commands\c' + tput me sgr0 + echo \ for a list of commands. + + while read -p '> ' REPLY + do + tput md bold + tput AF setaf 2 + send_cmd "$REPLY" + tput me sgr0 + done + else + while read REPLY + do + send_cmd "$REPLY" + done + fi +fi 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 @@ +#!/bin/sh + +sudo -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 @@ +#!/bin/sh + +sudo emerge --sync +sudo 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 @@ +#!/usr/bin/env -S guix shell guile guile-json -- guile --no-auto-compile -e main -s +-*- scheme -*- +!# + +(use-modules (srfi srfi-1) + (ice-9 iconv) + (ice-9 receive) + (web client) + (json)) + +(define whois-at-hsp-endpoint "https://whois.at.hsp.sh/api/now") + +(define (http-get-serialize-json url) + (receive (response data) (http-request url) + (values (json-string->scm (bytevector->string data "UTF-8")) + response))) + +(define (whois-data->users whois-data) + (assoc-ref whois-data "users")) + +(define (whois-data->unknown-devices whois-data) + (assoc-ref whois-data "unknown_devices")) + +(define (whois-data->head-count whois-data) + (assoc-ref whois-data "headcount")) + +(define (whois-data->formated-users whois-data) + (let ((users (vector->list (whois-data->users whois-data)))) + (if (> (length users) 0) + (fold-right + (lambda (a b) (string-append a " " b)) + "" + users) + "No visible users!"))) + +(define (whois-data->summary whois-data) + (string-append + "Unknown devices: " + (number->string (whois-data->unknown-devices whois-data)) + "\nUsers: [" (number->string (whois-data->head-count whois-data)) "] " + (whois-data->formated-users whois-data))) + +(define (notify data) + (system* "notify-send" + "WHOIS AT HSP" + (whois-data->summary data))) + +(define (command-line-option? option args) + (> (length (or (member option args) + '())) + 0)) + +(define-syntax-rule (command-line-args-handle args default ((option ...) body ...) ...) + (let ((option? (lambda (o) (command-line-option? o args)))) + (cond ((or (option? option) ...) body ...) ... + (#t default)))) + +;; (command-line-args-handle '("a" "--help") +;; 0 +;; (("-h" "--help") "dupa")) + +(define (main args) + (let ((whois-data (http-get-serialize-json whois-at-hsp-endpoint))) + (command-line-args-handle args + (begin (display (whois-data->summary whois-data)) + (newline)) + (("-h" "--help") + (display (string-append "-h, --help Help message\n" + "-n, --notify Notification massage with whois information.\n" + "-u Get users\n" + "-H Get head count\n" + "-U Get unknown devices\n"))) + (("-n" "--notify") + (notify whois-data)) + (("-u") + (display (whois-data->formated-users whois-data)) + (newline)) + (("-H") + (display (whois-data->head-count whois-data)) + (newline)) + (("-U") + (display (whois-data->unknown-devices whois-data)) + (newline))))) + 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 @@ +[cursor] +style = "Block" +unfocused_hollow = true + +[font] +size = 14 + +[font.italic] +family = "Terminus" +style = "Light Italic" + +[font.normal] +family = "Terminus" +style = "Light" + +[font.offset] +x = 0 +y = 0 + +[window] +dynamic_padding = true +# opacity = 0.90 + +[colors.bright] +black = "0x002b36" +blue = "0x839496" +cyan = "0x93a1a1" +green = "0x586e75" +magenta = "0x6c71c4" +red = "0xcb4b16" +white = "0xfdf6e3" +yellow = "0x657b83" + +[colors.normal] +black = "0x073642" +blue = "0x268bd2" +cyan = "0x2aa198" +green = "0x859900" +magenta = "0xd33682" +red = "0xdc322f" +white = "0xeee8d5" +yellow = "0xb58900" + +[colors.primary] +background = "0x002b36" +foreground = "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 @@ +[cursor] +style = "Block" +unfocused_hollow = true + +[font] +size = 14 + +[font.italic] +family = "Terminus" +style = "Light Italic" + +[font.normal] +family = "Terminus" +style = "Light" + +[font.offset] +x = 0 +y = 0 + +[window] +dynamic_padding = true +opacity = 0.90 + 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 @@ +colors: + # Default colors + primary: + background: '0x002b36' + foreground: '0x839496' + + # Normal colors + normal: + black: '0x073642' + red: '0xdc322f' + green: '0x859900' + yellow: '0xb58900' + blue: '0x268bd2' + magenta: '0xd33682' + cyan: '0x2aa198' + white: '0xeee8d5' + + # Bright colors + bright: + black: '0x002b36' + red: '0xcb4b16' + green: '0x586e75' + yellow: '0x657b83' + blue: '0x839496' + magenta: '0x6c71c4' + cyan: '0x93a1a1' + 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 @@ +[global] +frame_width = 2 +frame_color = "#39bae6" +font = sourcecodepro + +# Allow a small subset of html markup: +# bold +# italic +# strikethrough +# underline +# +# For a complete reference see +# . +# If markup is not allowed, those tags will be stripped out of the +# message. +markup = yes + +# The format of the message. Possible variables are: +# %a appname +# %s summary +# %b body +# %i iconname (including its path) +# %I iconname (without its path) +# %p progress value if set ([ 0%] to [100%]) or nothing +# Markup is allowed +format = "%s %p\n%b" + +# Sort messages by urgency. +sort = yes + +# Show how many messages are currently hidden (because of geometry). +indicate_hidden = yes + +# Alignment of message text. +# Possible values are "left", "center" and "right". +alignment = left + +# The frequency with wich text that is longer than the notification +# window allows bounces back and forth. +# This option conflicts with "word_wrap". +# Set to 0 to disable. +bounce_freq = 5 + + +# Show age of message if message is older than show_age_threshold +# seconds. +# Set to -1 to disable. +show_age_threshold = 60 + +# Split notifications into multiple lines if they don't fit into +# geometry. +word_wrap = no + +# Ignore newlines '\n' in notifications. +ignore_newline = no + + +# The geometry of the window: +# [{width}]x{height}[+/-{x}+/-{y}] +# The geometry of the message window. +# The height is measured in number of notifications everything else +# in pixels. If the width is omitted but the height is given +# ("-geometry x2"), the message window expands over the whole screen +# (dmenu-like). If width is 0, the window expands to the longest +# message displayed. A positive x is measured from the left, a +# negative from the right side of the screen. Y is measured from +# the top and down respectevly. +# The width can be negative. In this case the actual width is the +# screen width minus the width defined in within the geometry option. +geometry = "500x10-10+50" + +# Shrink window if it's smaller than the width. Will be ignored if +# width is 0. +shrink = yes + +# The transparency of the window. Range: [0; 100]. +# This option will only work if a compositing windowmanager is +# present (e.g. xcompmgr, compiz, etc.). +transparency = 15 + +# Don't remove messages, if the user is idle (no mouse or keyboard input) +# for longer than idle_threshold seconds. +# Set to 0 to disable. +# default 120 +idle_threshold = 120 + +# Which monitor should the notifications be displayed on. +monitor = 0 + +# Display notification on focused monitor. Possible modes are: +# mouse: follow mouse pointer +# keyboard: follow window with keyboard focus +# none: don't follow anything +# +# "keyboard" needs a windowmanager that exports the +# _NET_ACTIVE_WINDOW property. +# This should be the case for almost all modern windowmanagers. +# +# If this option is set to mouse or keyboard, the monitor option +# will be ignored. +follow = mouse + +# Should a notification popped up from history be sticky or timeout +# as if it would normally do. +sticky_history = yes + +# Maximum amount of notifications kept in history +history_length = 20 + +# Display indicators for URLs (U) and actions (A). +show_indicators = yes + +# The height of a single line. If the height is smaller than the +# font height, it will get raised to the font height. +# This adds empty space above and under the text. +line_height = 0 + +# Draw a line of "separator_height" pixel height between two +# notifications. +# Set to 0 to disable. +separator_height = 1 + +# Padding between text and separator. +# padding = 8 +padding = 8 + +# Horizontal padding. +horizontal_padding = 10 + +# Define a color for the separator. +# possible values are: +# * auto: dunst tries to find a color fitting to the background; +# * foreground: use the same color as the foreground; +# * frame: use the same color as the frame; +# * anything else will be interpreted as a X color. +separator_color = #263238 + +# Print a notification on startup. +# This is mainly for error detection, since dbus (re-)starts dunst +# automatically after a crash. +startup_notification = false + +# dmenu path. +dmenu = /usr/bin/dmenu -p dunst: + +# Browser for opening urls in context menu. +browser = palemoon + +# Align icons left/right/off +icon_position = left + +# Limit icons size. +max_icon_size=128 + +[urgency_low] +# IMPORTANT: colors have to be defined in quotation marks. +# Otherwise the "#" and following would be interpreted as a comment. +background "#0d1017" +foreground = "#888888" +timeout = 10 +# Icon for notifications with low urgency, uncomment to enable +#icon = /path/to/icon + +[urgency_normal] +background = "#1e2128" +foreground = "#ffffff" +timeout = 10 +# Icon for notifications with normal urgency, uncomment to enable +#icon = /path/to/icon + +[urgency_critical] +background = "#900000" +foreground = "#ffffff" +frame_color = "#ff0000" +timeout = 0 +# Icon for notifications with critical urgency, uncomment to enable +#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 @@ +(cons* (channel + (name 'rustup) + (url "https://github.com/declantsien/guix-rustup") + (introduction + (make-channel-introduction + "325d3e2859d482c16da21eb07f2c6ff9c6c72a80" + (openpgp-fingerprint + "F695 F39E C625 E081 33B5 759F 0FC6 8703 75EF E2F5")))) + + (channel + (name 'nonguix) + (url "https://gitlab.com/nonguix/nonguix") + ;; Enable signature verification: + (introduction + (make-channel-introduction + "897c1a470da759236cc11798f4e0a5f7d4d59fbc" + (openpgp-fingerprint + "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5")))) + %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 @@ +/home/jakub/Projects/laco +/home/jakub/Projects/yasa +/home/jakub/Projects/trial +/home/jakub/Projects/matura-infa +/home/jakub/Projects/abaks-infra +/home/jakub/Projects/lispz +/home/jakub/Projects/zig-learning +/home/jakub/Projects/let-over-lambda +/home/jakub/Projects/rust +/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 @@ +# ____ _____ +# | _ \_ _| Derek Taylor (DistroTube) +# | | | || | http://www.youtube.com/c/DistroTube +# | |_| || | http://www.gitlab.com/dwt1/ +# |____/ |_| +# +# My config. Not much to see here; just some pretty standard stuff. + +# Enabled client-side shadows on windows. Note desktop windows +# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, +# unless explicitly requested using the wintypes option. +# +shadow = true; + +# The blur radius for shadows, in pixels. (defaults to 12) +shadow-radius = 8; + +# The opacity of shadows. (0.0 - 1.0, defaults to 0.75) +shadow-opacity = .6 + +# The left offset for shadows, in pixels. (defaults to -15) +shadow-offset-x = -3; + +# The top offset for shadows, in pixels. (defaults to -15) +shadow-offset-y = -3; + +# Specify a list of conditions of windows that should have no shadow. +# +# examples: +# shadow-exclude = "n:e:Notification"; +# +# shadow-exclude = [] +shadow-exclude = [ + "name = 'Notification'", + "class_g = 'Conky'", + "class_g ?= 'Notify-osd'", + "class_g = 'Cairo-clock'", + "class_g = 'slop'", + "class_g = 'Polybar'", + "_GTK_FRAME_EXTENTS@:c" +]; + + +# Fade windows in/out when opening/closing and when opacity changes, +# unless no-fading-openclose is used. +# fading = false +fading = true; + +# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) +# fade-in-step = 0.028 +fade-in-step = 0.3; + +# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03) +# fade-out-step = 0.03 +fade-out-step = 0.3; + +# The time between steps in fade step, in milliseconds. (> 0, defaults to 10) +# fade-delta = 10 + +# Specify a list of conditions of windows that should not be faded. +# don't need this, we disable fading for all normal windows with wintypes: {} +fade-exclude = [ + "class_g = 'slop'" # maim +] + +# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0) +inactive-opacity = 0.9 +# inactive-opacity = 1.0; + +# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default) +# frame-opacity = 1.0 +frame-opacity = 0.7; + +# Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0) +# menu-opacity = 1.0 +# menu-opacity is depreciated use dropdown-menu and popup-menu instead. + +#If using these 2 below change their values in line 510 & 511 aswell +popup_menu = { opacity = 0.8; } +dropdown_menu = { opacity = 0.8; } + + +# Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows. +# inactive-opacity-override = true +inactive-opacity-override = false; + +# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0) +active-opacity = 1.0; + +# Dim inactive windows. (0.0 - 1.0, defaults to 0.0) +# inactive-dim = 0.0 + +# Specify a list of conditions of windows that should always be considered focused. +# focus-exclude = [] +focus-exclude = [ + "class_g = 'Cairo-clock'", + "class_g = 'Bar'", # lemonbar + "class_g = 'slop'" # maim +]; + +opacity-rule = [ + "100:class_g = 'XTerm'", + "100:class_g = 'URxvt'", + "100:class_g = 'firefox'", + "100:class_g = 'Thunderbird'" +]; + +wintypes: +{ + normal = { fade = false; shadow = true; } + tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; + dock = { shadow = false; } + dnd = { shadow = true; } + popup_menu = { opacity = 0.8; } + dropdown_menu = { opacity = 0.8; } +}; + 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 @@ +[settings] +screenchange-reload = true + +[colors] +background = ${xrdb:emacs.background} +foreground = ${xrdb:emacs.foreground} +primary = #7fd962 +disabled = #707880 + +[bar/example] +width = 100% +height = 18pt + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 1.5pt + +padding-left = 0 +padding-right = 1 + +module-margin = 1 + +separator = | +separator-foreground = ${colors.disabled} + +font-0 = "Terminus:size=15" +font-1 = "FontAwesome" + +modules-left = xworkspaces +modules-right = memory cpu battery date + +cursor-click = pointer +cursor-scroll = ns-resize + +enable-ipc = true + +tray-position = right + +[module/xworkspaces] +type = internal/xworkspaces + +icon-0 = 1;0 +icon-1 = 2;1 +icon-2 = 3;2 +icon-3 = 4;3 +icon-4 = 5;4 +icon-5 = 6;5 +icon-6 = 7;6 +icon-7 = 8;7 +icon-8 = 9;8 +icon-9 = 10;9 + +label-active = %icon% +label-active-background = ${colors.background-alt} +label-active-underline= ${colors.primary} +label-active-padding = 1 + +label-occupied = %icon% +label-occupied-padding = 1 + +label-urgent = %icon% +label-urgent-background = ${colors.alert} +label-urgent-padding = 1 + +label-empty = %icon% +label-empty-foreground = ${colors.disabled} +label-empty-padding = 1 + +[module/battery] +type = internal/battery +battery = BAT0 +adapter = ADP1 + +format-charging = +format-discharging = +format-low = +format-full = + +label-charging = %percentage%% +label-discharging = %percentage%% +label-low = LOW %percentage%% +label-full = FULL %percentage%% + +ramp-capacity-0 =  +ramp-capacity-1 =  +ramp-capacity-2 =  +ramp-capacity-3 =  +ramp-capacity-4 =  +ramp-capacity-foreground = ${colors.primary} + +animation-charging-0 =  +animation-charging-1 =  +animation-charging-2 =  +animation-charging-3 =  +animation-charging-4 =  +animation-charging-foreground = ${colors.primary} +animation-charging-framerate = 750 + +[module/memory] +type = internal/memory +interval = 2 +format-prefix = "RAM " +format-prefix-foreground = ${colors.primary} +label = %percentage_used:2%% + +[module/cpu] +type = internal/cpu +interval = 2 +format-prefix = "CPU " +format-prefix-foreground = ${colors.primary} +label = %percentage:2%% + +[module/date] +type = internal/date +interval = 1 + +date = %H:%M +date-alt = %Y-%m-%d %H:%M:%S + +label = %date% +label-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 @@ +#!/bin/bash + +function monitor_settings() { + sleep .5 + monitor_status=$(xrandr | grep "HDMI-1-4 connected" | wc -l) + + if [ $monitor_status == 1 ]; + then + # xrandr --auto + # xrandr --output eDP-1 --off + xrandr --output eDP-1-1 --auto --output HDMI-0 --auto --left-of eDP-1-1 + fi +} + +function caps_to_esc(){ xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'; } + +function start() { + killall $1 + sleep .5 + $($1 $2) & +} + +# monitor_settings +caps_to_esc + +start nitrogen "--restore" +start picom "" +start spotifyd "" +start rclone "mount remote:/sync /home/jakub/Sync" +start emacs "--daemon" +xinput 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 @@ +import os +import subprocess + +from typing import List + +from libqtile import bar, layout, widget +from libqtile.config import Click, Drag, Group, Key, Match, Screen, KeyChord +from libqtile import extension +from libqtile.lazy import lazy +from libqtile.utils import guess_terminal +from libqtile import hook + +MOD = "mod4" + +TERMINAL = guess_terminal() + +DMENU_FLAGS = '-l 16 -p run -c -i' + +BAR = '#282a36' +LIGHT_BAR = '#393b37' +YELLOW = '#f1fa8c' +RED = '#ff5555' +LIGHT_RED = '#ff9999' +GREEN = '#50fa7b' +CYAN = '#8be9fd' +LIGHT_CYAN = '#abfbff' + +@hook.subscribe.startup_once +def autostart(): + home = os.path.expanduser('~/.config/qtile/autorc') + subprocess.run([home]) + +keys = [ + Key([MOD], "h", lazy.layout.left(), desc="Move focus to left"), + Key([MOD], "l", lazy.layout.right(), desc="Move focus to right"), + Key([MOD], "j", lazy.layout.down(), desc="Move focus down"), + Key([MOD], "k", lazy.layout.up(), desc="Move focus up"), + Key([MOD], "s", lazy.next_screen() ), + Key([MOD], "space", lazy.window.toggle_floating(), + desc="Move window focus to other window"), + + Key([MOD, "shift"], "h", lazy.layout.shuffle_left(), + desc="Move window to the left"), + Key([MOD, "shift"], "l", lazy.layout.shuffle_right(), + desc="Move window to the right"), + Key([MOD, "shift"], "j", lazy.layout.shuffle_down(), + desc="Move window down"), + Key([MOD, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"), + + Key([MOD, "control"], "h", lazy.layout.grow_left(), + desc="Grow window to the left"), + Key([MOD, "control"], "l", lazy.layout.grow_right(), + desc="Grow window to the right"), + Key([MOD, "control"], "j", lazy.layout.grow_down(), + desc="Grow window down"), + Key([MOD, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"), + Key([MOD], "n", lazy.layout.normalize(), desc="Reset all window sizes"), + + Key([MOD, "shift"], "Return", lazy.layout.toggle_split(), + desc="Toggle between split and unsplit sides of stack"), + Key([MOD], "Return", lazy.spawn(TERMINAL), desc="Launch terminal"), + + Key([MOD], "Tab", lazy.next_layout(), desc="Toggle between layouts"), + Key([MOD], "c", lazy.window.kill(), desc="Kill focused window"), + + Key([MOD, "control"], "r", lazy.restart(), desc="Restart Qtile"), + Key([MOD, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"), + + Key([MOD], "F12", os.system("xbacklight -inc 10"), desc="Inc backlight"), + Key([MOD], "F11", os.system("xbacklight -dec 10"), desc="Dec backlight"), + + Key([MOD], "r", lazy.spawncmd(), + desc="Spawn a command using a prompt widget"), + + KeyChord([MOD], "p", [ + Key([], "p", lazy.spawn(f"dmenu_run {DMENU_FLAGS}"), desc="Spawn dmenu run"), + Key([], "n", lazy.spawn(f"networkmanager_dmenu {DMENU_FLAGS}"), desc="Spawn dmenu for network manager"), + ]), + + Key([MOD, "mod1"], "q", lazy.spawn("qutebrowser"), desc="Spawn qutebrowser"), + Key([MOD, "mod1"], "b", lazy.spawn("brave"), desc="Spawn brave"), + Key([MOD, "mod1"], "f", lazy.spawn("firefox"), desc="Spawn firefox"), + + KeyChord([MOD], "e", [ + Key([], "e", lazy.spawn("emacsclient -c -a 'emacs'"), desc="Spawn Emacsclient"), + Key([], "d", lazy.spawn("emacsclient -c -a 'emacs' --eval '(dired nil)'"), desc='Emacsclient Dired'), + Key([], "m", lazy.spawn("emacsclient -c -a 'emacs' --eval '(emms-browser)'"), desc='Emacsclient Dired'), + ]), + + Key([MOD, "mod1"], "s", lazy.spawn("alacritty -e spt"), desc="Spawn spt (spotify clent)"), + Key([MOD, "mod1"], "l", lazy.spawn("slock"), desc="lock desktop"), + Key([MOD, "mod1"], "r", lazy.spawn("alacritty -e ranger"), desc="Spawn ranger (file manager)"), + Key([MOD, "mod1"], "p", lazy.spawn("alacritty -e pulsemixer"), desc="Spawn pulsemixer"), +] + +groups_names = [ + "dev", + "www", + "music", + "virt", + "sys", + "other" +] + +groups = [Group(i) for i in groups_names] +for i, group in enumerate(groups): + keys.extend([ + Key([MOD], str(i+1), lazy.group[group.name].toscreen(), + desc="Switch to group {}".format(group.name)), + + Key([MOD, "shift"], str(i+1), lazy.window.togroup(group.name, switch_group=True), + desc="Switch to & move focused window to group {}".format(group.name)), + ]) + +mouse = [ + Drag([MOD], "Button1", lazy.window.set_position_floating(), + start=lazy.window.get_position()), + Drag([MOD], "Button3", lazy.window.set_size_floating(), + start=lazy.window.get_size()), + Click([MOD], "Button2", lazy.window.bring_to_front()) +] + +layout_cfg = { + 'border_width': 2, + 'border_normal': "#bb8888", + 'border_focus': "884444", + 'margin': 8 +} + +layouts = [ + # layout.Columns(**layout_cfg), + # layout.Max(), + layout.Stack(num_stacks=1, **layout_cfg), + # layout.Bsp(), + # layout.Matrix(), + layout.MonadTall(**layout_cfg), + # layout.MonadWide(), + # layout.RatioTile(), + # layout.Tile(), + # layout.TreeTab(), + # layout.VerticalTile(), + # layout.Zoomy(), +] + +widget_defaults = dict( + font='sans', + fontsize=12, + padding=6, +) + +transparent_sep = { + 'foreground': BAR, + 'margin': 2 +} + +soft_sep = { + 'foreground': '44475a', + 'padding': 2, + 'margin': 4 +} + +screens = [ + Screen( + top=bar.Bar( + [ + widget.Sep(**transparent_sep), + widget.Image(filename="~/.config/qtile/python.png", margin=4), + widget.Sep(**transparent_sep), + widget.CurrentLayout(), + widget.Sep(**transparent_sep), + widget.GroupBox( + margin_y = 3, + margin_x = 0, + padding_y = 5, + padding_x = 3, + borderwidth = 3, + rounded = False, + highlight_color = LIGHT_BAR, + highlight_method = "line", + this_current_screen_border = CYAN, + this_screen_border = CYAN, + other_current_screen_border = LIGHT_BAR, + other_screen_border = LIGHT_BAR, + ), + widget.Prompt(), + widget.Sep(**transparent_sep), + widget.WindowName(), + widget.Net(format="🌐 ↓{down} ↑{up}", foreground=YELLOW), + widget.Sep(**soft_sep), + widget.CPU(format='💻 {load_percent}%', fontsize=12, foreground=RED), + widget.Sep(**soft_sep), + widget.Battery(format='🔋 {char} {percent:2.0%} {hour:d}:{min:02d} {watt:.2f} W', foreground=GREEN), + widget.Sep(**soft_sep), + widget.Clock(format='📅 %B %-d, %H:%M', foreground=CYAN), + widget.Sep(**soft_sep), + widget.CurrentScreen(), + widget.Sep(**soft_sep), + widget.Systray() + ], + 24, + margin=8, + background=BAR, + border_color=CYAN, + border_width=1 + ), + ), +] + +floating_layout = layout.Floating(float_rules=[ + # Run the utility of `xprop` to see the wm class and name of an X client. + *layout.Floating.default_float_rules, + Match(wm_class='confirmreset'), # gitk + Match(wm_class='makebranch'), # gitk + Match(wm_class='maketag'), # gitk + Match(wm_class='ssh-askpass'), # ssh-askpass + Match(title='branchdialog'), # gitk + Match(title='pinentry'), # GPG key password entry +]) + +dgroups_key_binder = None +dgroups_app_rules = [] + +follow_mouse_focus = True +bring_front_click = False +cursor_warp = False +auto_fullscreen = True +focus_on_window_activation = "smart" +reconfigure_screens = True + +auto_minimize = True + +wmname = "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 Binary files /dev/null and b/files/.config/qtile/photos/desktop.png differ diff --git a/files/.config/qtile/python.png b/files/.config/qtile/python.png new file mode 100644 index 0000000..9a4b1ed Binary files /dev/null and b/files/.config/qtile/python.png 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 @@ +#+title: Config + +* Qtile conifg +- My personal qtile config ;) + [[./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 @@ +set $mod Mod4 + +set $left h +set $down j +set $up k +set $right l + +set $term alacritty +set $emacs emacsclient -c +set $menu fuzzel -r0 -b 282828f2 -C 458588f2 -B 3 -s 458588f2 -S 282828FF --font "Terminus:size=12" -p "run: " + +set $laptop-display eDP-1 +set $generic-display HDMI-A-1 +set $primary-home-display 'Iiyama North America PLE2407HDSD 0x01010101' +set $secondary-home-display 'Dell Inc. DELL E190S M8VPV186CELI' + +set $primary-display-layout 'Samsung Electric Company C34H89x HTJM200007' $primary-home-display $generic-display $laptop-display +set $secondary-display-layout $secondary-home-display $laptop-display + +# output * bg SPOILER_33.png fill +output * bg #002b36 solid_color + +output $laptop-display resolution 1920x1080 position 1920,0 +output $generic-display resolution 1920x1080 position 0,0 +output $primary-home-display resolution 1920x1080 position 0,0 +output $secondary-home-display resolution 1280x1024 position 1920,0 +set $opacity 0.9 + +client.focused #002b36 #586e75 #eee8d5 #268bd2 +client.focused_inactive #002b36 #073642 #93a1a1 #268bd2 +client.unfocused #002b36 #073642 #93a1a1 #268bd2 +client.urgent #002b36 #dc322f #fdf6e3 #002b36 + +input type:keyboard { + xkb_layout pl,us +} + +input type:touchpad { + tap enabled + middle_emulation enabled +} + +bindsym $mod+Shift+s output $laptop-display toggle + +set $swaylock 'swaylock -f -c 000000 --font "Terminus"' +exec swayidle -w \ + timeout 280 $swaylock \ + timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ + before-sleep $swaylock + +# inhibit_idle fullscreen + +bindsym $mod+Escape exec $swaylock + +bindsym XF86MonBrightnessUp exec brightnessctl set 5%+ +bindsym XF86MonBrightnessDown exec brightnessctl set 5%- + +bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% +bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% + +bindsym XF86AudioNext exec playerctl next +bindsym XF86AudioPrev exec playerctl previous +bindsym XF86AudioPlay exec playerctl play-pause +bindsym XF86AudioPause exec playerctl pause + +bindsym print exec grimshot --notify copy area +bindsym $mod+print exec grimshot --notify copy output +bindsym $mod+Ctrl+print grimshot save area - | swappy -f - + +bindsym $mod+Return exec $term + +bindsym $mod+Shift+q kill + +floating_modifier $mod normal + +bindsym $mod+Shift+c reload +bindsym $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' + +bindsym $mod+$left focus left +bindsym $mod+$down focus down +bindsym $mod+$up focus up +bindsym $mod+$right focus right + +bindsym $mod+Shift+$left move left +bindsym $mod+Shift+$down move down +bindsym $mod+Shift+$up move up +bindsym $mod+Shift+$right move right + +workspace 1 output $primary-display-layout +workspace 2 output $primary-display-layout +workspace 3 output $secondary-display-layout +workspace 4 output $secondary-display-layout +workspace 9 output $primary-display-layout +workspace 10 output $secondary-display-layout + +bindsym $mod+1 workspace number 1 +bindsym $mod+2 workspace number 2 +bindsym $mod+3 workspace number 3 +bindsym $mod+4 workspace number 4 +bindsym $mod+5 workspace number 5 +bindsym $mod+6 workspace number 6 +bindsym $mod+7 workspace number 7 +bindsym $mod+8 workspace number 8 +bindsym $mod+9 workspace number 9 +bindsym $mod+0 workspace number 10 + +bindsym $mod+Shift+1 move container to workspace number 1 +bindsym $mod+Shift+2 move container to workspace number 2 +bindsym $mod+Shift+3 move container to workspace number 3 +bindsym $mod+Shift+4 move container to workspace number 4 +bindsym $mod+Shift+5 move container to workspace number 5 +bindsym $mod+Shift+6 move container to workspace number 6 +bindsym $mod+Shift+7 move container to workspace number 7 +bindsym $mod+Shift+8 move container to workspace number 8 +bindsym $mod+Shift+9 move container to workspace number 9 +bindsym $mod+Shift+0 move container to workspace number 10 + +assign [app_id="(firefox-default|Firefox|qutebrowser|Chromium-browser)"] 2 +assign [instance="(chromium-browser)"] 2 +assign [instance="(spotify)"] 3 +assign [app_id=".blueman-manager-real"] 3 +assign [app_id="pavucontrol"] 3 +assign [app_id="(org.telegram.desktop)"] 4 +assign [app_id="vesktop"] 4 +assign [app_id="com.ktechpit.whatsie"] 4 +assign [instance="(discord)"] 4 + +# for_window [app_id="vesktop"] opacity $opacity + +bindsym $mod+b splith +bindsym $mod+v splitv + +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +bindsym $mod+f fullscreen +bindsym $mod+Shift+space floating toggle +bindsym $mod+space focus mode_toggle +bindsym $mod+a focus parent + +bindsym $mod+Shift+minus move scratchpad +bindsym $mod+minus scratchpad show + +mode "resize" { + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + bindsym Return mode "default" + bindsym Control+g mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + +set $default swaymsg mode default +mode "menu" { + bindsym --no-repeat e exec '$default; $emacs;' + bindsym --no-repeat w exec "$default; whois-at-hsp -n" + + bindsym Return mode "default" + bindsym Control+g mode "default" + bindsym Escape mode "default" + +} +bindsym $mod+o mode "menu" + + +workspace_layout tabbed + +# default_border normal 3 +# gaps outer 0 +# gaps inner 6 +# corner_radius 4 +# blur_xray disable +# blur enable +# layer_effects "waybar" blur enable + +font Terminus (TTF) 12 +bindsym $mod+p exec $menu + + +# Taken from dawivil dotfiles. +exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway + +# exec udiskie -t +exec mako --font "Terminus (TTF)" --outer-margin=5 --margin=3 --border-size=3 --default-timeout=7000 --background="#282828e0" + +exec nm-applet --indicator +exec blueman-applet +exec waybar +exec udiskie -t +exec 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 @@ +{ + "layer": "top", + "position": "top", + + "modules-left": [ + "sway/workspaces", + "sway/mode" + ], + + "modules-right": [ +// "custom/whois", + "pulseaudio", + "network", + "memory", + "cpu", + "temperature", + "battery", + "sway/language", + "clock#date", + "clock#time", + "idle_inhibitor", + "tray" + ], + + // Modules + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + + "battery": { + "interval": 10, + "states": { + "warning": 30, + "critical": 15 + }, + "format-time": "{H}:{M:02}", + "format": "{icon} {capacity}% ({time})", + "format-charging": " {capacity}% ({time})", + "format-charging-full": " {capacity}%", + "format-full": "{icon} {capacity}%", + "format-alt": "{icon} {power}W", + "format-icons": [ + "", + "", + "", + "", + "" + ], + "tooltip": false + }, + + "clock#time": { + "interval": 10, + "format": "{:%H:%M}", + "tooltip": false + }, + + "clock#date": { + "interval": 20, + "format": " {:%e %b %Y}", + "tooltip": false + //"tooltip-format": "{:%e %B %Y}" + }, + + "cpu": { + "interval": 5, + "tooltip": false, + "format": " {usage}%", + "format-alt": " {load}", + "states": { + "warning": 70, + "critical": 90 + } + }, + + "sway/language": { + "format": " {}", + "min-length": 5, + "on-click": "swaymsg 'input * xkb_switch_layout next'", + "tooltip": false + }, + + "memory": { + "interval": 5, + "format": " {used:0.1f}G/{total:0.1f}G", + "states": { + "warning": 70, + "critical": 90 + }, + "tooltip": false + }, + + "network": { + "interval": 5, + "format-wifi": " {essid} ({signalStrength}%)", + "format-ethernet": " {ifname}", + "format-disconnected": "No connection", + "format-alt": " {ipaddr}/{cidr}", + "tooltip": false + }, + + "sway/mode": { + "format": "{}", + "tooltip": false + }, + + "sway/window": { + "format": "{}", + "max-length": 30, + "tooltip": false + }, + + "sway/workspaces": { + "disable-scroll-wraparound": true, + "smooth-scrolling-threshold": 4, + "enable-bar-scroll": true, + "format": "{name}" + }, + + "pulseaudio": { + "format": "{icon} {volume}%", + "format-bluetooth": "{icon} {volume}%", + "format-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", ""] + }, + "scroll-step": 1, + "on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle", + "tooltip": false + }, + + "temperature": { + "critical-threshold": 90, + "interval": 5, + "format": "{icon} {temperatureC}°", + "format-icons": [ + "", + "", + "", + "", + "" + ], + "tooltip": false + }, + + "tray": { + "icon-size": 18, + } +} 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 @@ +/* Keyframes */ + +@keyframes blink-critical { + to { + /*color: @white;*/ + background-color: @critical; + } +} + + +/* Styles */ + +/* Colors (gruvbox) */ +@define-color black #073642; +@define-color red #dc322f; +@define-color green #859900; +@define-color yellow #b58900; +@define-color blue #268bd2; +@define-color purple #d33682; +@define-color aqua #00afaf; +@define-color gray #1c1c1c; +@define-color brgray #928374; +@define-color brred #cb4b16; +@define-color brgreen #586e75; +@define-color bryellow #657b83; +@define-color brblue #839496; +@define-color brpurple #6c71c4; +@define-color braqua #93a1a1; +@define-color white #eee8d5; +@define-color bg1 #073642; +@define-color bg2 #002b36; + + +@define-color warning @bryellow; +@define-color critical @red; +@define-color mode @bg2; +@define-color unfocused @bg2; +@define-color focused @blue; +@define-color inactive @purple; +@define-color sound @green; +@define-color network @yellow; +@define-color memory @aqua; +@define-color cpu @blue; +@define-color temp @brpurple; +@define-color layout @green; +@define-color battery @yellow; +@define-color date @aqua; +@define-color time @bg2; +@define-color tray @bg2; + +/* Reset all styles */ +* { + border: none; + border-radius: 0; + min-height: 0; + margin: 0; + padding: 0; + box-shadow: none; + text-shadow: none; + icon-shadow: none; +} + +/* The whole bar */ +#waybar { + background: @bg2; + color: @white; + font-family: "Terminus (TTF)", FontAwesome; + font-size: 12pt; +} + +/* Each module */ +#battery, +#clock, +#cpu, +#language, +#memory, +#mode, +#network, +#pulseaudio, +#temperature, +#tray, +#backlight, +#idle_inhibitor, +#disk, +#user, +#mpris { + padding-left: 8pt; + padding-right: 8pt; +} + +/* Each critical module */ +#memory.critical, +#cpu.critical, +#temperature.critical, +#battery.critical.discharging { + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + animation-name: blink-critical; + animation-duration: 1s; +} + +/* Each warning */ +#network.disconnected, +#memory.warning, +#cpu.warning, +#temperature.warning, +#battery.warning.discharging { + color: @warning; +} + +/* And now modules themselves in their respective order */ + +/* Current sway mode (resize etc) */ +#mode { + color: @white; + background: @mode; +} + +/* Workspaces stuff */ +#workspaces button { + /*font-weight: bold;*/ + padding-left: 2pt; + padding-right: 2pt; + color: @white; + background: @unfocused; +} + +/* Inactive (on unfocused output) */ +#workspaces button.visible { + color: @white; + background: @inactive; +} + +/* Active (on focused output) */ +#workspaces button.focused { + color: @black; + background: @focused; +} + +/* Contains an urgent window */ +#workspaces button.urgent { + color: @black; + background: @warning; +} + +/* Style when cursor is on the button */ +#workspaces button:hover { + background: @black; + color: @white; +} + +#window { + margin-right: 35pt; + margin-left: 35pt; +} + +#pulseaudio { + background: @sound; + color: @black; +} + +#network { + background: @network; + color: @white; +} + +#memory { + background: @memory; + color: @black; +} + +#cpu { + background: @cpu; + color: @white; +} + +#temperature { + background: @temp; + color: @black; +} + +#language { + background: @layout; + color: @black; +} + +#battery { + background: @battery; + color: @white; +} + +#tray { + background: @tray; +} + +#clock.date { + background: @date; + color: @black; +} + +#clock.time { + background: @time; + color: @white; +} 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 @@ +* +!init.el +!jd +!jd/* +!.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 @@ +;;; Dotfiles --- Jakub Dlugosz emacs config +;;; Commentary: + +;;; Code: + +;; Minimize garbage collection during startup +(setq gc-cons-threshold most-positive-fixnum) + +;; Lower threshold back to 8 MiB (default is 800kB) +(add-hook 'emacs-startup-hook + (lambda () + (setq gc-cons-threshold (expt 2 23)))) + +(defvar jd/manifest-list + nil + "List that contain Emacs packages for GNU/Guix." ) + +(defvar jd/exwm-p + (or (not (null (getenv "JD_EXWM"))) + (and (seq-contains command-line-args "exwm" #'string-match) + t)) + "Is non-nil when Emacs is run as a window manager.") + +(defvar jd/guix-p + (and (eq system-type 'gnu/linux) + (file-exists-p "/etc/os-release") + (with-temp-buffer + (insert-file-contents "/etc/os-release") + (search-forward "ID=guix" nil t)) + t) + "Is non-nil when Emacs packages are installed by GNU/Guix package manager.") + +(defun jd/add-package-to-manifest (guix-package-name) + "Add GUIX-PACKAGE-NAME to jd/manifest-list." + (unless (member guix-package-name jd/manifest-list) + (setq jd/manifest-list + (cons guix-package-name jd/manifest-list)))) + +(add-to-list 'load-path (concat user-emacs-directory "/jd")) + +(defun jd/display-startup-time () + (message "Emacs loaded in %s with %d garbage collections." + (format "%.2f seconds" + (float-time + (time-subtract after-init-time before-init-time))) + gcs-done)) + +(defun jd-emacs/startup () + "This procedure will run after Emacs startup." + (electric-pair-mode 1) + (global-company-mode 1) + (jd/display-startup-time)) + +(add-hook 'emacs-startup-hook #'jd-emacs/startup) + +(setq user-full-name "Jakub Dlugosz" + user-mail-address "jdlugosz963@gmail.com") + +(setq backup-directory-alist '(("." . "~/.cache/emacs/backup")) + backup-by-copying t + version-control t + delete-old-versions t + kept-new-versions 20 + kept-old-versions 5 + custom-file (concat user-emacs-directory + "custom.el")) + +;; (setq user-emacs-directory "~/.cache/emacs") + +(require 'package) +(setq package-archives '(("melpa" . "https://melpa.org/packages/") + ("org" . "https://orgmode.org/elpa/") + ("gnu-devel" . "https://elpa.gnu.org/devel/") + ("elpa" . "https://elpa.gnu.org/packages/"))) +(package-initialize) + +(unless package-archive-contents + (package-refresh-contents)) + +(jd/add-package-to-manifest "emacs-use-package") +(unless jd/guix-p + (unless (package-installed-p 'use-package) + (package-install 'use-package))) + +(require 'use-package) + +(setq use-package-always-ensure (not jd/guix-p)) + +(defun jd/generate-manifest () + "Generate GNU/Guix Emacs manifest to temp-buffer." + (interactive) + (with-output-to-temp-buffer "*guix-emacs-packages-manifest.scm*" + (princ (concat ";; This file is auto-generated by Emacs " + "function: jd/manifest-generate-to-file \n")) + (princ `(specifications->manifest + '(,@(mapcar #'(lambda (guix-package-name) + (concat "\"" + guix-package-name + "\"\n")) + jd/manifest-list)))))) + +(defun use-package-normalize/:guix-package (name keyword args) + (use-package-as-one (symbol-name keyword) args + #'(lambda (_label arg) + (cond + ((consp arg) arg) + ((stringp arg) (list arg)) + ((use-package-non-nil-symbolp arg) (symbol-name arg)) + (t + (use-package-error + ":pin wants an archive name (a string)")))))) + +(defun use-package-handler/:guix-package + (name _keyword args rest state) + (let ((body (use-package-process-keywords name rest state))) + (use-package-concat + (when (consp args) + (mapcar #'(lambda (arg) + `(jd/add-package-to-manifest ,arg)) + args)) + body))) + +(add-to-list 'use-package-keywords ':guix-package) + +(jd/add-package-to-manifest "emacs") +(jd/add-package-to-manifest "emacs-guix") + +(require 'jd-keys) +(require 'jd-ui) +(require 'jd-org) +(require 'jd-dev) +(require 'jd-apps) +(require 'jd-custom) +(require 'jd-mu4e) +(require 'jd-misc) +(require 'jd-sway) + +(when jd/exwm-p + (require 'jd-exwm)) + +;; (setq gc-cons-threshold (* 2 1000 1000)) + +;;; init.el ends here +(put 'upcase-region 'disabled nil) +(put 'downcase-region 'disabled nil) +(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 @@ +;;; Dotfiles --- Jakub Dlugosz emacs config +;;; Commentary: + +;;; Code: + +(use-package vterm + :guix-package "emacs-vterm" + :init + (add-to-list 'project-switch-commands '(project-vterm "Vterm") t) + (add-to-list 'project-kill-buffer-conditions + '(major-mode . vterm-mode)) + (setq vterm-copy-exclude-prompt t) + :config + (setq vterm-buffer-name "vterm") + ;; (evil-set-initial-state 'vterm-mode 'emacs) + (setq vterm-tramp-shells + (append '(("ssh" "/bin/bash")) vterm-tramp-shells)) + + ) + +(use-package all-the-icons-dired + :guix-package "emacs-all-the-icons-dired" + :hook (dired-mode . all-the-icons-dired-mode)) + +(use-package dired + :ensure nil + :commands (dired dired-jump) + :custom ((dired-listing-switches "-agho --group-directories-first")) + :config + (setq dired-kill-when-opening-new-dired-buffer t)) + +(use-package pdf-tools + :guix-package + "emacs-pdf-tools") + +(use-package password-store + :guix-package "emacs-password-store" + :bind + ("C-c P p" . password-store-copy) + ("C-c P i" . password-store-insert) + ("C-c P g" . password-store-generate)) + +(use-package shell + :bind + ("C-c C-" . shell)) + +(provide 'jd-apps) + +;;; 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 @@ +;;; Dotfiles --- Jakub Dlugosz emacs config +;;; Commentary: + +;;; Code: + +(setq erc-nick "bobbma" + erc-user-full-name "Jakub Dlugosz" + erc-notify-list '("akuleszaa")) + +(defun hipis-znc () + (interactive) + (erc :server "195.74.91.18" + :port "6697")) + + +;; Repair load paths when tramp try to connect to guix instances +(require 'tramp) + +(connection-local-set-profile-variables + 'guix-system + '((tramp-remote-path . (tramp-own-remote-path)))) + +(connection-local-set-profiles + '(:application tramp :protocol "sudo" :machine "localhost") + 'guix-system) + +(connection-local-set-profiles + '(:application tramp :protocol "ssh" :machine "jdlugosz.com") + 'guix-system) + +(provide 'jd-custom) + +;;; 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 @@ +;;; Dotfiles --- Jakub Dlugosz emacs config +;;; Commentary: + +;;; Code: + +;; (setq c-default-style "linux" +;; c-basic-offset 8 +;; gdb-many-windows t) + +(use-package lsp-mode + :guix-package "emacs-lsp-mode" + :diminish t + :commands (lsp lsp-deferred) + :init + (setq lsp-headerline-breadcrumb-enable nil) + (setq lsp-diagnostics-provider :none) + (setq lsp-modeline-diagnostics-enable nil) + (setq lsp-keymap-prefix "C-c l") + :config + (lsp-enable-which-key-integration t) + + (global-set-key (kbd "C-x ]") + #'(lambda () + (interactive) + (forward-page) + (recenter-top-bottom 0))) + + (global-set-key (kbd "C-x [") + #'(lambda () + (interactive) + (backward-page) + (recenter-top-bottom 0))) + + (define-key c-mode-map + (kbd "C-c C-c") + #'(lambda () + (interactive) + (compile compile-command))) + + (define-key c-mode-map + (kbd "C-c M-c") + 'compile)) + +(use-package lsp-ivy + :guix-package "emacs-lsp-ivy" + :after lsp) + + +(use-package paredit + :guix-package "emacs-paredit") + +(defun jd/lisp-mode-setup () + (rainbow-delimiters-mode) + (paredit-mode)) + +(add-hook 'emacs-startup-hook + (lambda () + (add-hook 'scheme-mode-hook 'jd/lisp-mode-setup) + (add-hook 'emacs-lisp-mode-hook 'jd/lisp-mode-setup) + (add-hook 'clojure-mode-hook 'jd/lisp-mode-setup) + (add-hook 'lisp-mode-hook 'jd/lisp-mode-setup))) + +(use-package rainbow-delimiters + :guix-package "emacs-rainbow-delimiters") + +(use-package sly + :guix-package "emacs-sly") + +(use-package geiser + :guix-package "emacs-geiser") + +(use-package geiser-racket + :guix-package "emacs-geiser-racket") + +(use-package racket-mode + :guix-package "emacs-racket-mode") + +(use-package geiser-guile + :guix-package "emacs-geiser-guile" + :config + (when jd/guix-p + (defun jd/guix-repl () + (interactive) + (let ((geiser-guile-binary '("guix" "repl")) + (geiser-guile-load-path (cons "~/dotfiles/guix" geiser-guile-load-path))) + (geiser 'guile))))) + +(use-package pyvenv + :guix-package "emacs-pyvenv" + :after python-mode) + +(use-package typescript-mode + :guix-package "emacs-typescript-mode" + :mode ("\\.ts\\'") + :config + (setq typescript-indent-level 2)) + +(use-package cider + :guix-package "emacs-cider") + +(use-package tide + :guix-package "emacs-tide" + :after (typescript-mode company web-mode)) + +(use-package flycheck + :guix-package "emacs-flycheck" + :hook ((after-init . global-flycheck-mode))) + +(use-package web-mode + :guix-package "emacs-web-mode" + :mode + ("\\.ejs\\'" "\\.hbs\\'" "\\.html\\'" "\\.php\\'" "\\.[jt]sx?\\'") + :config + (setq web-mode-content-types-alist '(("jsx" . "\\.[jt]sx?\\'"))) + (setq web-mode-markup-indent-offset 2) + (setq web-mode-css-indent-offset 2) + (setq web-mode-code-indent-offset 2) + (setq web-mode-script-padding 2) + (setq web-mode-block-padding 2) + (setq web-mode-style-padding 2) + (setq web-mode-enable-auto-pairing t) + (setq web-mode-enable-auto-closing t) + (setq web-mode-enable-current-element-highlight t)) + +(use-package yaml-mode + :guix-package "emacs-yaml-mode") + +(use-package docker + :guix-package "emacs-docker" + :bind + ("C-c D d" . docker-containers) + ("C-c D D" . docker)) + +(use-package company + :guix-package "emacs-company" + :diminish t + :after lsp-mode + :hook (lsp-mode . company-mode) + :bind (:map company-active-map + ("" . company-complete-selection)) + (:map lsp-mode-map + ("" . company-indent-or-complete-common)) + :custom + (company-minimum-prefix-length 1) + (company-idle-delay 0.0) + :config + (global-company-mode)) + +(use-package projectile + :guix-package "emacs-projectile" + :diminish projectile-mode + :init + (when (file-directory-p "~/Documents/code") + (setq projectile-project-search-path '("~/Documents/code/"))) + :custom ((projectile-Completion-system 'ivy)) + :config + (setq projectile-switch-project-action #'projectile-dired) + (projectile-mode)) + +(use-package magit + :guix-package "emacs-magit" + :custom + (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) + +(use-package restclient + :guix-package "emacs-restclient") + +(setq sql-connection-alist + '(("net47-abaks" + (sql-product 'postgres) + (sql-user "kuba") + (sql-database "net47") + (sql-server "net47.abaks.pl")))) + +(provide 'jd-dev) + +;;; 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 @@ +;;; Dotfiles --- Jakub Dlugosz emacs config +;;; Commentary: + +;;; Code: + + +(use-package perspective + :guix-package "emacs-perspective") + +(use-package exwm + :guix-package "emacs-exwm" + :config + (defun jd/exwm-update-class () + (exwm-workspace-rename-buffer exwm-class-name)) + + (defun jd-exwm/run-in-background (command) + (let ((command-parts (split-string command "[ ]+"))) + (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) + + (defun jd-exwm/restart-process (program-name) + (call-process "killall" nil nil nil program-name) + (jd-exwm/run-in-background program-name)) + + (defun jd-exwm/exwm-init-hook () + (jd-exwm/run-in-background "nitrogen --restore") + (start-process-shell-command "xinput" nil "xinput set-prop 'ETPS/2 Elantech Touchpad' 'Synaptics Tap Action' 1 1 1 2 1") + (start-process-shell-command "syndaemon" nil "syndaemon -i 0.8 -K -R -d") + + (jd-exwm/restart-process "polybar") + (jd-exwm/restart-process "nm-applet") + (jd-exwm/restart-process "redshift-gtk -l 54.37:18.6") + (jd-exwm/restart-process "blueman-applet")) + + (defun jd-exwm/exwm-update-title () + (exwm-workspace-rename-buffer exwm-title)) + + (defun jd-exwm/configure-window-by-class () + (interactive) + (pcase exwm-class-name + ("firefox" (exwm-workspace-move-window 2)) + ("Brave" (exwm-workspace-move-window 2)) + ("qutebrowser" (exwm-workspace-move-window 2)) + ("discord" (exwm-workspace-move-window 5)) + ("obs" (exwm-workspace-move-window 5)) + ("Virt-manager" (exwm-workspace-move-window 4)))) + + (setq exwm-workspace-number 10) + + ;; (add-hook 'exwm-init-hook #'jd-exwm/exwm-init-hook) + (add-hook 'exwm-update-class-hook #'jd/exwm-update-class) + (add-hook 'exwm-update-title-hook #'jd-exwm/exwm-update-title) + (add-hook 'exwm-manage-finish-hook #'jd-exwm/configure-window-by-class) + + (require 'exwm-randr) + (setq exwm-randr-workspace-monitor-plist '(9 "eDP-1" 0 "eDP-1")) + (exwm-randr-enable) + + (setq exwm-input-simulation-keys + '(([?\C-b] . [left]) + ([?\C-f] . [right]) + ([?\C-p] . [up]) + ([?\C-n] . [down]) + ([?\C-a] . [home]) + ([?\C-e] . [end]) + ([?\C-k] . [S-end delete]) + ([?\M-w] . [C-c]) + ([?\C-y] . [C-v]) + ([?\C-v] . [next]) + ([?\M-v] . [prior]) + )) + + (setq exwm-input-prefix-keys + '(?\C-x + ?\C-u + ?\C-h + ?\M-x + ?\M-` + ?\M-& + ?\M-! + ?\C-g + ?\M-: + ?\C-\M-j + ?\C-\ )) + + (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) + (exwm-input-set-key (kbd "s-p") 'counsel-linux-app) + + (setq exwm-input-global-keys + `(([?\s-R] . exwm-reset) + + + ([?\s-r] . (lambda (command) + (interactive (list (read-shell-command "$ "))) + (start-process-shell-command command nil command))) + + ([?\s-W] . exwm-workspace-move-window) + ([?\s-w] . exwm-workspace-switch) + + ,@(mapcar (lambda (i) + `(,(kbd (format "s-%d" i)) . + (lambda () + (interactive) + (exwm-workspace-switch-create ,i)))) + (number-sequence 0 9)))) + + (exwm-enable) + (require 'exwm-systemtray) + (exwm-systemtray-enable)) + +(use-package desktop-environment + :guix-package "emacs-desktop-environment" + :after exwm + :custom + (desktop-environment-brightness-small-increment "2%+") + (desktop-environment-brightness-small-decrement "2%-") + (desktop-environment-brightness-normal-increment "5%+") + (desktop-environment-brightness-normal-decrement "5%-") + + :config + (defun jd/dunst-show-history () + (interactive) + (start-process-shell-command "dunstctl" nil "dunstctl history-pop")) + (global-set-key (kbd "C-c N h") #'jd/dunst-show-history) + + (defun jd/dunst-close () + (interactive) + (start-process-shell-command "dunstctl" nil "dunstctl close")) + (global-set-key (kbd "C-c N c") #'jd/dunst-close) + + (defun jd/dunst-close-all () + (interactive) + (start-process-shell-command "dunstctl" nil "dunstctl close-all")) + (global-set-key (kbd "C-c N a") #'jd/dunst-close-all) + + (desktop-environment-mode)) + +;; (set-frame-parameter (selected-frame) 'alpha '(90 . 90)) +;; (add-to-list 'default-frame-alist `(alpha . (90 . 90))) +;; (set-frame-parameter (selected-frame) 'fullscreen 'maximized) +;; (add-to-list 'default-frame-alist '(fullscreen . maximized)) + +(defun jd-exwm/get-color (ATTRIBUTE) + (face-attribute 'default ATTRIBUTE)) + +(defun theme-to-xresources () + (interactive) + (require 'term) + (with-temp-buffer + (insert "! Generated by theme-to-xresources\n") + (dolist (spec + '(("emacs.background" :background "E6") + ("emacs.foreground" :foreground ""))) + (let ((color (jd-exwm/get-color (cadr spec)))) + (insert (format "%s: #%s%s\n" + (car spec) + (caddr spec) + (string-remove-prefix "#" color)))) + jd + (write-region (point-min) (point-max) "~/.Xresources"))) + (call-process "xrdb" nil nil nil "-merge" (expand-file-name "~/.Xresources"))) + +(defun jd/theme-sync () + (interactive) + (theme-to-xresources) + (setq org-confirm-babel-evaluate nil) + (org-babel-tangle-file "~/dotfiles/Desktop.org") + (setq org-confirm-babel-evaluate 't) + (call-process "killall" nil nil nil "dunst") ;; TODO: prevent clear notification history + (jd-exwm/restart-process "polybar")) + +;; (add-hook 'jd/load-theme-hook #'jd/theme-sync) +;; (add-hook 'exwm-init-hook #'jd/theme-sync) + +(provide 'jd-exwm) + +;;; jd-exwm.el ends here + 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 @@ +;;; jd-gym.el --- Gym workout manager. +;;; Commentary: +;; It will be a gym workout manager in the future. +;;; code: + +(require 'emacsql-sqlite) + +(defconst jd-gym/db--tables-schema + '((workout-plans + [(id integer :primary-key :autoincrement) + (name text)]) + + (workouts + [(id integer :primary-key :autoincrement) + (workout-plan-id integer :not-null) + (day integer :not-null) + (month integer :not-null) + (year integer :not-null)] + (:foreign-key [workout-plan-id] :references workout-plans [id] :on-delete :cascade)) + + (muscle-part + [(id integer :primary-key :autoincrement) + (name text :not-null)]) + + (exercises + [(id integer :primary-key :autoincrement) + (name text :not-null) + (muscle-part-id integer :not-null)] + (:foreign-key [muscle-part-id] :references muscle-part [id] :on-delete :cascade)) + + (workout-plan-exercise-map + [(id integer :primary-key :autoincrement) + (week-day integer :not-null) + (workout-plan-id integer :not-null) + (exercise-id integer :not-null)] + (:foreign-key [workout-plan-id] :references workout-plans [id] :on-delete :cascade) + (:foreign-key [exercise-id] :references exercises [id] :on-delete :cascade)) + + (workout-sets + [(id integer :primary-key :autoincrement) + (reps integer :not-null) + (weight integer :not-null) + (workout-plan-exercise-map-id integer :not-null) + (comment text)] + (:foreign-key [workout-plan-exercise-map-id] :references workout-plan-exercise-map [id] :on-delete :cascade)))) + +(defconst jd-gym/db--test-data + '((workout-plans + ([nil "Push pull"])) + (workouts + ([nil 1 3 1 2023])) + (muscle-part + ([nil "glutes"] + [nil "chest"])) + (exercises + ([nil "Bench press" 2] + [nil "RDL" 1])) + (workout-plan-exercise-map + ([nil 0 1 1] ; Monday, Push pull, Bench press + [nil 1 1 2] ; Tuesday, Push pull, RDL + [nil 3 1 1] ; Thursday, Push pull, Bench press + [nil 4 1 2] ; Friday, Push pull, RDL + )) + (workout-sets + ([nil 7 70 1 "New PR!"] + [nil 8 110 2 "It was hard!"])))) + +(defun jd-gym/db--test-data-insert () + "Insert test data to jd-gym database." + (mapc (lambda (table) + (let ((table-name (car table)) + (table-data (cdr table))) + (emacsql jd-gym/db--conn [:insert :into $i1 + :values $v2] + table-name table-data))) + jd-gym/db--test-data)) + +(defvar jd-gym/db-path "~/Documents/Gym/gym.sqlite" + "Path can be relative or absolute.") + +(defvar jd-gym/db--conn nil + "Store connection to jd-gym database.") + +(defun jd-gym/db--conn-p () + "Check if jd-gym is connected to db." + (and (emacsql-sqlite-connection-p jd-gym/db--conn) + (emacsql-live-p jd-gym/db--conn))) + +(defun jd-gym/db--connect () + "Connect to db if there is no connection yet." + (unless (jd-gym/db--conn-p) + (setq jd-gym/db--conn (emacsql-sqlite jd-gym/db-path)))) + +(defun jd-gym/db--close () + "Close db connection." + (when (jd-gym/db--conn-p) + (emacsql-close jd-gym/db--conn))) + +(defun jd-gym/db--init () + "Initialize database structure." + (when (jd-gym/db--conn-p) + (emacsql jd-gym/db--conn [:pragma (= foreign_keys ON)]) + (emacsql jd-gym/db--conn "PRAGMA foreign_keys=ON") + (mapc (lambda (table) + (let ((table-name (car table)) + (table-schema (cdr table))) + (emacsql jd-gym/db--conn [:create-table $i1 $S2] table-name table-schema))) + jd-gym/db--tables-schema))) + +(defun jd-gym/db () + "Entrypoint to jd-gym db." + (unless (file-exists-p jd-gym/db-path) + (jd-gym/db--close) + (jd-gym/db--connect) ; Restart connection + (jd-gym/db--init))) + + +(provide 'jd-gym) + +;;; 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 @@ +;;; Dotfiles --- Jakub Dlugosz emacs config +;;; Commentary: +;; Custom keysets used in my emacs +;;; Code: + +(use-package multiple-cursors + :guix-package "emacs-multiple-cursors" + :config + (global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) + (global-set-key (kbd "C->") 'mc/mark-next-like-this) + (global-set-key (kbd "C-<") 'mc/mark-previous-like-this) + (global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)) + +(use-package hydra + :guix-package "emacs-hydra" + ;; :defer t + :config + (defun jd/text-scale-increase () + (interactive) + (let ((old-face-attribute (face-attribute 'default :height))) + (set-face-attribute 'default nil :height (+ old-face-attribute 10)))) + + (defun jd/text-scale-decrease () + (interactive) + (let ((old-face-attribute (face-attribute 'default :height))) + (set-face-attribute 'default nil :height (- old-face-attribute 10)))) + + (defhydra hydra-text-scale-global (:timeout 4) + "scale text" + ("j" jd/text-scale-increase "in") + ("k" jd/text-scale-decrease "out") + ("q" nil "finished" :exit t)) ;; TODO not working + + (defhydra hydra-text-scale (:timeout 4) + "scale text" + ("j" text-scale-increase "in") + ("k" text-scale-decrease "out") + ("q" nil "finished" :exit t))) + +(use-package undo-tree + :guix-package "emacs-undo-tree" + :diminish + :config + (setq undo-tree-auto-save-history nil) + (global-undo-tree-mode 1)) + +(provide 'jd-keys) + +;;; 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 @@ +;;; Dotfiles --- Jakub Dlugosz emacs config +;;; Commentary: + +;;; Code: + +(defun jd/generete-qr-from-clipboard () + (interactive) + (let ((clipboard-value (x-get-clipboard)) + (clipboard-file-path "/tmp/clipboard_value.txt") + (clipboard-out-image "/tmp/qr.png")) + (with-temp-file clipboard-file-path + (insert clipboard-value)) + (shell-command (concat + "qrencode -o " + clipboard-out-image + " < " + clipboard-file-path)) + (find-file clipboard-out-image))) + +(defun jd/dired-open-file-in-kill-ring () + (interactive) + (let* ((last-killed (car kill-ring)) + (exists-p (file-exists-p last-killed)) + (dir-p (file-directory-p last-killed))) + (cond + ((not exists-p) (message "File doesn't exists!")) + (dir-p (dired last-killed)) + ((not dir-p) (find-file last-killed))))) + +(global-set-key (kbd "C-c O") #'jd/dired-open-file-in-kill-ring) + +(provide 'jd-misc) + +;;; 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 @@ +;;; Dotfiles --- Jakub Dlugosz emacs config +;;; Commentary: + +;;; Code: + +(use-package htmlize + :guix-package "emacs-htmlize") + +(use-package mu4e + :guix-package ("mu" "isync") + :defer 10 + :ensure nil + :bind + ("C-c M" . mu4e) + :config + ;a (require 'org-mu4e) + + (unless jd/guix-p + (add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e") + (setq mu4e-mu-binary "/usr/local/bin/mu")) + + (setq mu4e-update-interval (* 10 60)) + (setq mu4e-get-mail-command "mbsync -a") + (setq mu4e-maildir "~/Mail") + + (setq mu4e-completing-read-function #'ivy-completing-read) + + (setq mu4e-change-filenames-when-moving t) + + (setq mu4e-contexts + `(,(make-mu4e-context + :name "Abaks" + :match-func (lambda (msg) (when msg + (string-prefix-p "/abaks" (mu4e-message-field msg :maildir)))) + :vars '( + (user-full-name . "Jakub Dlugosz") + (user-mail-address . "jakub@abaks.pl") + (mu4e-sent-folder . "/abaks/Sent Items") + (mu4e-trash-folder . "/abaks/Trash") + (mu4e-drafts-folder . "/abaks/Drafts") + (mu4e-refile-folder . "/abaks/Archive") + (mu4e-sent-messages-behavior . sent) + (smtpmail-local-domain . "pl") + (smtpmail-smtp-server . "smtp.abaks.pl") + (smtpmail-smtp-user . "jakub@abaks.pl"))) + ,(make-mu4e-context + :name "Gmail" + :match-func (lambda (msg) (when msg + (string-prefix-p "/gmail" (mu4e-message-field msg :maildir)))) + :vars '( + (user-full-name . "Jakub Dlugosz") + (user-mail-address . "jdlugosz963@gmail.com") + (mu4e-sent-folder . "/gmail/\[Gmail\]/Wys\&AUI-ane") + (mu4e-trash-folder . "/gmail/\[Gmail\]/Kosz") + (mu4e-drafts-folder . "/gmail/\[Gmail\]/Wersje\ robocze") + (mu4e-refile-folder . "/gmail/Archive") + (smtpmail-local-domain . "com") + (smtpmail-smtp-server . "smtp.gmail.com") + (smtpmail-smtp-user . "jdlugosz963@gmail.com") + (mu4e-sent-messages-behavior . sent))))) + + (setq mail-user-agent 'mu4e-user-agent + mail-host-address nil + message-send-mail-function 'smtpmail-send-it + smtpmail-smtp-service 465 + smtpmail-stream-type 'ssl + smtpmail-servers-requiring-authorization ".*") + + (setq mu4e-compose-signature (concat + "Pozdrawiam,\n" + "Jakub Długosz")) + + (mu4e t) + (mu4e-modeline-mode nil)) + +(use-package mu4e-alert + :guix-package "emacs-mu4e-alert" + :defer 20 + :config + (mu4e-alert-set-default-style 'libnotify) + (mu4e-alert-enable-mode-line-display) + (mu4e-alert-enable-notifications)) + +(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 @@ +;;; Dotfiles --- Jakub Dlugosz emacs config +;;; Commentary: + +;;; Code: + +(defvar jd/org-home "~/Notes") +(defvar jd/org-roam-home (concat jd/org-home "/roam")) +(defvar jd/org-sync (concat jd/org-home "/sync")) +(defvar jd/org-roam-daily-home (concat jd/org-roam-home "/daily")) + +(defun jd/org-mode-init () + (org-indent-mode) + (variable-pitch-mode 1) + (visual-line-mode 1)) + +(defun jd-emacs/org-insert-date (&optional date) + (org-insert-time-stamp (org-read-date nil t (or date "+0d")))) + +(use-package org-pomodoro + :guix-package "emacs-org-pomodoro") + +(use-package org-caldav + :guix-package "emacs-org-caldav" + :config + (setq org-caldav-url "http://caldav.jdlugosz.com/radicale/admin/" + org-caldav-files nil + org-icalendar-timezone "Europe/Warsaw") + + (defun jd/caldav-calendar-sync () + (interactive) + (let ((org-caldav-calendar-id "0c54a523-c7aa-2f26-2c18-a12b69c2bc86") + (org-caldav-inbox (concat jd/org-sync + "/calendar.org"))) + (org-caldav-sync))) + + (defun jd/caldav-journal-sync () + (interactive) + (let ((org-caldav-calendar-id "3cc70419-a787-5f84-28c6-96f15fc606d9") + (org-caldav-inbox (concat jd/org-sync + "/journal.org"))) + (org-caldav-sync))) + + (defun jd/caldav-tasks-sync () + (interactive) + (let ((org-caldav-calendar-id "372cbbb3-14f7-fc15-9f7b-cae04114920c") + (org-caldav-inbox (concat jd/org-sync + "/tasks.org"))) + (org-caldav-sync)))) + +(use-package org + :guix-package "emacs-org" + :pin org + :commands (org-capture org-agenda) + :hook (org-mode . jd/org-mode-init) + :bind + ("C-c o c" . #'org-capture) + ("C-c o p" . #'org-mobile-pull) + ("C-c o P" . #'org-mobile-push) + ("C-c o a" . #'org-agenda) + :config + (defun jd/org-mode-file (file-name) (concat org-directory "/" file-name ".org")) + (setq org-directory (file-truename "~/Notes") + org-mobile-directory (concat org-directory "/Mobile") + org-mobile-inbox-for-pull (concat org-directory "/flagged.org") ;; TODO: ?? + + org-refile-targets '((org-agenda-files :maxlevel . 1)) + org-outline-path-complete-in-steps nil + org-refile-use-outline-path t + org-agenda-files '("Personal.org" "Work.org" "Inbox.org") + org-ellipsis " ▾" + org-agenda-start-with-log-mode t + org-log-done 'time + org-log-into-drawer t + org-return-follows-link t + org-latex-listings 'minted + org-latex-packages-alist '(("" "minted")) + + org-agenda-custom-commands + `(("p" "Planning" + ((tags-todo "+planning" + ((org-agenda-overriding-header "Planning Tasks"))) + (tags-todo "-{.*}" + ((org-agenda-overriding-header "Untagged Tasks"))) + (todo "*" ((org-agenda-files '(,(jd/org-mode-file "Inbox"))) + (org-agenda-overriding-header "Unprocessed Inbox Items"))))) + + ("d" "Daily Agenda" + ((agenda "" ((org-agenda-span 'day) + (org-deadline-warning-days 7))) + (tags-todo "+PRIORITY=\"A\"" + ((org-agenda-overriding-header "High Priority Tasks"))))) + + ("w" "Weekly Review" + ((agenda "" + ((org-agenda-overriding-header "Completed Tasks") + (org-agenda-skip-function '(org-agenda-skip-entry-if 'nottodo 'done)) + (org-agenda-span 'week))) + + (agenda "" + ((org-agenda-overriding-header "Unfinished Scheduled Tasks") + (org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) + (org-agenda-span 'week)))))) + + org-capture-templates + `(("i" "Capture to Inbox" entry (file+olp ,(jd/org-mode-file "Inbox") "Inbox") + "* TODO %?\n %t\n" :empty-lines 1)) + + org-latex-pdf-process + '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" + "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) + + (require 'org-tempo) + + (defun jd/org-font-setup () + ;; Replace list hyphen with dot + ;; (font-lock-add-keywords 'org-mode + ;; '(("^ *\\([.]\\) " + ;; (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•-")))))) + + ;; Set faces for heading levels + (dolist (face '((org-level-1 . 1.3) + (org-level-2 . 1.2) + (org-level-3 . 1.1) + (org-level-4 . 1.0) + (org-level-5 . 1.0) + (org-level-6 . 1.0) + (org-level-7 . 1.0) + (org-level-8 . 1.0))) + (set-face-attribute (car face) nil :font "Terminus" :weight 'Bold :height (cdr face))) + + ;; Ensure that anything that should be fixed-pitch in Org files appears that way + (set-face-attribute 'org-block nil :font "Terminus" :inherit 'fixed-pitch :height 100) + (set-face-attribute 'org-table nil :inherit 'fixed-pitch) + (set-face-attribute 'org-formula nil :inherit 'fixed-pitch) + (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) + (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch)) + (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch)) + (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch)) + (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch) + (set-face-attribute 'line-number nil :inherit 'fixed-pitch) + (set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch)) + + (with-eval-after-load 'org (jd/org-font-setup)) + + (defun jd-emacs/org-timer-stop () + (start-process-shell-command "notify-send" nil "notify-send Zakonczono odliczanie")) + + (add-hook 'org-timer-stop-hook #'jd-emacs/org-timer-stop) + + (defun jd/org-tempo-setup () + (dolist (template '(("s" . "src") + ("sql" . "src sql") + ("sh" . "src sh") + ("el" . "src emacs-lisp") + ("li" . "src lisp") + ("sc" . "src scheme") + ("ts" . "src typescript") + ("py" . "src python") + ("go" . "src go") + ("yaml" . "src yaml"))) + (add-to-list 'org-structure-template-alist template))) + + (with-eval-after-load 'org-tempo (jd/org-tempo-setup)) + + (org-babel-do-load-languages + 'org-babel-load-languages + '((emacs-lisp . t) + (python . t) + (shell . t)))) + +(use-package org-superstar + :guix-package "emacs-org-superstar" + :hook (org-mode . org-superstar-mode) + :init + (setq org-superstar-special-todo-items t) + (setq org-superstar-remove-leading-stars t) + (setq org-superstar-headline-bullets-list '("◉" "○" "●" "○" "●" "○" "●"))) + +(use-package org-roam + :guix-package "emacs-org-roam" + :custom + (org-roam-directory (file-truename jd/org-roam-home)) + :bind (("C-c n l" . org-roam-buffer-toggle) + ("C-c n f" . org-roam-node-find) + ("C-c n g" . org-roam-graph) + ("C-c n i" . org-roam-node-insert) + ("C-c n c" . org-roam-capture) + ;; Dailies + ("C-c n j" . org-roam-dailies-capture-today)) + :bind-keymap + ("C-c n d" . org-roam-dailies-map) + :config + (require 'org-roam-dailies) + + (defun jd/org-roam-filter-by-tag (tag-name) + (lambda (node) + (member tag-name (org-roam-node-tags node)))) + + (defun jd/org-roam-list-notes-by-tag (tag-name) + (mapcar #'org-roam-node-file + (seq-filter + (jd/org-roam-filter-by-tag tag-name) + (org-roam-node-list)))) + + (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag))) + (setq org-roam-capture-templates + '(("d" "default" plain "%?" + :target (file+head + "%<%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: `%?` + :unnarrowed t) + ;; ("n" "insert node" plain (file "~/Documents/roam/study/templates/research.org") + ;; :target (file+head "study/%<%Y%m%d%H%M%S>-${slug}.org" + ;; "#+title: ${title}\n") + ;; :unnarrowed t) + )) + + (org-roam-db-autosync-mode)) + +(use-package ox-pandoc + :guix-package "emacs-ox-pandoc") + +(provide 'jd-org) + +;;; 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 @@ +;;; Dotfiles --- Jakub Dlugosz emacs config +;;; Commentary: + +;;; Code: + +(defun use-package-normalize/:diminish (name keyword args) + (use-package-as-one (symbol-name keyword) args + (apply-partially #'use-package-normalize-diminish name) t)) + +(use-package shackle + :guix-package "emacs-shackle") + +(use-package sway + :guix-package "emacs-sway") + +(provide 'jd-sway) + +;;; 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 @@ +;; Dotfiles --- Jakub Dlugosz emacs config +;;; Commentary: + +;;; Code: + +(setq inhibit-startup-message t) +(setq visible-bell t) +(scroll-bar-mode -1) +(tool-bar-mode -1) +(tooltip-mode -1) +(menu-bar-mode -1) +(set-fringe-mode 10) + +;; (set-frame-parameter (selected-frame) 'alpha '(92 . 92)) +;; (add-to-list 'default-frame-alist '(alpha . (92 . 92))) + +(let ((height (if (string-equal (system-name) + "berserker") + 175 + 125))) + (custom-set-faces + `(default ((t (:inherit nil :height ,height :family "Terminus")))) + `(line-number ((t (:inherit nil :height ,height :family "Terminus")))) + `(line-number-current-line ((t (:inherit nil :height ,height :family "Terminus")))))) + +(add-hook 'prog-mode-hook 'menu-bar--display-line-numbers-mode-relative) + +(global-set-key (kbd "") 'keyboard-escape-quit) + +(global-prettify-symbols-mode 1) + +(defalias 'yes-or-no-p 'y-or-n-p) + +(require 'diminish) + +(use-package doom-modeline + :guix-package "emacs-doom-modeline" + :config + (doom-modeline-mode)) + +(use-package solarized-theme + :guix-package "emacs-solarized-theme" + :config + (load-theme 'solarized-dark-high-contrast t)) + + +(use-package diminish + :guix-package "emacs-diminish") + +(use-package hl-todo + :guix-package "emacs-hl-todo" + :init + (setq hl-todo-keyword-faces + '(("TODO" . "#FF0000") + ("FIXME" . "#FF0000") + ("DEBUG" . "#A020F0"))) + :config + (global-hl-todo-mode 1)) + +(defvar jd/load-theme-hook nil) +(defun jd/load-theme () + (interactive) + (counsel-load-theme) + (run-hooks 'jd/load-theme-hook)) + +(use-package ivy + :guix-package "emacs-ivy" + :diminish + :bind + (("C-s" . swiper)) + :config + (ivy-mode 1)) + +(use-package counsel + :guix-package "emacs-counsel" + :diminish t + :config + (counsel-mode 1)) + +(use-package which-key + :guix-package "emacs-which-key" + :diminish + :config + (which-key-mode) + (setq which-key-idle-delay 0.3)) + +(use-package all-the-icons + :guix-package "emacs-all-the-icons") + +(use-package beacon + :guix-package "emacs-beacon" + :config + (beacon-mode 1)) + +(setq display-time-string-forms + '(" " 24-hours ":" minutes " ")) + +(when jd/exwm-p + (display-battery-mode) + (display-time-mode)) + +(provide 'jd-ui) + +;;; 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 @@ +__pycache__/ +elpa/ +auto-save-list/ +eln-cache/ +url/ +**/#* +**/*~ diff --git a/files/.guile b/files/.guile new file mode 100644 index 0000000..2076bd2 --- /dev/null +++ b/files/.guile @@ -0,0 +1,2 @@ + (use-modules (ice-9 readline)) + (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 @@ +IMAPStore abaks-remote +Host imap.abaks.pl +Port 143 +SSLType None +AuthMechs LOGIN +User jakub@abaks.pl +PassCmd "pass email/jakub@abaks.pl" +CertificateFile /etc/ssl/certs/ca-certificates.crt + +MaildirStore abaks-local +Path ~/Mail/abaks/ +Inbox ~/Mail/abaks/INBOX +Subfolders Verbatim + +Channel abaks +Far :abaks-remote: +Near :abaks-local: +Patterns INBOX * !Sync* +Expunge None +CopyArrivalDate yes +Sync All +Create Near +SyncState * + +IMAPStore gmail-remote +Host imap.gmail.com +Port 993 +SSLType IMAPS +AuthMechs LOGIN +User jdlugosz963@gmail.com +PassCmd "pass email/jdlugosz963@gmail.com" +CertificateFile /etc/ssl/certs/ca-certificates.crt + +MaildirStore gmail-local +Path ~/Mail/gmail/ +Inbox ~/Mail/gmail/INBOX +Subfolders Verbatim + +Channel gmail +Far :gmail-remote: +Near :gmail-local: +Patterns INBOX * !Sync* +Expunge None +CopyArrivalDate yes +Sync All +Create Near +SyncState * 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 @@ +(in-package :stumpwm) + + +(setq *message-window-gravity* :center) +(setq *message-window-input-gravity* :center) +(setq *input-window-gravity* :center) +(setq *window-border-style* :none) + +(set-bg-color :gray10) +(setq *mode-line-background-color* "Gray10") + +(set-prefix-key (kbd "C-z")) +(setq *float-window-modifier* :super) + +(define-key *top-map* (kbd "s-w") "gselect") + +(defcommand lock () () + (run-shell-command "slock")) + +(define-key *top-map* (kbd "s-l") "lock") + +(defcommand server-start () () + (slynk:create-server :port 4005) + (message "server started at port: \"4005\"!")) + + +(define-key *root-map* (kbd "C-q") "send-raw-key") + +(define-key *root-map* (kbd "M") "mode-line") +(define-key *root-map* (kbd "C-n") "fnext") +(define-key *root-map* (kbd "C-p") "fprev") +(define-key *root-map* (kbd "b") "windowlist") + + + +;; (run-commands "gnew Code" +;; "gnew Web" +;; "gnew Music" +;; "gnew Game" +;; "gnew School") + +(define-remapped-keys + '(("(Firefox|Chrome|qutebrowser)" + ("C-n" . "Down") + ("C-p" . "Up") + ("C-f" . "Right") + ("C-b" . "Left") + ("C-v" . "Next") + ("M-v" . "Prior") + ("M-w" . "C-c") + ("C-w" . "C-x") + ("C-y" . "C-v") + ("M-<" . "Home") + ("M->" . "End") + ("C-a" . "Home") + ("C-e" . "End") + ("C-M-b" . "M-Left") + ("C-M-f" . "M-Right") + ("C-g" . "ESC") + ("C-k" . ("C-S-End" "C-x"))))) + +(define-frame-preference "chat" + (0 NIL T :create T :class "quassel") + (1 NIL T :create T :class "discord") + (2 NIL T :create T :class "nheko")) + +(define-frame-preference "vm" + (0 NIL T :create T :class ".virt-manager-real")) + +(run-shell-command "~/.fehbg") + +(require :pamixer) +(require :pass) + +(require :screenshot) +(pamixer:volume-down 10) + +(defun get-brightness () + (let ((c (parse-integer (string-trim + (string #\newline) + (run-shell-command "brightnessctl g" t)))) + (m (parse-integer (string-trim + (string #\newline) + (run-shell-command "brightnessctl m" t))))) + (format nil "~3,1f%" (* (/ c m) 100)))) + +(defun set-brightness (x) + (run-shell-command (concat "brightnessctl s " x)) + (message (concat "Brightness: " (get-brightness)))) + +(defcommand my-volume-down () () + (pamixer:volume-down 5) + (message (format nil "Volume: ~s%" (pamixer:get-volume)))) + +(defcommand my-volume-up () () + (pamixer:volume-up 5) + (message (format nil "Volume: ~s%" (pamixer:get-volume)))) + +(defcommand my-toggle-mute () () + (pamixer:toggle-mute) + (if (pamixer:get-mute) + (message "Mute: ^2ON") + (message "Mute: ^1OFF"))) + +(defcommand my-brightness-up () () + (set-brightness "+5%")) + +(defcommand my-brightness-down () () + (set-brightness "5%-")) + +(defcommand my-brightness-one () () + (set-brightness "1")) + + +(define-key *top-map* (kbd "XF86AudioMute") "my-toggle-mute") +(define-key *top-map* (kbd "XF86AudioRaiseVolume") "my-volume-up") +(define-key *top-map* (kbd "XF86AudioLowerVolume") "my-volume-down") + +(define-key *top-map* (kbd "XF86MonBrightnessUp") "my-brightness-up") +(define-key *top-map* (kbd "XF86MonBrightnessDown") "my-brightness-down") + +(defun my-screenshoot-command-wrapper (screenshot-command ss-name) + (apply screenshot-command (list (concat + "~/Pictures/Screenshots/" + (string-trim + (string #\newline) + (run-shell-command "date +%Y-%M-%d-%T" t)) + "-" (or ss-name "untitled") + ".png")))) + + +(defcommand my-screenshot-area (ss-name) + ((:string "Screenshot name: ")) + (my-screenshoot-command-wrapper #'screenshot:screenshot-area ss-name)) + +(defcommand my-screenshot-window (ss-name) + ((:string "Screenshot name: ")) + (my-screenshoot-command-wrapper #'screenshot:screenshot-window ss-name)) + +(defcommand my-screenshot (ss-name) + ((:string "Screenshot name: ")) + (my-screenshoot-command-wrapper #'screenshot:screenshot ss-name)) + +(defvar *misc-keymap* + (let ((m (make-sparse-keymap))) + (define-key m (kbd "0") "my-toggle-mute") + (define-key m (kbd "+") "my-volume-up") + (define-key m (kbd "=") "my-volume-up") + (define-key m (kbd "-") "my-volume-down") + + (define-key m (kbd "p") "pass-copy-menu") + (define-key m (kbd "C-p") "pass-copy-menu") + (define-key m (kbd "g") "pass-generate") + (define-key m (kbd "C-g") "pass-generate") + + (define-key m (kbd "C-a") "my-screenshot-area") + (define-key m (kbd "a") "my-screenshot-area") + (define-key m (kbd "C-w") "my-screenshot-window") + (define-key m (kbd "w") "my-screenshot-window") + (define-key m (kbd "C-s") "my-screenshot") + (define-key m (kbd "s") "my-screenshot") + + m)) + + + + +(define-key *root-map* (kbd "C-m") '*misc-keymap*) + +;; +;; ;;; MODE-LINE +(require :cpu) +(require :mem) +(require :net) + +(require :stumptray) +(stumptray:add-mode-line-hooks) + +(defun update-stumptray-position (&rest args) + (setf (symbol-value (find-symbol "*TRAY-HEAD-SELECTION-FN*" :stumptray)) + (if (>= (list-length (stumpwm:screen-heads (stumpwm:current-screen))) 2) + #'second + #'first))) + +(stumpwm:add-hook stumpwm:*new-head-hook* 'update-stumptray-position) +(update-stumptray-position) + +(defun get-battery-status () + (let* ((state (string-trim + (string #\newline) + (run-shell-command + (concat "upower -i /org/freedesktop/UPower/devices/battery_BAT0 " + "| grep state: " + "| awk '{print $2}'") + t))) + (perc (string-trim + (string #\newline) + (run-shell-command (concat + "upower -i /org/freedesktop/UPower/devices/battery_BAT0 " + "| grep perc " + "| awk '{print $2}'") + t))) + (perc-num (parse-integer (aref (nth-value 1 (cl-ppcre:scan-to-strings "^(.*)\%$" perc)) 0)))) + (format + nil + (concat + "BAT: " + (cond + ((and (equal state "discharging") + (<= perc-num 20)) + "^1[-~a]^]") + ((equal state "discharging") "[-~a]") + ((equal state "charging") "[+~a]") + ((equal state "fully-charged") "[~a]") + (t (concat state " [~a]")))) + perc))) + + + +(setq *screen-mode-line-format* (list "[^B%n^b] %W ^> %C | %M | %l | " + '(:eval (get-battery-status)) + " " ;; empty space for stumptray icons + )) + +(require :yason) ;; json parser +(require :drakma) ;; http client + + +(defcommand kto-hakuje-p () () + (let* ((response (yason:parse + (flexi-streams:octets-to-string + (drakma:http-request "https://whois.at.hsp.sh/api/now")))) + (users (gethash "users" response)) + (unknown-devices (gethash "unknown_devices" response))) + (message (cond + ((and (= (list-length users) 0) + (= unknown-devices 0)) + "Spejs jest pusty!") + ((and (= (list-length users) 0) + (> unknown-devices 0)) + (format nil "W spejsie jest nieznanych ~a urzadzen." unknown-devices)) + ((and (> (list-length users) 0) + (= unknown-devices 0)) + (format nil "W spejsie jest ~a." users)) + ((and (> (list-length users) 0) + (> unknown-devices 0)) + (format nil "W spejsie jest ~a oraz ~a nieznane urzadzenia." users unknown-devices)))))) + + +(define-key *misc-keymap* (kbd "h") "kto-hakuje-p") +(define-key *misc-keymap* (kbd "C-h") "kto-hakuje-p") + + +(defun emacs-server-p () + (let ((status-code (caddr + (multiple-value-list + (uiop:run-program "ls /run/user/$(id -u)/emacs/server" + :ignore-error-status T))))) + (= status-code 0))) + +(stumpwm:defcommand emacs-start-server (&optional (show-message T) (wait-for-start NIL)) () + (let ((mess (if (not (emacs-server-p)) + (progn (stumpwm:run-shell-command "emacs --daemon" wait-for-start) + "Emacs server is starting....") + "Emacs server is running already!"))) + (when show-message (message mess)))) + +(stumpwm:defcommand emacs-stop-server (&optional (show-message T)) () + (let ((mess (if (emacs-server-p) + (progn (stumpwm:run-shell-command "emacsclient -e \"(server-force-delete)\"") + "Emacs server gone away :(....") + "Emacs server wasn't alive!"))) + (when show-message (message mess)))) + + +(stumpwm:defcommand emacs-restart-server (&optional (show-message T)) () + (emacs-stop-server NIL) + (emacs-start-server show-message)) + +(defun postwalk (fun tree) + (if (consp tree) + (loop :for a :in tree + :if (consp a) + :collect (postwalk fun a) + :else + :collect (funcall fun a)) + (funcall fun tree))) + +(defmacro eval-emacs-sexp (sexp + &key (create-new-frame NIL)) + `(stumpwm:run-shell-command + (format nil "emacsclient~{ ~A~} '~A'" + (list ,(if create-new-frame "-c" "") + "-e") + (postwalk (lambda (x) + (cond + ((stringp x) (concat "\"" x "\"")) + ((symbolp x) (string-downcase (string x))) + (T x))) + ,sexp)) + ,(not create-new-frame))) + + +(defmacro defcommand-from-emacs (name + (&rest args) + (&rest interactive-args) + (&key (create-new-frame T) (output-wrapper NIL)) + &body body) + `(stumpwm:defcommand ,name ,args ,interactive-args + (when (not (emacs-server-p)) + (emacs-start-server NIL T)) + + ,(let ((x `(eval-emacs-sexp (progn ,@body) + :create-new-frame ,create-new-frame))) + (cond + ((and create-new-frame output-wrapper) + (error "Cannot wrap the output, becaouse create-new-frame is T.")) + (output-wrapper `(funcall ,output-wrapper ,x)) + (T `(funcall (lambda (x) (progn x nil)) ,x)))))) + + +(defcommand-from-emacs emacs-client () () () + nil) + +(defcommand-from-emacs emacs-calc () () () + '(full-calc)) + +(defcommand-from-emacs emacs-org-agenda () () () + '(org-agenda-list)) + +(defcommand-from-emacs emacs-mu4e () () () + '(mu4e)) + +(defcommand-from-emacs emacs-shell () () () + '(shell)) + +(defcommand-from-emacs emacs-eshell () () () + '(eshell)) + +(defvar *emacs-keymap* + (let ((e (make-sparse-keymap))) + (define-key e (kbd "a") "emacs-org-agenda") + (define-key e (kbd "C-a") "emacs-org-agenda") + (define-key e (kbd "c") "emacs-calc") + (define-key e (kbd "C-c") "emacs-calc") + (define-key e (kbd "m") "emacs-mu4e") + (define-key e (kbd "C-m") "emacs-mu4e") + + e)) + + + + +(define-key *root-map* (kbd "C-e") '*emacs-keymap*) +(define-key *root-map* (kbd "e") "emacs-client") +(define-key *root-map* (kbd "c") "emacs-shell") +(define-key *root-map* (kbd "C") "emacs-eshell") + + +(emacs-start-server nil) diff --git a/guix/jd/desktops/base.scm b/guix/jd/desktops/base.scm index c613c26..079d57e 100644 --- a/guix/jd/desktops/base.scm +++ b/guix/jd/desktops/base.scm @@ -18,7 +18,7 @@ #:use-module (nongnu system linux-initrd)) (use-package-modules wm gnome networking virtualization - lisp lisp-xyz cups fonts gnupg) + lisp lisp-xyz cups fonts gnupg android) (use-service-modules cups desktop networking ssh xorg docker virtualization pm sound dbus @@ -68,6 +68,7 @@ "audio" ;; control audio devices "video" ;; access to webcam "dialout" ;; access to /dev/ttyUSBX devices + "adbusers" )))) (define-public %jd-base-user-accounts @@ -147,7 +148,7 @@ (map (lambda (tty) (cons tty (file-append font-terminus - "/share/consolefonts/ter-112n"))) + "/share/consolefonts/ter-122n.psf.gz"))) '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6"))) (service screen-locker-service-type @@ -167,6 +168,7 @@ (bluetooth-configuration (auto-enable? #t))) + (service containerd-service-type) (service docker-service-type) (service libvirt-service-type (libvirt-configuration @@ -188,29 +190,38 @@ (service nix-service-type) polkit-network-manager-service + + (udev-rules-service 'android android-udev-rules + #:groups '("adbusers")) + + (udev-rules-service 'microbit (udev-rule + "69-microbit.rules" + (string-append "ACTION!=\"add|change\", GOTO=\"microbit_rules_end\"" + "SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0d28\", ATTR{idProduct}==\"0204\", TAG+=\"uaccess\"" + "LABEL=\"microbit_rules_end\""))) ;; %desktop-services (modify-services %desktop-services - (guix-service-type config => (guix-configuration - (inherit config) - (substitute-urls - (append (list "https://substitutes.nonguix.org") - %default-substitute-urls)) - (authorized-keys - (append (list (plain-file "non-guix.pub" - "(public-key (ecc (curve Ed25519) (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)))")) - %default-authorized-guix-keys)))) - (delete network-manager-service-type) - ;; (delete mingetty-service-type) - (delete console-font-service-type) - - (delete pulseaudio-service-type) - (delete alsa-service-type) - (delete (if (string-prefix? "x86_64" - (or (%current-target-system) - (%current-system))) - gdm-service-type - sddm-service-type))))) + (guix-service-type config => (guix-configuration + (inherit config) + (substitute-urls + (append (list "https://substitutes.nonguix.org") + %default-substitute-urls)) + (authorized-keys + (append (list (plain-file "non-guix.pub" + "(public-key (ecc (curve Ed25519) (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)))")) + %default-authorized-guix-keys)))) + (delete network-manager-service-type) + ;; (delete mingetty-service-type) + (delete console-font-service-type) + + (delete pulseaudio-service-type) + (delete alsa-service-type) + (delete (if (string-prefix? "x86_64" + (or (%current-target-system) + (%current-system))) + gdm-service-type + sddm-service-type))))) ;; Odin is a base for my operating systems (define-public odin-free diff --git a/guix/jd/desktops/berserker.scm b/guix/jd/desktops/berserker.scm index ed673db..37e7adc 100755 --- a/guix/jd/desktops/berserker.scm +++ b/guix/jd/desktops/berserker.scm @@ -1,5 +1,6 @@ (define-module (jd desktops berserker) #:use-module (jd desktops base) + #:use-module (jd packages linux) #:use-module (gnu) #:use-module (gnu home)) @@ -10,30 +11,35 @@ (define system (operating-system (inherit odin-non-free) + (kernel-loadable-modules (list xmm7360-pci)) (host-name "berserker") - (bootloader (bootloader-configuration + + (bootloader (bootloader-configuration (bootloader grub-efi-bootloader) (targets (list "/boot/efi")))) + (mapped-devices (list (mapped-device + (source (uuid + "1f2b1bf2-89fe-4e2c-8b40-c460572bb776")) + (target "crypthome") + (type luks-device-mapping)))) - (swap-devices (list (swap-space - (target (uuid - "70ee2477-66ff-4856-aebf-8a77053c4462"))))) - - (file-systems (cons* (file-system - (mount-point "/boot/efi") - (device (uuid "BE9B-69F0" - 'fat32)) - (type "vfat")) - - (file-system + (file-systems (cons* (file-system (mount-point "/") (device (uuid - "d8783299-c180-4ca3-9c56-9826797f928d" + "66396ba1-bda9-46bd-ab26-5edc46b437d6" 'ext4)) (type "ext4")) - - %base-file-systems)))) + (file-system + (mount-point "/boot/efi") + (device (uuid "482A-B117" + 'fat32)) + (type "vfat")) + (file-system + (mount-point "/home") + (device "/dev/mapper/crypthome") + (type "ext4") + (dependencies mapped-devices)) %base-file-systems)))) (if (getenv "JD_HOME") home system) diff --git a/guix/jd/home/services/desktop.scm b/guix/jd/home/services/desktop.scm index ec3a53a..32c8059 100644 --- a/guix/jd/home/services/desktop.scm +++ b/guix/jd/home/services/desktop.scm @@ -20,10 +20,11 @@ (define (desktop-profile-service config) (append (list font-terminus-ttf) - (specifications->packages '( ;; sway - "swayfx" + (specifications->packages '("sway" + ;; "swayfx" "swaylock" "swayidle" + "swaynotificationcenter" "waybar" "fuzzel" "foot" @@ -31,6 +32,7 @@ "wl-clipboard" "wlsunset" "grimshot" + "swappy" "udiskie" ;; rest @@ -54,6 +56,8 @@ "blueman" + "nomacs" + "xdg-utils" "xdg-dbus-proxy" "xdg-desktop-portal-gtk" @@ -68,8 +72,8 @@ "dunst" - "gimp" - "inkscape" + ; "gimp" + ; "inkscape" "mpv" "youtube-dl" @@ -107,7 +111,11 @@ "rlwrap" "nheko" - "quassel")))) + "quassel" + "inkscape" + "gimp" + "libreoffice" + "steam")))) (define (desktop-environment-variables-service config) `(("GTK_THEME" . "Adwaita:dark") @@ -126,7 +134,7 @@ ("CLUTTER_BACKEND" . "wayland") ("ELM_ENGINE" . "wayland_egl") ("ECORE_EVAS_ENGINE" . "wayland-egl") - ("QT_QPA_PLATFORM" . "wayland-egl"))) + ("QT_QPA_PLATFORM" . "wayland-egl"))) ;; QT_QPA_PLATFORM=xcb (define (desktop-xdg-mime-applications-service config) (home-xdg-mime-applications-configuration diff --git a/guix/jd/packages/linux.scm b/guix/jd/packages/linux.scm new file mode 100644 index 0000000..94549c3 --- /dev/null +++ b/guix/jd/packages/linux.scm @@ -0,0 +1,51 @@ +(define-module (jd packages linux) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system linux-module) + #:use-module (guix git-download) + #:use-module (guix gexp) + #:use-module (gnu packages linux) + #:use-module (gnu packages pciutils) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages autotools) + #:use-module ((guix licenses) #:prefix license:)) + +(define-public xmm7360-pci + (package + (name "xmm7360-pci") + (version "0.1.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/xmm7360/xmm7360-pci.git") + (commit "a8ff2c6ceee84cbe74df8a78cfaa5a016d362ed4"))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1aals95hk76rgd21rknqc9qfjva6g6gwicw6wz19m20bn08bs2f3")))) + (build-system linux-module-build-system) + (arguments + (list + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-makefile + (lambda _ + (substitute* (find-files + "." "^Makefile(\\.include)?$") + (("^ccflags-y := .*$") + "ccflags-y := -Wno-multichar -Wno-incompatible-pointer-types"))))))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("autoconf" ,autoconf) + ("automake" ,automake))) + (inputs + `(("kernel" ,linux-libre) + ("pciutils" ,pciutils))) + (synopsis "Kernel module for Intel XMM7360 LTE modem") + (description + "This package provides a kernel module for the Intel XMM7360 LTE modem, allowing it to function in Linux.") + (home-page "https://github.com/xmm7360/xmm7360-pci") + (license license:gpl3+))) + -- cgit v1.2.3