mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2025-07-09 09:55:29 +00:00
Compare commits
5 Commits
930e6262af
...
c190e8a468
Author | SHA1 | Date | |
---|---|---|---|
|
c190e8a468 | ||
|
a47d340a20 | ||
|
8c1b2e9c61 | ||
|
dc6ed8b930 | ||
|
dd9bebf8b2 |
@ -1,7 +1,7 @@
|
|||||||
// SPDX-FileCopyrightText: 2023-2025 Ivan Molodetskikh <yalterz@gmail.com>
|
// SPDX-FileCopyrightText: 2023-2025 Ivan Molodetskikh <yalterz@gmail.com>
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
//
|
|
||||||
// This config is in the KDL format: https://kdl.dev
|
// This config is in the KDL format: https://kdl.dev
|
||||||
// "/-" comments out the following node.
|
// "/-" comments out the following node.
|
||||||
// Check the wiki for a full description of the configuration:
|
// Check the wiki for a full description of the configuration:
|
||||||
@ -12,8 +12,6 @@
|
|||||||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
|
// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
|
||||||
input {
|
input {
|
||||||
keyboard {
|
keyboard {
|
||||||
repeat-delay 300
|
|
||||||
repeat-rate 30
|
|
||||||
xkb {
|
xkb {
|
||||||
// You can set rules, model, layout, variant and options.
|
// You can set rules, model, layout, variant and options.
|
||||||
// For more information, see xkeyboard-config(7).
|
// For more information, see xkeyboard-config(7).
|
||||||
@ -22,6 +20,8 @@ input {
|
|||||||
// layout "us,ru"
|
// layout "us,ru"
|
||||||
// options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
|
// options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
|
||||||
}
|
}
|
||||||
|
repeat-delay 300
|
||||||
|
repeat-rate 30
|
||||||
}
|
}
|
||||||
|
|
||||||
// Next sections include libinput settings.
|
// Next sections include libinput settings.
|
||||||
@ -252,7 +252,7 @@ layout {
|
|||||||
// Note that running niri as a session supports xdg-desktop-autostart,
|
// Note that running niri as a session supports xdg-desktop-autostart,
|
||||||
// which may be more convenient to use.
|
// which may be more convenient to use.
|
||||||
// See the binds section below for more spawn examples.
|
// See the binds section below for more spawn examples.
|
||||||
// spawn-at-startup "alacritty" "-e" "fish"
|
// spawn-at-startup "foot" "fish"
|
||||||
|
|
||||||
// Uncomment this line to ask the clients to omit their client-side decorations if possible.
|
// Uncomment this line to ask the clients to omit their client-side decorations if possible.
|
||||||
// If the client will specifically ask for CSD, the request will be honored.
|
// If the client will specifically ask for CSD, the request will be honored.
|
||||||
@ -264,7 +264,7 @@ layout {
|
|||||||
// You can change the path where screenshots are saved.
|
// You can change the path where screenshots are saved.
|
||||||
// A ~ at the front will be expanded to the home directory.
|
// A ~ at the front will be expanded to the home directory.
|
||||||
// The path is formatted with strftime(3) to give you the screenshot date and time.
|
// The path is formatted with strftime(3) to give you the screenshot date and time.
|
||||||
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
|
screenshot-path "~/Screenshot from %Y-%m-%d %H-%M-%S.png"
|
||||||
|
|
||||||
// You can also set this to null to disable saving screenshots to disk.
|
// You can also set this to null to disable saving screenshots to disk.
|
||||||
// screenshot-path null
|
// screenshot-path null
|
||||||
@ -317,7 +317,7 @@ window-rule {
|
|||||||
|
|
||||||
// Example: enable rounded corners for all windows.
|
// Example: enable rounded corners for all windows.
|
||||||
// (This example rule is commented out with a "/-" in front.)
|
// (This example rule is commented out with a "/-" in front.)
|
||||||
window-rule {
|
/-window-rule {
|
||||||
geometry-corner-radius 12
|
geometry-corner-radius 12
|
||||||
clip-to-geometry true
|
clip-to-geometry true
|
||||||
}
|
}
|
||||||
@ -344,7 +344,7 @@ binds {
|
|||||||
|
|
||||||
// You can also use a shell. Do this if you need pipes, multiple commands, etc.
|
// You can also use a shell. Do this if you need pipes, multiple commands, etc.
|
||||||
// Note: the entire command goes as a single argument in the end.
|
// Note: the entire command goes as a single argument in the end.
|
||||||
// Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
|
// Mod+T { spawn "bash" "-c" "notify-send hello && exec foot"; }
|
||||||
|
|
||||||
// Example volume keys mappings for PipeWire & WirePlumber.
|
// Example volume keys mappings for PipeWire & WirePlumber.
|
||||||
// The allow-when-locked=true property makes them work even when the session is locked.
|
// The allow-when-locked=true property makes them work even when the session is locked.
|
||||||
@ -576,9 +576,11 @@ binds {
|
|||||||
Mod+Shift+P { power-off-monitors; }
|
Mod+Shift+P { power-off-monitors; }
|
||||||
}
|
}
|
||||||
|
|
||||||
prefer-no-csd
|
// Rootless Xwayland support
|
||||||
spawn-at-startup "sh" "-c" "pgrep --uid $USER shepherd > /dev/null || shepherd"
|
|
||||||
spawn-at-startup "xwayland-satellite" ":233"
|
spawn-at-startup "xwayland-satellite" ":233"
|
||||||
environment {
|
environment {
|
||||||
DISPLAY ":233"
|
DISPLAY ":233"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Start user Shepherd
|
||||||
|
spawn-at-startup "sh" "-c" "pgrep --uid $USER shepherd > /dev/null || shepherd"
|
||||||
|
@ -4,11 +4,15 @@
|
|||||||
|
|
||||||
(define-module (rosenthal services desktop)
|
(define-module (rosenthal services desktop)
|
||||||
#:use-module (guix gexp)
|
#:use-module (guix gexp)
|
||||||
|
#:use-module (guix modules)
|
||||||
|
#:use-module (guix packages)
|
||||||
#:use-module (guix records)
|
#:use-module (guix records)
|
||||||
#:use-module (guix utils)
|
#:use-module (guix utils)
|
||||||
#:use-module (rosenthal utils file)
|
#:use-module (rosenthal utils file)
|
||||||
#:use-module (rosenthal utils packages)
|
#:use-module (rosenthal utils packages)
|
||||||
|
|
||||||
|
#:use-module (guix build-system copy)
|
||||||
|
|
||||||
#:use-module (gnu system)
|
#:use-module (gnu system)
|
||||||
#:use-module (gnu system shadow)
|
#:use-module (gnu system shadow)
|
||||||
|
|
||||||
@ -55,6 +59,7 @@
|
|||||||
home-waybar-configuration
|
home-waybar-configuration
|
||||||
home-waybar-service-type
|
home-waybar-service-type
|
||||||
|
|
||||||
|
%rosenthal-set-keymap
|
||||||
%rosenthal-skeletons
|
%rosenthal-skeletons
|
||||||
%rosenthal-desktop-services
|
%rosenthal-desktop-services
|
||||||
%rosenthal-desktop-home-services))
|
%rosenthal-desktop-home-services))
|
||||||
@ -467,6 +472,108 @@ gtk-key-theme-name = ~a~%"
|
|||||||
;;; Configuration file presets.
|
;;; Configuration file presets.
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
|
(define %rosenthal-set-keymap-script
|
||||||
|
(program-file "set-keymap"
|
||||||
|
(with-imported-modules (source-module-closure '((guix build utils)))
|
||||||
|
#~(begin
|
||||||
|
(use-modules (srfi srfi-1)
|
||||||
|
(srfi srfi-26)
|
||||||
|
(srfi srfi-37)
|
||||||
|
(ice-9 match)
|
||||||
|
(ice-9 popen)
|
||||||
|
(guix build utils))
|
||||||
|
|
||||||
|
(define* (build-keyboard-layout file layout #:optional variant #:key model options)
|
||||||
|
(define pipe
|
||||||
|
(apply open-pipe* OPEN_READ
|
||||||
|
#$(file-append (spec->pkg "console-setup") "/bin/ckbcomp")
|
||||||
|
(string-append "-I" #$(spec->pkg "xkeyboard-config") "/share/X11/xkb")
|
||||||
|
"-rules" "base"
|
||||||
|
`(,@(if model
|
||||||
|
'("-model" ,model)
|
||||||
|
'())
|
||||||
|
,layout
|
||||||
|
,(or variant "")
|
||||||
|
,(string-join options ","))))
|
||||||
|
(mkdir-p (dirname file))
|
||||||
|
(call-with-output-file file
|
||||||
|
(lambda (output)
|
||||||
|
(dump-port pipe output))))
|
||||||
|
|
||||||
|
(define* (set-keyboard-layout layout #:optional variant #:key model options)
|
||||||
|
(define file-name "/tmp/keymaps/console-keymap")
|
||||||
|
(build-keyboard-layout file-name layout variant #:model model #:options options)
|
||||||
|
(invoke "sudo" #$(file-append (spec->pkg "kbd") "/bin/loadkeys") file-name)
|
||||||
|
(when (getenv "WAYLAND_DISPLAY")
|
||||||
|
(substitute* (in-vicinity (getenv "XDG_CONFIG_HOME") "niri/config.kdl")
|
||||||
|
(("^ (layout|variant|model|options) .*") "")
|
||||||
|
(("^ xkb \\{.*" line)
|
||||||
|
(string-append
|
||||||
|
line
|
||||||
|
(format #f " layout ~s~%" layout)
|
||||||
|
(if variant (format #f " variant ~s~%" variant) "")
|
||||||
|
(if model (format #f " model ~s~%" model) "")
|
||||||
|
(format #f " options ~s~%" (string-join options ",")))))))
|
||||||
|
|
||||||
|
(define (show-help-and-exit)
|
||||||
|
(display "\
|
||||||
|
Usage: set-keymap LAYOUT [VARIANT] [-m MODEL] [-o OPTIONS]
|
||||||
|
|
||||||
|
OPTIONS are comma-separated e.g. \"ctrl:nocaps,grp:alt_shift_toggle\"
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
set-keymap us
|
||||||
|
set-keymap us dvorak
|
||||||
|
set-keymap us dvorak -o ctrl:nocaps\n")
|
||||||
|
(quit))
|
||||||
|
|
||||||
|
(define (parse-options)
|
||||||
|
(args-fold (cdr (program-arguments))
|
||||||
|
(list (option '(#\m "model") #t #f
|
||||||
|
(lambda (opt name arg result)
|
||||||
|
(alist-cons 'model arg result)))
|
||||||
|
(option '(#\o "options") #t #f
|
||||||
|
(lambda (opt name arg result)
|
||||||
|
(alist-cons 'options (string-split arg #\,)
|
||||||
|
result)))
|
||||||
|
(option '("help") #f #f
|
||||||
|
(lambda _
|
||||||
|
(show-help-and-exit))))
|
||||||
|
(lambda (opt name arg loads)
|
||||||
|
(error "Unrecognized option `~A'" name))
|
||||||
|
(lambda (opt loads) (cons opt loads))
|
||||||
|
'()))
|
||||||
|
|
||||||
|
(let* ((opts (parse-options))
|
||||||
|
(model (assoc-ref opts 'model))
|
||||||
|
(options (or (assoc-ref opts 'options) '()))
|
||||||
|
(args (remove pair? (reverse opts))))
|
||||||
|
(match args
|
||||||
|
((layout)
|
||||||
|
(set-keyboard-layout layout #:model model #:options options))
|
||||||
|
((layout variant)
|
||||||
|
(set-keyboard-layout layout variant #:model model #:options options))
|
||||||
|
(_
|
||||||
|
(show-help-and-exit))))))))
|
||||||
|
|
||||||
|
(define %rosenthal-set-keymap
|
||||||
|
(hidden-package
|
||||||
|
(package
|
||||||
|
(name "rosenthal-set-keymap")
|
||||||
|
(version "0.0.0")
|
||||||
|
(source %rosenthal-set-keymap-script)
|
||||||
|
(build-system copy-build-system)
|
||||||
|
(arguments
|
||||||
|
(list
|
||||||
|
#:phases
|
||||||
|
#~(modify-phases %standard-phases
|
||||||
|
(replace 'install
|
||||||
|
(lambda _
|
||||||
|
(install-file "set-keymap" (in-vicinity #$output "bin")))))))
|
||||||
|
(home-page "")
|
||||||
|
(synopsis "")
|
||||||
|
(description "")
|
||||||
|
(license #f))))
|
||||||
|
|
||||||
(define %rosenthal-skeletons
|
(define %rosenthal-skeletons
|
||||||
`((".config/emacs/fonts.el"
|
`((".config/emacs/fonts.el"
|
||||||
|
@ -5,7 +5,11 @@
|
|||||||
#:use-module (ice-9 textual-ports)
|
#:use-module (ice-9 textual-ports)
|
||||||
#:use-module (guix gexp)
|
#:use-module (guix gexp)
|
||||||
#:export (computed-substitution-with-inputs
|
#:export (computed-substitution-with-inputs
|
||||||
file-content))
|
file-content
|
||||||
|
hidden-desktop-entry))
|
||||||
|
|
||||||
|
;; XXX: ‘substitute*’ doesn't fully support Unicode:
|
||||||
|
;; https://codeberg.org/guix/guix/src/commit/a88d6a45e422cede96d57d7a953439dc27c6a50c/guix/build/utils.scm#L964
|
||||||
|
|
||||||
(define (computed-substitution-with-inputs name file inputs)
|
(define (computed-substitution-with-inputs name file inputs)
|
||||||
(with-imported-modules '((guix build utils))
|
(with-imported-modules '((guix build utils))
|
||||||
@ -20,3 +24,13 @@
|
|||||||
|
|
||||||
(define (file-content file)
|
(define (file-content file)
|
||||||
(call-with-input-file (canonicalize-path file) get-string-all))
|
(call-with-input-file (canonicalize-path file) get-string-all))
|
||||||
|
|
||||||
|
(define (hidden-desktop-entry name file)
|
||||||
|
(computed-file name
|
||||||
|
(with-imported-modules '((guix build utils))
|
||||||
|
#~(begin
|
||||||
|
(use-modules (guix build utils))
|
||||||
|
(copy-file #$file #$output)
|
||||||
|
(substitute* #$output
|
||||||
|
(("^\\[Desktop Entry\\].*" all)
|
||||||
|
(string-append all "NoDisplay=true\n")))))))
|
||||||
|
Loading…
Reference in New Issue
Block a user