workflows/mosey-branch: remove

It served its purpose as a reference for making a custom gnome-session
session for now.
This commit is contained in:
Gabriel Arazas 2024-01-07 17:30:04 +08:00
parent 90cf781b9d
commit c3ffbd9f69
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
18 changed files with 0 additions and 638 deletions

View File

@ -18,7 +18,6 @@ in {
imports = [
./a-happy-gnome
./knome
./mosey-branch
];
config = {

View File

@ -1,27 +0,0 @@
= Mosey branch
:toc:
A workflow module of a "prim" and "proper" desktop environment featuring Hyprland and my link:https://github.com/foo-dogsquared/base16-bark-on-a-tree-scheme[custom colorscheme].
It is integrated with link:https://systemd.io/DESKTOP_ENVIRONMENTS/[systemd] through link:https://gitlab.gnome.org/GNOME/gnome-session/[gnome-session] (but it could be used without systemd since gnome-session can be also be used without systemd).
// TODO: Screenshot
It's a dolled up setup that is mainly inspired from GNOME Shell's layout (being an enthusiastic GNOME user myself) and link:https://github.com/PoSayDone/.dotfiles_wayland/[PoSayDone's Wayland dotfiles].
In here, I tried to recreate GNOME Shell's workflow and link:../a-happy-gnome[my GNOME configuration] as close as possible, keybindings and everything.
Here's a list of components used for this workflow module.
- Hyprland as the Wayland window compositor.
- link:https://github.com/Aylur/ags/[ags] as a widget system with link:https://github.com/wmww/gtk4-layer-shell[gtk4-layer-shell].
Since Hyprland has implemented Layer Shell protocol, we may as well try to implement them widgets ourselves (which is quite fun).
- link:https://github.com/Kirottu/anyrun[anyrun] as the application launcher and also uses custom menu.
- Expects GDM as the display manager.
Though you should be able to easily replace it with something else.
- Uses a custom desktop session with link:https://gitlab.gnome.org/GNOME/gnome-session/[gnome-session].
This allows me to make this workflow as a full desktop environment with easy access for link:https://systemd.io/DESKTOP_ENVIRONMENTS/[systemd integration]. footnote:[Some might say Hyprland is not a desktop environment but for me, every single graphical session IS a desktop environment.]
- As most workflows, it makes use of link:https://github.com/Misterio77/nix-colors/[nix-colors] as it makes color scheme management easier.

View File

@ -1,14 +0,0 @@
= Mosey branch custom session
:toc:
This is an installation template for the custom desktop environment "Mosey branch" containing configuration files including systemd units, gnome-session sessions, and desktop entries for the required components.
Much of it is inspired from link:https://gitlab.gnome.org/World/Phosh/phosh/[Phosh session files], link:https://gitlab.gnome.org/GNOME/gnome-shell[gnome-shell session files], and link:https://gitlab.gnome.org/GNOME/gnome-settings-daemon/[gnome-settings-daemon systemd service files].
You can also find out more details to configure gnome-session from `gnome-session(1)` manual page.
To build this template, you have to build with link:https://mesonbuild.com/[Meson build system].
[source, shell]
----
meson setup builddir && cd builddir
meson compile
----

View File

@ -1,11 +0,0 @@
[Desktop Entry]
Type=Application
Name=@component@
Comment=@description@
Exec=@script@
OnlyShowIn=Mosey Branch;
NoDisplay=true
X-GNOME-Autostart-Phase=@gsm_phase@
X-GNOME-Autostart-Notify=true
X-GNOME-AutoRestart=true
X-GNOME-HiddenUnderSystemd=true

View File

@ -1,19 +0,0 @@
[Unit]
Description=@description@
CollectMode=inactive-or-failed
RefuseManualStart=true
RefuseManualStop=true
After=gnome-session-initialized.target
# These are implied to be `Before=gnome-session.target` since we're packing
# them all up in the override configuration of the session target anyways.
Requisite=@app_id@.@component@.target
Before=@app_id@.@component@.target
PartOf=@app_id@.@component@.target
[Service]
Slice=session.slice
Restart=on-failure
ExecStart=@script@
TimeoutStopSec=5

View File

@ -1,12 +0,0 @@
[Unit]
Description=@description@
Documentation=man:gnome-session(1) man:systemd.special(7)
CollectMode=inactive-or-failed
# Pull in the service.
Wants=@app_id@.@component@.service
# Require GNOME session and do some reordering.
PartOf=gnome-session-initialized.target
After=gnome-session-initialized.target
Before=gnome-session.target

View File

@ -1,47 +0,0 @@
{ stdenv
, lib
, meson
, ninja
, pkg-config
, makeWrapper
, gnome
# This is the prefix used for the installed files in the output.
, prefix ? "one.foodogsquared.MoseyBranch."
, serviceScript ? "Hyprland"
, agsScript ? "ags"
, polkitScript ? "polkit"
}:
stdenv.mkDerivation rec {
pname = "mosey-branch-custom-desktop-session";
version = "2023-08-21";
src = ./.;
nativeBuildInputs = [
meson
ninja
pkg-config
makeWrapper
];
mesonFlags = [
"-Dservice_script=${serviceScript}"
"-Dags_script=${agsScript}"
"-Dpolkit_script=${polkitScript}"
];
passthru.providedSessions = [ "mosey-branch" ];
postInstall = ''
wrapProgram "$out/libexec/mosey-branch-session" \
--prefix PATH : "${lib.makeBinPath [ gnome.gnome-session ]}"
'';
meta = with lib; {
description = "Custom desktop files for the custom desktop environment";
license = licenses.gpl3Plus;
platforms = platforms.linux;
};
}

View File

@ -1,151 +0,0 @@
project('mosey-branch',
version: '2023-08-21',
license: 'GPL-3.0-or-later',
meson_version: '>=0.54.0',
)
app_id = 'one.foodogsquared.MoseyBranch'
prefix = get_option('prefix')
libexecdir = join_paths(prefix, get_option('libexecdir'))
datadir = join_paths(prefix, get_option('datadir'))
systemddir = join_paths(datadir, 'systemd')
applicationsdir = join_paths(datadir, 'applications')
systemduserdir = join_paths(systemddir, 'user')
autostartdir = join_paths(prefix, 'etc', 'xdg', 'autostart')
unit_name_template = app_id + '.@0@.@1@'
required_components = {
'polkit': {
'description': 'Authentication agent for the desktop service',
'script': get_option('polkit_script'),
},
'ags': {
'description': 'Widget system',
'script': get_option('ags_script'),
},
}
session_dropins = [
'gnome-session@mosey-branch.target.d',
]
session_wants = ''
foreach name, component : required_components
session_wants += 'Wants=' + unit_name_template.format(name, 'target') + '\n'
endforeach
# Install each gnome-session overrides.
sessionconf = configuration_data()
sessionconf.set('session_wants', session_wants)
foreach session_dropin : session_dropins
configure_file(
input: 'mosey-branch.systemd-conf.in',
output: 'session.conf',
install_dir: join_paths(systemduserdir, session_dropin),
configuration: sessionconf,
install: true
)
endforeach
# Installing the Wayland session desktop entry.
desktopentryconf = configuration_data()
desktopentryconf.set('libexecdir', libexecdir)
configure_file(
input: 'mosey-branch.desktop',
output: 'mosey-branch.desktop',
install_dir: join_paths(datadir, 'wayland-sessions'),
configuration: desktopentryconf,
install: true,
)
# Installing the core systemd units for the desktop session. This is both for
# the systemd- and non-systemd-managed GNOME sessions.
targetconf = configuration_data()
targetconf.set('app_id', app_id)
configure_file(
input: 'mosey-branch.target',
output: app_id + '.target',
install_dir: systemduserdir,
configuration: targetconf,
install: true,
)
serviceconf = configuration_data()
serviceconf.set('script', get_option('service_script'))
configure_file(
input: 'mosey-branch.service',
output: app_id + '.service',
install_dir: systemduserdir,
configuration: serviceconf,
install: true,
)
configure_file(
input: 'mosey-branch.desktop.in',
output: app_id + '.desktop',
install_dir: applicationsdir,
configuration: serviceconf,
install: true,
)
# Setting up for installing with the core services systemd units.
required_services = []
foreach name, component : required_components
required_services += app_id + '.' + name
endforeach
gnomesessionconf = configuration_data()
gnomesessionconf.set(
'required_components',
';'.join([ app_id ] + required_services) + ';'
)
configure_file(
input: 'mosey-branch.gnome-session.in',
output: 'mosey-branch.session',
install_dir: datadir / 'gnome-session/sessions',
configuration: gnomesessionconf,
install: true,
)
runconf = configuration_data()
runconf.set('prefix', prefix)
configure_file(
input: 'mosey-branch.bin.in',
output: 'mosey-branch-session',
install_dir: libexecdir,
configuration: runconf,
install: true,
)
foreach name, component : required_components
componentsconf = configuration_data()
componentsconf.set('component', name)
componentsconf.set('app_id', app_id)
componentsconf.set('description', component.get('description'))
componentsconf.set('script', component.get('script'))
componentsconf.set('gsm_phase', component.get('gsm_phase', 'Desktop'))
configure_file(
input: 'core-service.service.in',
output: unit_name_template.format(name, 'service'),
install_dir: systemduserdir,
configuration: componentsconf,
install: true,
)
configure_file(
input: 'core-service.target.in',
output: unit_name_template.format(name, 'target'),
install_dir: systemduserdir,
configuration: componentsconf,
install: true,
)
configure_file(
input: 'core-service.desktop.in',
output: unit_name_template.format(name, 'desktop'),
install_dir: autostartdir,
configuration: componentsconf,
install: true,
)
endforeach

View File

@ -1,17 +0,0 @@
option('service_script',
type: 'string',
value: 'Hyprland',
description: 'Executable for the main session script.'
)
option('polkit_script',
type: 'string',
value: 'polkit',
description: 'Executable and its arguments of the polkit daemon.'
)
option('ags_script',
type: 'string',
value: 'ags',
description: 'Executable and its arguments of the AGS widget system.'
)

View File

@ -1,9 +0,0 @@
#!/bin/bash
# gnome-session is also looking for RequiredComponents in here.
export XDG_CONFIG_DIRS=@prefix@/etc/xdg${XDG_CONFIG_DIRS:-:$XDG_CONFIG_DIRS}
# We'll have to force gnome-session to detect our session.
export XDG_DATA_DIRS=@prefix@/share${XDG_DATA_DIRS:-:$XDG_DATA_DIRS}
gnome-session --session=mosey-branch --systemd --disable-acceleration-check

View File

@ -1,5 +0,0 @@
[Desktop Entry]
Name=Mosey Branch
Comment=foodogsquared's Hyprland-based desktop environment setup
Exec=@libexecdir@/mosey-branch-session
Type=Application

View File

@ -1,13 +0,0 @@
[Desktop Entry]
Type=Application
Name=Mosey Branch
Comment=Window manager
Exec=@script@
Categories=wlroots;Core;
OnlyShowIn=Mosey Branch;
NoDisplay=true
X-GNOME-Autostart-Phase=WindowManager
X-GNOME-Provides=windowmanager;
X-GNOME-Autostart-Notify=true
X-GNOME-AutoRestart=false
X-GNOME-HiddenUnderSystemd=true

View File

@ -1,4 +0,0 @@
[GNOME Session]
Name=Mosey Branch session
# Must be in sync with gnome-session@mosey-branch.target.d/session.conf drop-in.
RequiredComponents=@required_components@

View File

@ -1,28 +0,0 @@
# This user service is intended to be started with gnome-session.
[Unit]
Description=Mosey Branch desktop environment
Documentation=https://wiki.hyprland.org
After=gnome-manager-manager.target
Requisite=gnome-session-initialized.target
PartOf=gnome-session-initialized.target
OnFailure=gnome-session-shutdown.target
OnFailureJobMode=replace-irreversibly
CollectMode=inactive-or-failed
RefuseManualStart=true
RefuseManualStop=true
StartLimitIntervalSec=15
StartLimitBurst=4
[Service]
Slice=session.slice
Restart=on-failure
ExecStart=@script@
Type=notify
NotifyAccess=all
OOMScoreAdjust=-1000
TimeoutStopSec=5

View File

@ -1,4 +0,0 @@
[Unit]
@session_wants@
Requires=one.foodogsquared.MoseyBranch.target

View File

@ -1,11 +0,0 @@
[Unit]
Description=Mosey Branch session
Documentation=man:gnome-session(1) man:systemd.special(7)
DefaultDependencies=no
Requisite=gnome-session-initialized.target
PartOf=gnome-session-initialized.target
Before=gnome-session-initialized.target
Requires=@app_id@.service
After=@app_id@.service

View File

@ -1,86 +0,0 @@
# Take note not everything here is complete as the
# workflow module will also generated dynamic
# configuration for certain settings such as the
# keybindings related to the chosen terminal emulator.
decoration {
dim_inactive = true
dim_strength = 0.66
}
animations {
enabled = true
bezier = ease, .84, .91, .69, 1.04
animation = windows, 1, 2, ease, slide
animation = workspaces, 1, 1, ease, slide
animation = fadeDim, 0, 0.5, ease
}
input {
touchpad {
disable_while_typing = false
scroll_factor = 1.1
middle_button_emulation = true
tap-to-click = true
}
}
gestures {
workspace_swipe = true
workspace_swipe_fingers = 3
workspace_swipe_invert = false
}
misc {
disable_hyprland_logo = true
animate_manual_resizes = true
animate_mouse_windowdragging = true
# We're going to force using this configuration
# anyways so...
disable_autoreload = true
}
binds {
allow_workspace_cycles = true
}
$mainMod = SUPER
# Windows management.
bind = $mainMod, q, killactive
bind = $mainMod, y, togglefloating
bind = $mainMod, f, fullscreen
bind = $mainMod SHIFT, f, pin
# Mouse bindings for window management.
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# Workspace-related movements.
# With Vim keybindings.
bind = $mainMod, l, movefocus, r
bind = $mainMod, h, movefocus, l
bind = $mainMod, j, movefocus, u
bind = $mainMod, k, movefocus, d
bind = $mainMod, Right, movefocus, r
bind = $mainMod, Left, movefocus, l
bind = $mainMod, Up, movefocus, u
bind = $mainMod, Down, movefocus, d
bind = $mainMod, Tab, focuscurrentorlast
bind = $mainMod, grave, cyclenext
bind = $mainMod SHIFT, grave, cyclenext
# Workspace management.
bind = $mainMod CTRL, l, workspace, +1
bind = $mainMod CTRL, h, workspace, -1
bind = $mainMod, 0, workspace, empty
bind = $mainMod SHIFT, l, movetoworkspace, +1
bind = $mainMod SHIFT, h, movetoworkspace, -1
# Applications.
bind = $mainMod, Return, exec, wezterm

View File

@ -1,179 +0,0 @@
{ config, lib, pkgs, ... }:
let
cfg = config.workflows.workflows.mosey-branch;
workflowName = "mosey-branch";
createServiceScript = { runtimeInputs ? [ ], text, name }:
let
runtimeInputs' = runtimeInputs ++ [ pkgs.dbus ];
text' = ''
DESKTOP_AUTOSTART_ID="''${DESKTOP_AUTOSTART_ID:-}"
echo "$DESKTOP_AUTOSTART_ID"
test -n "$DESKTOP_AUTOSTART_ID" && {
dbus-send --print-reply --session \
--dest=org.gnome.SessionManager "/org/gnome/SessionManager" \
org.gnome.SessionManager.RegisterClient \
"string:${workflowName}" "string:$DESKTOP_AUTOSTART_ID"
}
${text}
'';
script = pkgs.writeShellApplication {
inherit name;
runtimeInputs = runtimeInputs';
text = text';
};
in
"${script}/bin/${name}";
customDesktopSession = pkgs.callPackage ./config/desktop-session {
serviceScript = createServiceScript {
name = "${workflowName}-service-script";
runtimeInputs = with pkgs; [ hyprland ];
text = ''
Hyprland --config ${./config/hyprland/hyprland.conf}
test -n "$DESKTOP_AUTOSTART_ID" && {
dbus-send --print-reply --session \
--dest=org.gnome.SessionManager "/org/gnome/SessionManager" \
org.gnome.SessionManager.Logout "uint32:1"
}
'';
};
agsScript = createServiceScript {
name = "${workflowName}-widgets";
runtimeInputs = with pkgs; [ ags ];
text = "ags";
};
polkitScript = createServiceScript {
name = "${workflowName}-authentication-agent";
text = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
};
};
requiredPackages = with pkgs; [
# The star of this show: the window manager (or Wayland compositor if you
# want to be a hair-pulling semantic bastard).
hyprland
# Setting up the widget system that will be used for notifications,
# bar and its widgets, and custom menus.
gjs
ags
gtk4-layer-shell
# Install with the custom desktop session files.
customDesktopSession
# Optional dependencies that are required in this workflow module.
socat
qt5.qtwayland
qt6.qtwayland
pciutils
# The authentication agent.
polkit_gnome
# The themes.
hicolor-icon-theme
# The chosen terminal emulator.
wezterm
];
in
{
options.workflows.workflows.mosey-branch = {
enable = lib.mkEnableOption "${workflowName}, foodogsquared's Hyprland-based desktop environment";
extraApps = lib.mkOption {
description = ''
Extra applications to be installed alongside the desktop environment.
'';
internal = true;
type = with lib.types; listOf package;
default = with pkgs; [
amberol # Simplest music player.
gradience # Gradually theme your shell with cadence.
blanket # Blanket yourself in ambient sounds.
eyedropper # Some nice eyedropper tool.
shortwave # Your internet radio.
flowtime # A nice timer for overworked students.
gnome-solanum # Cute little matador timer.
gnome-frog # Read them QR codes where it sends you to that one video everytime.
gnome.gnome-boxes # Virtual machines, son.
tangram # Make yourself a professional social media manager.
];
};
debug = lib.mkEnableOption "gnome-session debug messages";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = cfg.extraApps ++ requiredPackages;
# Install all of the required systemd units.
systemd.packages = with pkgs.gnome; [
customDesktopSession
gnome-session
];
# We'll have to include them for gnome-session to recognize it in NixOS
# systems.
environment.pathsToLink = [ "/share/gnome-session" ];
environment.sessionVariables.GNOME_SESSION_DEBUG = lib.mkIf cfg.debug "1";
# Our preferred display manager.
services.xserver = {
enable = true;
displayManager = {
gdm.enable = lib.mkDefault true;
sessionPackages = [ customDesktopSession ];
};
updateDbusEnvironment = true;
};
# Setting up some hardware settings.
hardware.opengl.enable = true;
hardware.bluetooth.enable = true;
services.udisks2.enable = true;
services.upower.enable = true;
services.power-profiles-daemon.enable = true;
services.colord.enable = true;
services.system-config-printer.enable = config.services.printing.enable;
# Setting up some more core services.
security.polkit.enable = true;
services.accounts-daemon.enable = true;
services.dleyna-renderer.enable = true;
services.dleyna-server.enable = true;
programs.dconf.enable = true;
programs.xwayland.enable = true;
fonts.enableDefaultPackages = true;
# The phone sync component which is handy.
programs.kdeconnect = {
enable = true;
package = pkgs.valent;
};
# Harmonious themes. Since we're making this very similar to GNOME
# appearance-wise, layout-wise, and setup-wise, we may as well make it
# similar.
qt = {
enable = true;
platformTheme = "gnome";
style = "adwaita";
};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk
];
};
};
}