Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Module Components

Clock and Workspaces module implementations.

Module Container

All modules use ModuleContainer.qml as a base - a pill-shaped container with consistent styling:

// ModuleContainer.qml
Rectangle {
    color: Config.Theme.moduleBackground
    radius: Config.Theme.moduleRadius
    // ...
}

Clock Module

Clock.qml displays time vertically with accent-colored text.

ModuleContainer {
    property color textColor: Config.Theme.accent

    ColumnLayout {
        Text {
            text: Qt.formatTime(new Date(), "HH")
            color: textColor
            font.family: Config.Theme.fontMono
        }
        Text {
            text: Qt.formatTime(new Date(), "mm")
            color: textColor
        }
    }

    Timer {
        interval: 1000
        running: true
        repeat: true
        onTriggered: // update time
    }
}

Key Points:

  • Uses Timer to update every second
  • Vertical layout with ColumnLayout
  • Monospace font for alignment

Workspaces Module

Workspaces.qml shows Hyprland workspace indicators.

ModuleContainer {
    required property ShellScreen screen

    readonly property int activeWsId:
        Services.Hyprland.activeWsIdForMonitor(screen)

    ColumnLayout {
        Repeater {
            model: wsCount

            Rectangle {
                readonly property bool isActive: wsId === activeWsId
                readonly property bool isOccupied:
                    Services.Hyprland.workspaceHasWindows(wsId)

                width: 8
                height: isActive ? 24 : 8
                radius: Config.Theme.radius.full

                color: isActive ? Config.Theme.accent
                     : isOccupied ? Config.Theme.foregroundDim
                     : Config.Theme.overlay
            }
        }
    }
}

Visual States:

StateSizeColor
Active8x24Accent
Occupied8x8Dim foreground
Empty8x8Overlay

Hyprland Integration:

  • activeWsIdForMonitor(screen) - Gets active workspace per monitor
  • workspaceHasWindows(wsId) - Checks if workspace has windows

Adding New Modules

See Adding Modules for a step-by-step guide.

Files

  • /fern/modules/Clock.qml
  • /fern/modules/Workspaces.qml
  • /fern/components/ModuleContainer.qml
  • /fern/services/Hyprland.qml