From 1632857b50c9bd36d61e028bc084df815f7937f7 Mon Sep 17 00:00:00 2001 From: "zastian@mrthoddata.com" Date: Wed, 25 Jun 2025 10:38:33 +0100 Subject: [PATCH] to lazy for good messages --- dots/doom/config.el | 52 ++++++++++---------- dots/doom/lisp/ollama.el | 103 ++++++++++++++++++++------------------- dots/hyprland.nix | 20 +++++--- home/homePkgs.nix | 2 + home/stylix.nix | 8 ++- home/work.nix | 1 + 6 files changed, 100 insertions(+), 86 deletions(-) diff --git a/dots/doom/config.el b/dots/doom/config.el index 5cc7168..5b115b0 100755 --- a/dots/doom/config.el +++ b/dots/doom/config.el @@ -216,32 +216,32 @@ ;;ollama stuff ;; -(use-package ellama - :init - ;; setup key bindings - (setopt ellama-keymap-prefix "C-c e") - ;; language you want ellama to translate to - (setopt ellama-language "English") - ;; could be llm-openai for example - (require 'llm-ollama) - (setopt ellama-provider - (make-llm-ollama - ;; this model should be pulled to use it - ;; value should be the same as you print in terminal during pull - :chat-model "codellama:13b" - :embedding-model "codellama:13b")) - ) -(use-package qml-ts-mode - :after lsp-mode - :config - (add-to-list 'lsp-language-id-configuration '(qml-ts-mode . "qml-ts")) - (lsp-register-client - (make-lsp-client :new-connection (lsp-stdio-connection '("qmlls", "-E")) - :activation-fn (lsp-activate-on "qml-ts") - :server-id 'qmlls)) - (add-hook 'qml-ts-mode-hook (lambda () - (setq-local electric-indent-chars '(?\n ?\( ?\) ?{ ?} ?\[ ?\] ?\; ?,)) - (lsp-deferred)))) +;;(use-package ellama +;; :init +;; ;; setup key bindings +;; (setopt ellama-keymap-prefix "C-c e") +;; ;; language you want ellama to translate to +;; (setopt ellama-language "English") +;; ;; could be llm-openai for example +;; (require 'llm-ollama) +;; (setopt ellama-provider +;; (make-llm-ollama +;; ;; this model should be pulled to use it +;; ;; value should be the same as you print in terminal during pull +;; :chat-model "codellama:13b" +;; :embedding-model "codellama:13b")) +;; ) +;;(use-package qml-ts-mode +;; :after lsp-mode +;; :config +;; (add-to-list 'lsp-language-id-configuration '(qml-ts-mode . "qml-ts")) +;; (lsp-register-client +;; (make-lsp-client :new-connection (lsp-stdio-connection '("qmlls", "-E")) +;; :activation-fn (lsp-activate-on "qml-ts") +;; :server-id 'qmlls)) +;; (add-hook 'qml-ts-mode-hook (lambda () +;; (setq-local electric-indent-chars '(?\n ?\( ?\) ?{ ?} ?\[ ?\] ?\; ?,)) +;; (lsp-deferred)))) ;; custom functions diff --git a/dots/doom/lisp/ollama.el b/dots/doom/lisp/ollama.el index bbed3eb..0a24c55 100755 --- a/dots/doom/lisp/ollama.el +++ b/dots/doom/lisp/ollama.el @@ -28,85 +28,86 @@ ;;; Code: (require 'json) +Package-Requires: ((cl-lib "0.5")) (require 'cl-lib) (require 'url) (defgroup ollama nil - "Ollama client for Emacs." - :group 'ollama) + "Ollama client for Emacs." + :group 'ollama) (defcustom ollama:endpoint "http://localhost:11434/api/generate" - "Ollama http service endpoint." - :group 'ollama - :type 'string) + "Ollama http service endpoint." + :group 'ollama + :type 'string) (defcustom ollama:model "codellama:13b" - "Ollama model." - :group 'ollama - :type 'string) + "Ollama model." + :group 'ollama + :type 'string) (defcustom ollama:language "English" - "Language to translate to." - :group 'ollama - :type 'string) + "Language to translate to." + :group 'ollama + :type 'string) (defun ollama-fetch (url prompt model) - (let* ((url-request-method "POST") - (url-request-extra-headers - '(("Content-Type" . "application/json"))) - (url-request-data - (encode-coding-string - (json-encode `((model . ,model) (prompt . ,prompt))) - 'utf-8))) - (with-current-buffer (url-retrieve-synchronously url) - (goto-char url-http-end-of-headers) - (decode-coding-string - (buffer-substring-no-properties - (point) - (point-max)) - 'utf-8)))) + (let* ((url-request-method "POST") + (url-request-extra-headers + '(("Content-Type" . "application/json"))) + (url-request-data + (encode-coding-string + (json-encode `((model . ,model) (prompt . ,prompt))) + 'utf-8))) + (with-current-buffer (url-retrieve-synchronously url) + (goto-char url-http-end-of-headers) + (decode-coding-string + (buffer-substring-no-properties + (point) + (point-max)) + 'utf-8)))) (defun ollama-get-response-from-line (line) - (cdr - (assoc 'response - (json-read-from-string line)))) + (cdr + (assoc 'response + (json-read-from-string line)))) (defun ollama-prompt (url prompt model) - (mapconcat 'ollama-get-response-from-line - (cl-remove-if #'(lambda (str) (string= str "")) - (split-string (ollama-fetch url prompt model) "\n")) "")) + (mapconcat 'ollama-get-response-from-line + (cl-remove-if #'(lambda (str) (string= str "")) + (split-string (ollama-fetch url prompt model) "\n")) "")) ;;;###autoload (defun ollama-prompt-line () - "Prompt with current word." - (interactive) - (with-output-to-temp-buffer "*ollama*" - (princ - (ollama-prompt ollama:endpoint (thing-at-point 'line) ollama:model)))) + "Prompt with current word." + (interactive) + (with-output-to-temp-buffer "*ollama*" + (princ + (ollama-prompt ollama:endpoint (thing-at-point 'line) ollama:model)))) ;;;###autoload (defun ollama-define-word () - "Find definition of current word." - (interactive) - (with-output-to-temp-buffer "*ollama*" - (princ - (ollama-prompt ollama:endpoint (format "define %s" (thing-at-point 'word)) ollama:model)))) + "Find definition of current word." + (interactive) + (with-output-to-temp-buffer "*ollama*" + (princ + (ollama-prompt ollama:endpoint (format "define %s" (thing-at-point 'word)) ollama:model)))) ;;;###autoload (defun ollama-translate-word () - "Translate current word." - (interactive) - (with-output-to-temp-buffer "*ollama*" - (princ - (ollama-prompt ollama:endpoint (format "translate \"%s\" to %s" (thing-at-point 'word) ollama:language) ollama:model)))) + "Translate current word." + (interactive) + (with-output-to-temp-buffer "*ollama*" + (princ + (ollama-prompt ollama:endpoint (format "translate \"%s\" to %s" (thing-at-point 'word) ollama:language) ollama:model)))) ;;;###autoload (defun ollama-summarize-region () - "Summarize marked text." - (interactive) - (with-output-to-temp-buffer "*ollama*" - (princ - (ollama-prompt ollama:endpoint (format "summarize \"\"\"%s\"\"\"" (buffer-substring (region-beginning) (region-end))) ollama:model)))) + "Summarize marked text." + (interactive) + (with-output-to-temp-buffer "*ollama*" + (princ + (ollama-prompt ollama:endpoint (format "summarize \"\"\"%s\"\"\"" (buffer-substring (region-beginning) (region-end))) ollama:model)))) (provide 'ollama) ;;; ollama.el ends here diff --git a/dots/hyprland.nix b/dots/hyprland.nix index 4a95a13..8748d17 100755 --- a/dots/hyprland.nix +++ b/dots/hyprland.nix @@ -35,13 +35,18 @@ in ]; # Autostart necessary processes (like notifications daemons, status bars, etc.) # Or execute your favorite apps at launch like this: - exec-once = [ - #"waybar" - #"quickshell" - "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1" - "fcitx5 -d" - "foot -s" - ] ++ lib.optional (config.home.username == "work") "thunderbird"; + exec-once = + [ + #"waybar" + #"quickshell" + "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1" + "fcitx5 -d" + "foot -s" + ] + ++ lib.optionals (config.home.username == "work") [ + "thunderbird" + "sleep 10 && emacsclient -c --frame-parameters='((name . \"work\"))' $HOME/Documents/work/README.org" + ]; #++ lib.optional (systemName == "laptop") "swaybg -o eDP-1 -i ${../assets/Wallpapers/138.png}" #++ # lib.optional (systemName == "pc") @@ -283,6 +288,7 @@ in # Fix some dragging issues with XWayland "nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0" "workspace special:magic silent, class:thunderbird" + "workspace special:magic silent, class:emacs, title:work" ]; }; diff --git a/home/homePkgs.nix b/home/homePkgs.nix index 558b3d7..9e61e97 100755 --- a/home/homePkgs.nix +++ b/home/homePkgs.nix @@ -198,6 +198,8 @@ in cava lm_sensors thunderbird + libnotify + localsend wmctrl xdotool libinput-gestures diff --git a/home/stylix.nix b/home/stylix.nix index f1fc1a6..529fa0c 100755 --- a/home/stylix.nix +++ b/home/stylix.nix @@ -59,9 +59,13 @@ in package = pkgs.open-sans; name = "Open Sans"; }; + #monospace = { + # package = pkgs.dejavu_fonts; + # name = "DejaVu Sans Mono"; + #}; monospace = { - package = pkgs.dejavu_fonts; - name = "DejaVu Sans Mono"; + package = pkgs.iosevka-comfy.comfy; + name = "Iosevka Comfy"; }; emoji = { package = pkgs.noto-fonts-emoji; diff --git a/home/work.nix b/home/work.nix index a8d720d..180a94f 100755 --- a/home/work.nix +++ b/home/work.nix @@ -22,6 +22,7 @@ in ../dots/hyprlock.nix ./stylix.nix ./homePkgs.nix + ./services.nix ../dots/xdg.nix ../dots/river.nix ../dots/niri.nix