fixing cosmic not working in emacs for iced apps

This commit is contained in:
Chris Cochrun 2024-11-14 16:47:53 -06:00
parent 3cd0e52906
commit 68691811df
2 changed files with 11 additions and 6 deletions

View file

@ -417,6 +417,9 @@ Let's make xref use ripgrep instead of grep for speed.
#+end_src #+end_src
** Fix NixOS ** Fix NixOS
:PROPERTIES:
:ID: 20241114T164653.192420
:END:
I am currently using NixOS. In order for emacs to have access to certain programs, we need to set some environment variables I am currently using NixOS. In order for emacs to have access to certain programs, we need to set some environment variables
#+begin_src emacs-lisp #+begin_src emacs-lisp
(add-to-list 'exec-path "/usr/bin") (add-to-list 'exec-path "/usr/bin")
@ -428,7 +431,6 @@ I am currently using NixOS. In order for emacs to have access to certain program
(setenv "CLUTTER_BACKEND" "wayland") (setenv "CLUTTER_BACKEND" "wayland")
(setenv "GDK_BACKEND" "wayland,x11") (setenv "GDK_BACKEND" "wayland,x11")
(setenv "SDL_VIDEODRIVER" "wayland") (setenv "SDL_VIDEODRIVER" "wayland")
(setenv "WAYLAND_DISPLAY" "wayland-1")
(setenv "XDG_SESSION_TYPE" "wayland") (setenv "XDG_SESSION_TYPE" "wayland")
(defun chris/nix-reload () (defun chris/nix-reload ()
@ -442,9 +444,11 @@ I am currently using NixOS. In order for emacs to have access to certain program
Also due to using greetd, emacs isn't started with the environment from the system, so let's make sure it knows which wayland display we are using Also due to using greetd, emacs isn't started with the environment from the system, so let's make sure it knows which wayland display we are using
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setenv "WAYLAND_DISPLAY" (if (string= (getenv "XDG_CURRENT_DESKTOP") "Hyprland") (let ((desktop (getenv "XDG_CURRENT_DESKTOP")))
(setenv "WAYLAND_DISPLAY" (if (or (string= desktop "COSMIC")
(string= desktop "Hyprland"))
"wayland-1" "wayland-1"
"wayland-0")) "wayland-0")))
#+end_src #+end_src
#+RESULTS: #+RESULTS:

View file

@ -214,7 +214,6 @@
(setenv "CLUTTER_BACKEND" "wayland") (setenv "CLUTTER_BACKEND" "wayland")
(setenv "GDK_BACKEND" "wayland,x11") (setenv "GDK_BACKEND" "wayland,x11")
(setenv "SDL_VIDEODRIVER" "wayland") (setenv "SDL_VIDEODRIVER" "wayland")
(setenv "WAYLAND_DISPLAY" "wayland-1")
(setenv "XDG_SESSION_TYPE" "wayland") (setenv "XDG_SESSION_TYPE" "wayland")
(defun chris/nix-reload () (defun chris/nix-reload ()
@ -225,9 +224,11 @@
(when (boundp 'native-comp-eln-load-path) (when (boundp 'native-comp-eln-load-path)
(add-to-list 'native-comp-eln-load-path (expand-file-name "native-lisp/" store-path))))) (add-to-list 'native-comp-eln-load-path (expand-file-name "native-lisp/" store-path)))))
(setenv "WAYLAND_DISPLAY" (if (string= (getenv "XDG_CURRENT_DESKTOP") "Hyprland") (let ((desktop (getenv "XDG_CURRENT_DESKTOP")))
(setenv "WAYLAND_DISPLAY" (if (or (string= desktop "COSMIC")
(string= desktop "Hyprland"))
"wayland-1" "wayland-1"
"wayland-0")) "wayland-0")))
(executable-find "ssh") (executable-find "ssh")
(setq ispell-program-name "hunspell" (setq ispell-program-name "hunspell"