home-environments: radio: Add fish abbreviations to quick acess of PARA directories

sioyek
Luis Guilherme Coelho 2024-02-13 18:54:45 -03:00
parent 9ac53fb19b
commit 65909e3464
No known key found for this signature in database
GPG Key ID: 1F2E76ACE3F531C8
2 changed files with 25 additions and 13 deletions

View File

@ -211,7 +211,7 @@
home-channels-service-type home-channels-service-type
(list (channel (list (channel
(name 'radix) (name 'radix)
(url "https://codeberg.org/anemofilia/radix") (url "https://codeberg.org/anemofilia/radix.git")
(branch "main") (branch "main")
(introduction (introduction
(make-channel-introduction (make-channel-introduction
@ -279,16 +279,17 @@
("':e'" . "kak") ("':e'" . "kak")
("':q'" . "exit"))) ("':q'" . "exit")))
(abbreviations (abbreviations
`(,@fish-abbreviations:user-dirs `(,@fish-abbreviations:bookmarks
,@fish-abbreviations:extensions
,@fish-abbreviations:channels ,@fish-abbreviations:channels
,@fish-abbreviations:config ,@fish-abbreviations:config
,@fish-abbreviations:quick-edit ,@fish-abbreviations:download/upload
,@fish-abbreviations:bookmarks ,@fish-abbreviations:extensions
,@fish-abbreviations:history
,@fish-abbreviations:guix ,@fish-abbreviations:guix
,@fish-abbreviations:history
,@fish-abbreviations:para
,@fish-abbreviations:quick-edit
,@fish-abbreviations:terminal-emulators ,@fish-abbreviations:terminal-emulators
,@fish-abbreviations:download/upload)))) ,@fish-abbreviations:user-dirs))))
(simple-service 'environment-variables-service (simple-service 'environment-variables-service
home-environment-variables-service-type home-environment-variables-service-type

View File

@ -1,20 +1,31 @@
(define-module (radio fish-abbreviations) (define-module (radio fish-abbreviations)
#:use-module (ice-9 curried-definitions) #:use-module (ice-9 curried-definitions)
#:use-module (radix home services shells) #:use-module (radix home services shells)
#:export (user-dirs #:export (bookmarks
extensions
channels channels
config config
quick-edit download/upload
bookmarks extensions
guix guix
history history
para
quick-edit
terminal-emulators terminal-emulators
download/upload)) user-dirs))
(define at (define at
(symbol-prefix-proc '@)) (symbol-prefix-proc '@))
(define para
(map (lambda (dir)
(abbreviation
(name (at dir))
(position 'anywhere)
(expansion (format #f "~~/~:[~;.~]~a"
(equal? dir 'archive)
dir))))
'(areas projects resources archive)))
(define user-dirs (define user-dirs
(map (lambda (dir) (map (lambda (dir)
(abbreviation (abbreviation
@ -96,7 +107,7 @@
(fish-function "bang-star"))))) (fish-function "bang-star")))))
(define config (define config
(let* ((radix '~/areas/code/scm/radix/) (let* ((radix '~/areas/code/scm/radix)
(user (string->symbol (getlogin))) (user (string->symbol (getlogin)))
(os (string->symbol (gethostname)))) (os (string->symbol (gethostname))))
(list (abbreviation (list (abbreviation