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)
(require 'fg42/cube)
(require 'fg42/flags)
(require 'fg42/cubes/fg42)
(load user-init-file))
(add-hook 'emacs-startup-hook

View File

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

View File

@ -116,6 +116,7 @@
mini-modeline
smart-mode-line
all-the-icons
exwm
)
(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.
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."
`(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))

View File

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