Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes ccsm #1

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3931514
Update default.nix
LuNeder May 13, 2024
1e6fa29
Update default.nix
LuNeder May 13, 2024
dc552d4
Update default.nix
LuNeder May 13, 2024
631a090
Update default.nix
LuNeder May 13, 2024
a025911
tries to fix ccsm
LuNeder May 13, 2024
23b5c17
Update default.nix
LuNeder May 13, 2024
a511a28
Update default.nix
LuNeder May 13, 2024
712262b
Update default.nix
LuNeder May 13, 2024
024a0e3
Update default.nix
LuNeder May 13, 2024
4cfa5ba
Update default.nix
LuNeder May 13, 2024
1dc28e2
Update default.nix
LuNeder May 13, 2024
b3a5a22
Update default.nix
LuNeder May 13, 2024
53b14d5
Update default.nix
LuNeder May 13, 2024
e9d74aa
Update default.nix
LuNeder May 13, 2024
b6bef33
Merge from Gab's repo
LuNeder May 23, 2024
526a76c
Update default.nix
LuNeder May 23, 2024
ffa4610
fix broken decorator
LuNeder May 23, 2024
e8f35de
Update default.nix
LuNeder May 23, 2024
2571099
Update reverse-unity-config.patch
LuNeder May 23, 2024
b868477
Update reverse-unity-config.patch
LuNeder May 23, 2024
417b966
Delete patches/reverse-unity-config.patch
LuNeder May 23, 2024
9e48ca4
Update default.nix
LuNeder May 23, 2024
a1cf580
i have no idea now
LuNeder May 23, 2024
ccfe7bb
revert to https://github.com/Misterio77/nix-config/commit/7f270e1c010…
LuNeder May 24, 2024
ccb2f17
revert to https://github.com/Misterio77/nix-config/commit/7f270e1c010…
LuNeder May 24, 2024
b9adf69
Update default.nix
LuNeder May 24, 2024
de7f0e5
try to fix ccsm again
LuNeder May 25, 2024
3df9493
Update default.nix
LuNeder May 25, 2024
079d082
Update compiz-suse-defaults.patch
LuNeder May 25, 2024
aa97268
Update compiz-suse-defaults.patch
LuNeder May 25, 2024
1249476
try to fix
LuNeder May 25, 2024
a1eea3f
try to fix
LuNeder May 25, 2024
9ada074
Update compiz-suse-defaults.patch
LuNeder May 25, 2024
58010b2
Update compiz-suse-defaults.patch
LuNeder May 25, 2024
a7cd03d
Update compiz-suse-defaults.patch
LuNeder May 25, 2024
657d80a
Create README.md
LuNeder May 27, 2024
d1ca118
Adds usage and installation documentation
LuNeder May 27, 2024
184ce28
further documentation
LuNeder May 27, 2024
461230d
fix
LuNeder Jun 21, 2024
7284ebe
Tries to fix
LuNeder Jul 15, 2024
e989d93
try to fix
LuNeder Jul 15, 2024
a2d6187
Tries to fix, again
LuNeder Jul 15, 2024
c817fb6
Actually fixes now (hopefully)
LuNeder Jul 15, 2024
43cad36
Maybe fixes?
LuNeder Jul 15, 2024
6ff6ea3
fix
LuNeder Sep 14, 2024
774f201
fix
LuNeder Sep 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Compiz 0.9 on Nix

This is [Compiz 0.9.x](https://code.launchpad.net/compiz) packaged for NixOS.

TODO:
- [x] Compiz (Full)
- [ ] Emerald (Full)

Tragically, Nix decided to remove Compiz from nixpkgs like ages ago. This was the only thing stopping me from migrating to NixOS (since I use compiz at least until I can make my own wayland wm :3), so now compiz is back on the nix land!

This is a fork of [Gabriel's repo](https://github.com/Misterio77/compiz-nix). He's like the proest of pros when it comes to nix, and he did most of the work packaging this!


## Installing

Add this repo to your flake inputs on your `flake.nix`:
````nix
compiz.url = "github:LuNeder/compiz-reloaded-nix/compiz09";
compiz.inputs.nixpkgs.follows = "nixpkgs";
````

Then install Compiz from your `environment.systemPackages`:
````nix
inputs.compiz.packages.${pkgs.system}.default
````

## Using

You now should be able to launch Compiz from a terminal with `compiz --replace`.

If you use XFCE and want to use Compiz as your compositor/window manager, you can add the following to your Home-Manager config to autostart it:

````nix
# Autostart Compiz
xfconf.settings = {
xfce4-session."sessions/Failsafe/Client1_Command" = [ "xfsettingsd" ];
xfce4-session."sessions/Failsafe/Client0_Command" = [ "compiz" ];
};
````

## Configuring

You can configure Compiz from CompizConfig (CCSM). Run `ccsm` from your terminal or find it in your menu or something.
For now there's no way to configure Compiz directly from Nix but ccsm is really cool (if you want to share your Compiz configuration you can export (and import) it from ccsm).

#### Note

Compiz will launch the `gtk-window-decorator` window decorator on startup by default. If you don't like it, you can change this for your favourite decorator on ccsm. I'll package Emerald someday which will probably be a better fit.

## Compiz-Reloaded
I'm also trying to package compiz-reloaded since Compiz 0.9 has some weird bugs (unlike compiz 0.8 / [compiz-reloaded](https://gitlab.com/compiz/compiz-core)), but that's still a wip (see the [main](https://github.com/LuNeder/compiz-reloaded-nix/tree/main) branch of this repo).
75 changes: 54 additions & 21 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
{
stdenv,
fetchurl,
lib,
cmake,
pkg-config,
makeWrapper,
boost,
cairo,
cmake,
fetchurl,
fuse,
glibmm,
gnome,
metacity,
gobject-introspection,
gtk3,
intltool,
libnotify,
libstartup_notification,
libwnck3,
libxml2,
libxslt,
makeWrapper,
mesa_glu,
pcre2,
pkg-config,
protobuf,
python3,
python3Packages,
stdenv,
wrapGAppsHook,
xorg,
xorgserver,
...
Expand All @@ -35,18 +40,26 @@ stdenv.mkDerivation (f: {

nativeBuildInputs = [
cmake
pkg-config
libxml2
makeWrapper
xorg.libXdmcp.dev
pcre2.dev
libxml2.dev
pcre2
pkg-config
(python3Packages.python.withPackages (p: [ p.setuptools ]))
python3Packages.distlib
python3Packages.distutils-extra
python3Packages.cython
python3Packages.setuptools
python3Packages.wrapPython
wrapGAppsHook
];
buildInputs = [
boost
cairo
fuse
glibmm
gnome.metacity
metacity
gobject-introspection
gtk3
intltool
libnotify
libstartup_notification
Expand All @@ -55,32 +68,52 @@ stdenv.mkDerivation (f: {
libxslt
mesa_glu
pcre2
pcre2.dev
protobuf
python3Packages.cython
python3Packages.pycairo
python3Packages.pygobject3
python3Packages.setuptools
xorg.libXcursor
xorg.libXdmcp
xorg.libXdmcp.dev
xorgserver
];

postInstall = ''
sed -i "s|/usr/bin/metacity|${gnome.metacity}/bin/metacity|" $out/bin/compiz-decorator
sed -i "s|/usr/bin/metacity|metacity|" $out/bin/compiz-decorator
sed -i "s|/usr/bin/compiz-decorator|$out/bin/compiz-decorator|" $out/share/compiz/decor.xml
wrapProgram $out/bin/compiz \
--suffix LD_LIBRARY_PATH : "$out/lib" \
--suffix COMPIZ_BIN_PATH : "$out/bin/"
'';

dontWrapGApps = true;

pythonPath = with python3Packages; [
pycairo
pygobject3
];

postFixup = ''
wrapProgram "$out/bin/compiz" \
--prefix COMPIZ_BIN_PATH : "$out/bin/" \
--prefix LD_LIBRARY_PATH : "$out/lib"

wrapProgram "$out/bin/compiz-decorator" \
--prefix COMPIZ_BIN_PATH : "$out/bin/" \
--prefix PATH : "${metacity}/bin"

# Wrap CCSM with GApps and Python path
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
wrapPythonPrograms
for i in $out/bin/*
do
wrapProgram $i \
--prefix PATH : ${lib.makeBinPath [
(python3.withPackages(pp: [pp.pygobject3 pp.distutils-extra pp.distlib]))
]}
done
'';

patches = [
./patches/reverse-unity-config.patch
# ./patches/reverse-unity-config.patch
./patches/focus-prevention-disable.patch
./patches/gtk-extents.patch
./patches/screenshot-launch-fix.patch
./patches/no-compile-gschemas.patch
./patches/compiz-suse-defaults.patch
];

cmakeFlags = [
Expand Down
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
forEachSystem = nixpkgs.lib.genAttrs (import systems);
in {
overlays.default = final: prev: {
compiz = final.callPackage ./. {};
compiz = final.callPackage ./. { python3 = final.python311; python3Packages = final.python311Packages; };
};

packages = forEachSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in rec {
default = compiz;
compiz = pkgs.callPackage ./. {};
compiz = pkgs.callPackage ./. { python3 = pkgs.python311; python3Packages = pkgs.python311Packages; };
});
};
}
116 changes: 116 additions & 0 deletions patches/compiz-suse-defaults.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
--- a/metadata/core.xml.in
+++ b/metadata/core.xml.in
@@ -13,7 +13,7 @@
<option name="audible_bell" type="bool">
<_short>Audible Bell</_short>
<_long>Audible system beep</_long>
- <default>true</default>
+ <default>false</default>
</option>
<option name="ignore_hints_when_maximized" type="bool">
<_short>Ignore Hints When Maximized</_short>
@@ -35,7 +35,7 @@
<option name="ping_delay" type="int">
<_short>Ping Delay</_short>
<_long>Interval between ping messages</_long>
- <default>5000</default>
+ <default>7500</default>
<min>1000</min>
<max>30000</max>
</option>
@@ -254,7 +254,7 @@
<option name="hsize" type="int">
<_short>Horizontal Virtual Size</_short>
<_long>Screen size multiplier for horizontal virtual size</_long>
- <default>1</default>
+ <default>4</default>
<min>1</min>
<max>32</max>
</option>
--- a/plugins/cube/cube.xml.in
+++ b/plugins/cube/cube.xml.in
@@ -123,18 +123,18 @@
<_short>Skydome Gradient Start Color</_short>
<_long>Color and opacity to use for the top color-stop of the skydome-fallback gradient.</_long>
<default>
- <red>0x0d0d</red>
- <green>0xb1b1</green>
- <blue>0xfdfd</blue>
+ <red>0xafaf</red>
+ <green>0xafaf</green>
+ <blue>0xafaf</blue>
</default>
</option>
<option name="skydome_gradient_end_color" type="color">
<_short>Skydome Gradient End Color</_short>
<_long>Color and opacity to use for the bottom color-stop of the skydome-fallback gradient.</_long>
<default>
- <red>0xfefe</red>
- <green>0xffff</green>
- <blue>0xc7c7</blue>
+ <red>0x7777</red>
+ <green>0x7777</green>
+ <blue>0x7777</blue>
</default>
</option>
</subgroup>
@@ -144,7 +144,7 @@
<option name="active_opacity" type="float">
<_short>Opacity During Rotation</_short>
<_long>Opacity of the desktop during cube rotation (in percent).</_long>
- <default>100.0</default>
+ <default>40.0</default>
<min>0.0</min>
<max>100.0</max>
<precision>1.0</precision>
@@ -160,7 +160,7 @@
<option name="transparent_manual_only" type="bool">
<_short>Transparency Only On Mouse Rotate</_short>
<_long>Initiates cube transparency only, if the rotation is mouse driven.</_long>
- <default>true</default>
+ <default>false</default>
</option>
</group>
</options>
--- a/plugins/decor/decor.xml.in
+++ b/plugins/decor/decor.xml.in
@@ -23,7 +23,7 @@
<option name="active_shadow_radius" type="float">
<_short>Shadow Radius</_short>
<_long>Drop shadow radius</_long>
- <default>8.0</default>
+ <default>7.0</default>
<min>0.1</min>
<max>18.0</max>
<precision>0.1</precision>
@@ -101,7 +101,7 @@
<option name="command" type="string">
<_short>Command</_short>
<_long>Decorator command line that is executed if no decorator is already running.</_long>
- <default>gtk-window-decorator</default>
+ <default>/run/current-system/sw/bin/gtk-window-decorator</default>
</option>
<option name="mipmap" type="bool">
<_short>Mipmap</_short>
--- a/plugins/place/place.xml.in
+++ b/plugins/place/place.xml.in
@@ -20,7 +20,7 @@
<option name="mode" type="int">
<_short>Placement Mode</_short>
<_long>Algorithm to use for window placement</_long>
- <default>2</default>
+ <default>1</default>
<min>0</min>
<max>5</max>
<desc>
--- a/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp
+++ b/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp
@@ -46,7 +46,7 @@

namespace
{
-unsigned int DEFAULT_VIEWPORT_WIDTH = 1;
+unsigned int DEFAULT_VIEWPORT_WIDTH = 4;
unsigned int DEFAULT_VIEWPORT_HEIGHT = 1;

bool Advance (Display *d, bool r)