Skip to content

Commit

Permalink
Latest config changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanReeve committed May 10, 2024
1 parent c92ed88 commit 511da58
Show file tree
Hide file tree
Showing 10 changed files with 713 additions and 189 deletions.
72 changes: 20 additions & 52 deletions dotfiles/config.nu
Original file line number Diff line number Diff line change
@@ -1,52 +1,7 @@

# https://raw.githubusercontent.com/nushell/nu_scripts/main/background_task/job.nu
# spawn task to run in the background
#
# please note that the it spawned a fresh nushell to execute the given command
# So it doesn't inherit current scope's variables, custom commands, alias definition, except env variables which value can convert to string.
#
# e.g:
# spawn { echo 3 }
export def pspawn [
command: closure # the command to spawn
] {
let config_path = $nu.config-path
let env_path = $nu.env-path
let source_code = (view source $command | str trim -l -c '{' | str trim -r -c '}')
let job_id = (pueue add -p $"nu --config \"($config_path)\" --env-config \"($env_path)\" -c '($source_code)'")
{"job_id": $job_id}
}

export def plog [
id: int # id to fetch log
] {
pueue log $id -f --json
| from json
| transpose -i info
| flatten --all
| flatten --all
| flatten status
}
use ~/Dotfiles/scripts/nu_scripts/modules/background_task/task.nu

# get job running status
export def pstatus () {
pueue status --json
| from json
| get tasks
| transpose -i status
| flatten
| flatten status
}

# kill specific job
export def pkill (id: int) {
pueue kill $id
}

# clean job log
export def pclean () {
pueue clean
}
# Wallpaper management
def wal-fav [] {
open ~/.cache/wal/colors.json | get wallpaper |
Expand All @@ -55,14 +10,27 @@ def wal-fav [] {
}

def wal-fav-set [] {
let w = (open ~/.cache/wal/favs | lines | uniq | shuffle | first)
echo $"Using ($w)"
# pkill swaybg
spawn { swaybg -o 'DP-6' -i $w -m fill }
task spawn -i -l swaybg {
^pkill swaybg
task kill
let w = (open ~/.cache/wal/favs | lines | uniq | shuffle | first)
echo $"Using ($w)"
swaybg -i $w -m fill
}
}

def wal-recent [] {wal -i (ls /run/media/jon/systemrestore/.systemrestore/Bildoj | sort-by modified -r | first 50 | shuffle | first | get name)}
def wal-backup [] {sudo rsync -a /home/systemrestore/Bildoj /run/media/jon/systemrestore/.systemrestore}
def wal-recent [] {
wal -i (ls /run/media/jon/systemrestore/.systemrestore/Bildoj
| sort-by modified -r
| first 50
| shuffle
| first
| get name)
}

def wal-backup [] {
sudo rsync -a /home/systemrestore/Bildoj /run/media/jon/systemrestore/.systemrestore
}

# Project managemnt
def proj [project] {
Expand Down
65 changes: 44 additions & 21 deletions dotfiles/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
networking = {
hostName = "jon-laptop"; # Define your hostname .
networkmanager.enable = true;
firewall.checkReversePath = "loose";
useDHCP = false;
# interfaces.wlp0s20f3.useDHCP = true;
interfaces.enp0s13f0u1u3u1.useDHCP = true;
Expand Down Expand Up @@ -108,30 +109,32 @@
# yubikey-manager # Provides ykman
# yubikey-personalization-gui

megasync # Backups
megacmd
#megasync # Backups
#megacmd
keybase-gui # Also backups
#logseq # Fancy notes

# CLI
fish # Shell
vim # Text editors
vale # Prose linting
aspell aspellDicts.en # Spell checker
# aspell aspellDicts.en # Spell checker
(aspellWithDicts (dicts: with dicts; [ en en-computers en-science eo fr ]))
pass encfs # Passwords and encryption
light # Brightness control
networkmanager
tailscale
gcc gnumake
gnupg
wget
isync w3m # Mail
isync w3m # Mail
protonmail-bridge
gnutls # For mail auth
protonvpn-cli # VPN
pandoc
zlib # For Pandoc development

#direnv # Essential project management thingy
#direnv # Essential project management thingy
graphviz # Simple charts
xclip # Clipboard on the command line
x11idle
Expand Down Expand Up @@ -181,7 +184,7 @@
texlive.combined.scheme-full
git # Version control
github-cli
unzip # Archives
zip unzip # Archives

texlive.combined.scheme-full
git git-lfs # Version control
Expand Down Expand Up @@ -221,7 +224,8 @@
# GUI
#qutebrowser # Web browser
chromium # Another web browser
firefox-wayland # Yes, a third
firefox-wayland # Yes, a third
nyxt # Why stop now?

# Ugh
zoom-us
Expand Down Expand Up @@ -256,6 +260,17 @@
# Web dev
nodejs

# Notetaking
anytype

# Editor
vscode

# Write books
quarto
#jupyter-book


];

environment.variables = {
Expand Down Expand Up @@ -296,6 +311,14 @@

# localtime.enable = true;

libinput = {
enable = true;
touchpad = {
clickMethod = "clickfinger";
disableWhileTyping = true;
};
};

# Power button invokes suspend, not shutdown.
logind = {
extraConfig = "HandlePowerKey=suspend";
Expand All @@ -306,30 +329,30 @@
upower.enable = true;

# Plex media server
# plex = {
# user = "systemrestore";
# group = "users";
# enable = true;
# openFirewall = true;
# };
plex = {
user = "systemrestore";
group = "users";
enable = false;
openFirewall = true;
};

# VPN
tailscale.enable = true;

# Security
udev.packages = [ pkgs.yubikey-personalization pkgs.libu2f-host ];
pcscd.enable = true;
mozillavpn = {
enable = true;
};

# X
xserver = {
enable = true;
# Enable touchpad support.
libinput = {
enable = true;
touchpad = {
clickMethod = "clickfinger";
disableWhileTyping = true;
};
};
# Keyboard settings
layout = "us";
xkbVariant = "colemak";
xkb.variant = "colemak";
desktopManager.session = [
{ name = "home-manager";
start = ''${pkgs.stdenv.shell} $HOME/.xsession-hm
Expand Down
19 changes: 14 additions & 5 deletions dotfiles/emacs/doom.d/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@
(preview . "${author editor} (${year issued date}) ${title}, ${journal journaltitle publisher container-title collection-title}.\n")
(note . "#+title: ${author editor}, ${title}")))

(setq citar-symbols
`((file ,(all-the-icons-faicon "file-o" :face 'all-the-icons-green :v-adjust -0.1) . " ")
(note ,(all-the-icons-material "speaker_notes" :face 'all-the-icons-blue :v-adjust -0.3) . " ")
(link ,(all-the-icons-octicon "link" :face 'all-the-icons-orange :v-adjust 0.01) . " ")))
(setq citar-symbol-separator " ")
;; (setq citar-symbols
;; `((file ,(all-the-icons-faicon "file-o" :face 'all-the-icons-green :v-adjust -0.1) . " ")
;; (note ,(all-the-icons-material "speaker_notes" :face 'all-the-icons-blue :v-adjust -0.3) . " ")
;; (link ,(all-the-icons-octicon "link" :face 'all-the-icons-orange :v-adjust 0.01) . " ")))
;; (setq citar-symbol-separator " ")

(setq citar-file-open-note-function 'orb-citar-edit-note)
;; (setq citar-file-open-note-function 'citar-file-open-notes-default-org)
Expand Down Expand Up @@ -401,6 +401,15 @@ If nil it defaults to `split-string-default-separators', normally
"Set the scheduled date on an Org agenda item to tomorrow."
(interactive)
(org-agenda-schedule nil "+1d"))

(setq org-attach-store-link-p 'attached)

(add-to-list 'org-latex-classes
'("letter"
"\\documentclass{letter}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
) ;; End of Org block

;; (use-package! org-clock-reminder
Expand Down
2 changes: 1 addition & 1 deletion dotfiles/emacs/doom.d/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
word-wrap ; soft wrapping with language-aware indent

:emacs
(dired +ranger +icons) ; making dired pretty [functional]
(dired +icons) ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
ibuffer ; interactive buffer management
vc ; version-control and Emacs, sitting in a tree
Expand Down
2 changes: 2 additions & 0 deletions dotfiles/emacs/doom.d/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@

;; ~/.doom.d/packages.el
;; (package! evil-colemak-basics) ; colemak remaps

(package! quarto-mode :recipe (:host github :repo "quarto-dev/quarto-emacs" ))
Loading

0 comments on commit 511da58

Please sign in to comment.