Make sure WM mode is reachable

This commit is contained in:
Sameer Rahmani 2024-02-22 14:19:57 +00:00
parent d2713dab39
commit 688c76af87
Signed by: lxsameer
GPG Key ID: B0A4AF28AB9FD90B
5 changed files with 104 additions and 94 deletions

View File

@ -50,6 +50,9 @@
(when (file-exists-p user-init-file) (when (file-exists-p user-init-file)
(require 'fg42/cube) (require 'fg42/cube)
(require 'fg42/flags)
(require 'fg42/cubes/fg42)
(load user-init-file)) (load user-init-file))
(add-hook 'emacs-startup-hook (add-hook 'emacs-startup-hook

View File

@ -144,6 +144,7 @@ contextual information."
:flag-default t :flag-default t
(fpkg/use exec-path-from-shell (fpkg/use exec-path-from-shell
:init :init
(require 'exec-path-from-shell)
(when (memq window-system '(mac ns x)) (when (memq window-system '(mac ns x))
(exec-path-from-shell-initialize)))) (exec-path-from-shell-initialize))))

View File

@ -116,6 +116,7 @@
mini-modeline mini-modeline
smart-mode-line smart-mode-line
all-the-icons all-the-icons
exwm
) )
(provide 'fg42/deps) (provide 'fg42/deps)

View File

@ -167,7 +167,7 @@ last item in second form, etc."
"A wrapper for autloading FN at FILE with the given DOCSTRING. "A wrapper for autloading FN at FILE with the given DOCSTRING.
This macro looks inside of the cubes directories. If the INTERACTIVE param This macro looks inside of the cubes directories. If the INTERACTIVE param
is non-nil value it means that the function can be called interactively." is non-nil value it means that the function can be called interactively."
`(autoload ,fn (expand-file-name (format "core/fg42/cubes/%s" ,file) fg42-home) `(autoload ,fn (expand-file-name (format "lisp/fg42/cubes/%s" ,file) fg42-home)
,docstring ,interactive)) ,docstring ,interactive))

View File

@ -37,92 +37,99 @@
bash, bash,
}: }:
with builtins; with builtins;
let
getPkg = epkgs: pkg:
if hasAttr pkg epkgs
then getAttr pkg epkgs
else getAttr pkg ourPackages;
stdenv.mkDerivation (final: emacsBundle = (emacsPackagesFor emacs).withPackages (epkgs:
let (map (x: getPkg epkgs x) elispPkgs)
getPkg = epkgs: pkg: );
if hasAttr pkg epkgs
then getAttr pkg epkgs
else getAttr pkg ourPackages;
emacsBundle = (emacsPackagesFor emacs).withPackages (epkgs: maintainers = import ./maintainers.nix;
(map (x: getPkg epkgs x) elispPkgs) in stdenv.mkDerivation (final: rec{
); pname = "fg42$";
version = "4.0.0";
maintainers = import ./maintainers.nix; src = srcDir;
outputs = [ "out" ];
in rec{ buildPhase = ''
pname = "fg42"; LISPDIR=$out/share/fg42/
version = "4.0.0"; mkdir -p $out/bin
install -d $LISPDIR
cp -rv ${src}/lisp/ $LISPDIR
cp -rv ${src}/share $out/
src = srcDir; runHook preBuild
outputs = [ "out" ];
buildPhase = '' cd $LISPDIR
LISPDIR=$out/share/fg42/ emacs -L . --batch -f batch-byte-compile *.el
mkdir -p $out/bin cd -
install -d $LISPDIR
cp -rv ${src}/lisp/ $LISPDIR
cp -rv ${src}/share $out/
runHook preBuild cat >> $out/bin/fg42 << EOF
#!${stdenv.shell}
cd $LISPDIR export FG42_HOME=${placeholder "out"}/share/fg42/
emacs -L . --batch -f batch-byte-compile *.el export FG42_EMACSD=~/.fg42/v4/emacs.d
cd - export FG42_USE_NIX=true;
cat >> $out/bin/fg42 << EOF LIBRARY_PATH="\$(${stdenv.cc}/bin/cc -print-file-name=libgccjit.so):\$LIBRARY_PATH" \
#!${stdenv.shell} FG42_WM=fales ${emacsBundle}/bin/emacs \
--name FG42 \
-q --no-splash --title FG42 \
-l \$FG42_HOME/lisp/fg42/init.el "\$@"
EOF
chmod +x $out/bin/fg42
runHook postBuild
export FG42_HOME=${placeholder "out"}/share/fg42/ cat >> $out/bin/fg42-wm << EOF
export FG42_EMACSD=~/.fg42/v4/emacs.d #!${stdenv.shell}
export FG42_USE_NIX=true;
LIBRARY_PATH="\$(${stdenv.cc}/bin/cc -print-file-name=libgccjit.so):\$LIBRARY_PATH" \ export FG42_HOME=${placeholder "out"}/share/fg42/
FG42_WM=false ${emacsBundle}/bin/emacs \ export FG42_EMACSD=~/.fg42/v4/emacs.d
--name FG42 \ export FG42_USE_NIX=true;
-q --no-splash --title FG42 \
-l \$FG42_HOME/lisp/fg42/init.el "\$@"
EOF
chmod +x $out/bin/fg42
cat >> $out/bin/fg42-wm << EOF # Disable access control for the current user.
#!${stdenv.shell} xhost +SI:localuser:$USER
export FG42_HOME=${placeholder "out"}/share/fg42/ # Make Java applications aware this is a non-reparenting window manager.
export FG42_EMACSD=~/.fg42/v4/emacs.d export _JAVA_AWT_WM_NONREPARENTING=1
export FG42_USE_NIX=true;
# Disable access control for the current user.
xhost +SI:localuser:$USER
# Make Java applications aware this is a non-reparenting window manager. # Set default cursor.
export _JAVA_AWT_WM_NONREPARENTING=1 xsetroot -cursor_name left_ptr
# Set default cursor. # Set keyboard repeat rate.
xsetroot -cursor_name left_ptr xset r rate 400 30
# Set keyboard repeat rate. # Uncomment the following block to use the exwm-xim module.
xset r rate 400 30 # export XMODIFIERS=@im=exwm-xim
# export GTK_IM_MODULE=xim
# export QT_IM_MODULE=xim
# export CLUTTER_IM_MODULE=xim
# Uncomment the following block to use the exwm-xim module. LIBRARY_PATH="\$(${stdenv.cc}/bin/cc -print-file-name=libgccjit.so):\$LIBRARY_PATH" \
# export XMODIFIERS=@im=exwm-xim FG42_WM=true ${emacsBundle}/bin/emacs \
# export GTK_IM_MODULE=xim --name FG42 \
# export QT_IM_MODULE=xim -q --no-splash --title FG42 \
# export CLUTTER_IM_MODULE=xim -l \$FG42_HOME/lisp/fg42/init.el "\$@"
EOF
chmod +x $out/bin/fg42-wm
LIBRARY_PATH="\$(${stdenv.cc}/bin/cc -print-file-name=libgccjit.so):\$LIBRARY_PATH" \ cat >> $out/share/runtiem_deps << EOF
FG42_WM=true ${emacsBundle}/bin/emacs \ ${vazir-fonts}
--name FG42 \ ${fira-code}
-q --no-splash --title FG42 \ ${nerdfonts}
-l \$FG42_HOME/lisp/fg42/init.el "\$@" ${ripgrep}
EOF ${git}
chmod +x $out/bin/fg42-wm ${ltex-ls}
EOF
runHook postBuild runHook postBuild
'';
''; installPhase = ''
installPhase = ''
runHook preInstall runHook preInstall
#LISPDIR=$out/share/fg42/lisp/ #LISPDIR=$out/share/fg42/lisp/
@ -132,39 +139,37 @@ stdenv.mkDerivation (final:
''; '';
buildInputs = [ buildInputs = [
gcc emacs
emacs texinfo
texinfo emacsBundle
emacsBundle ripgrep
ripgrep git
git texinfo
texinfo vazir-fonts
vazir-fonts fira-code
fira-code nerdfonts
nerdfonts gcc
gcc ltex-ls
ltex-ls bash
bash ];
];
addEmacsNativeLoadPath = true;
addEmacsNativeLoadPath = true; meta = {
broken = false;
meta = { platforms = emacs.meta.platforms;
broken = false; homepage = "https://fg42.org/";
platforms = emacs.meta.platforms; maintainers = [ maintainers.lxsameer ];
homepage = "https://fg42.org/"; description = "The mighty editor for the emacsians";
maintainers = [ maintainers.lxsameer ]; longDescription = ''
description = "The mighty editor for the emacsians";
longDescription = ''
FG42 is a framework to create and editor and window manager based on GNU/Emacs. FG42 is a framework to create and editor and window manager based on GNU/Emacs.
It has a pre-defined setup as well which can be installed out of the box. But the It has a pre-defined setup as well which can be installed out of the box. But the
goal of this project is to provide the API necessary to create an integrated editor. goal of this project is to provide the API necessary to create an integrated editor.
So you need to know about Emacs in advance. So you need to know about Emacs in advance.
''; '';
license = lib.licenses.gpl3Plus; license = lib.licenses.gpl3Plus;
}; };
}) })