feat: rename to sims
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,2 +1,2 @@
|
|||||||
run:
|
run:
|
||||||
python -m bar.main --config ./example-stylix-dev.yaml
|
python -m sims.main --config ./example-stylix-dev.yaml
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
height: 42
|
height: 42
|
||||||
dev: true
|
dev: true
|
||||||
window_title:
|
window_title:
|
||||||
enable: false
|
enable: true
|
||||||
vinyl:
|
vinyl:
|
||||||
enable: false
|
enable: true
|
||||||
battery:
|
battery:
|
||||||
enable: true
|
enable: true
|
||||||
calendar:
|
calendar:
|
||||||
|
|||||||
35
flake.nix
35
flake.nix
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
description = "Fabric Bar Example";
|
description = "sims status bar (companion to fenster WM).";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/24.11";
|
nixpkgs.url = "github:NixOS/nixpkgs/24.11";
|
||||||
@@ -34,22 +34,21 @@
|
|||||||
devShells.default = pkgs.callPackage ./nix/shell.nix { inherit pkgs; };
|
devShells.default = pkgs.callPackage ./nix/shell.nix { inherit pkgs; };
|
||||||
packages = {
|
packages = {
|
||||||
default = pkgs.callPackage ./nix/derivation.nix { inherit (pkgs) lib python3Packages; };
|
default = pkgs.callPackage ./nix/derivation.nix { inherit (pkgs) lib python3Packages; };
|
||||||
makku = pkgs.writeShellScriptBin "makku" ''
|
sims-cli = pkgs.writeShellApplication {
|
||||||
dbus-send --session --print-reply --dest=org.Fabric.fabric.bar /org/Fabric/fabric org.Fabric.fabric.Evaluate string:"finder.show()" > /dev/null 2>&1
|
name = "sims-cli";
|
||||||
'';
|
runtimeInputs = [ pkgs.dbus ];
|
||||||
notmuch-refresh = pkgs.writeShellScriptBin "notmuch-refresh" ''
|
text = builtins.readFile ./scripts/sims-cli.sh;
|
||||||
dbus-send --session --print-reply --dest=org.Fabric.fabric.bar /org/Fabric/fabric org.Fabric.fabric.Evaluate string:"notmuch_widget.service.update_unread_count() if notmuch_widget else None" > /dev/null 2>&1
|
};
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
apps.default = {
|
apps.default = {
|
||||||
type = "app";
|
type = "app";
|
||||||
program = "${self.packages.${system}.default}/bin/bar";
|
program = "${self.packages.${system}.default}/bin/sims";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
// {
|
// {
|
||||||
homeManagerModules = {
|
homeManagerModules = {
|
||||||
makku-bar =
|
sims =
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
@@ -57,18 +56,18 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.services.makku-bar;
|
cfg = config.services.sims;
|
||||||
|
|
||||||
settingsFormat = pkgs.formats.yaml { };
|
settingsFormat = pkgs.formats.yaml { };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.services.makku-bar = {
|
options.services.sims = {
|
||||||
enable = lib.mkEnableOption "makku-bar status bar";
|
enable = lib.mkEnableOption "sims status bar";
|
||||||
|
|
||||||
package = lib.mkOption {
|
package = lib.mkOption {
|
||||||
type = lib.types.package;
|
type = lib.types.package;
|
||||||
default = self.packages.${pkgs.system}.default;
|
default = self.packages.${pkgs.system}.default;
|
||||||
description = "The makku-bar package to use.";
|
description = "The sims package to use.";
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = lib.mkOption {
|
settings = lib.mkOption {
|
||||||
@@ -159,19 +158,19 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.services.makku-bar.enable {
|
config = lib.mkIf config.services.sims.enable {
|
||||||
systemd.user.services.makku-bar =
|
systemd.user.services.sims =
|
||||||
let
|
let
|
||||||
configFile = settingsFormat.generate "config.yaml" cfg.settings;
|
configFile = settingsFormat.generate "config.yaml" cfg.settings;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Makku Status Bar";
|
Description = "sims status bar";
|
||||||
After = [ "graphical-session.target" ];
|
After = [ "graphical-session.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${config.services.makku-bar.package}/bin/bar --config ${configFile}";
|
ExecStart = "${config.services.sims.package}/bin/sims --config ${configFile}";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -181,7 +180,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
stylix-makku-bar = import ./nix/stylix/hm.nix;
|
stylix-sims = import ./nix/stylix/hm.nix;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
python3Packages.buildPythonApplication {
|
python3Packages.buildPythonApplication {
|
||||||
pname = "fabric-nix-example";
|
pname = "sims";
|
||||||
version = "0.0.1";
|
version = "0.0.1";
|
||||||
pyproject = true;
|
pyproject = true;
|
||||||
|
|
||||||
@@ -58,12 +58,12 @@ python3Packages.buildPythonApplication {
|
|||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
mkdir -p $out/${python3Packages.python.sitePackages}
|
mkdir -p $out/${python3Packages.python.sitePackages}
|
||||||
cp -r bar $out/${python3Packages.python.sitePackages}/
|
cp -r sims $out/${python3Packages.python.sitePackages}/
|
||||||
|
|
||||||
# If you have any scripts to install
|
# If you have any scripts to install
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
cp scripts/launcher.py $out/bin/bar
|
cp scripts/launcher.py $out/bin/sims
|
||||||
chmod +x $out/bin/bar
|
chmod +x $out/bin/sims
|
||||||
|
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
@@ -81,7 +81,7 @@ python3Packages.buildPythonApplication {
|
|||||||
meta = {
|
meta = {
|
||||||
changelog = "";
|
changelog = "";
|
||||||
description = ''
|
description = ''
|
||||||
Fabrix Bar Example
|
sims status bar (companion to fenster WM).
|
||||||
'';
|
'';
|
||||||
homepage = "https://github.com/wholikeel/fabric";
|
homepage = "https://github.com/wholikeel/fabric";
|
||||||
license = lib.licenses.agpl3Only;
|
license = lib.licenses.agpl3Only;
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.stylix.targets.makku-bar;
|
cfg = config.stylix.targets.sims;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.stylix.targets.makku-bar.enable =
|
options.stylix.targets.sims.enable =
|
||||||
config.lib.stylix.mkEnableTarget "Makku Bar" true;
|
config.lib.stylix.mkEnableTarget "sims" true;
|
||||||
|
|
||||||
config = lib.mkIf (config.stylix.enable && cfg.enable) {
|
config = lib.mkIf (config.stylix.enable && cfg.enable) {
|
||||||
services.makku-bar.settings.stylix = {
|
services.sims.settings.stylix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
colors = {
|
colors = {
|
||||||
base00 = config.lib.stylix.colors.base00; # background
|
base00 = config.lib.stylix.colors.base00; # background
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ requires = ["setuptools>=61.0"]
|
|||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "fabric-nix-example"
|
name = "sims"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
requires-python = ">= 3.11"
|
requires-python = ">= 3.11"
|
||||||
authors = [
|
authors = [
|
||||||
]
|
]
|
||||||
maintainers = [
|
maintainers = [
|
||||||
]
|
]
|
||||||
description = "Fabric using Nix example."
|
description = "sims status bar (companion to fenster WM)."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = {file = "LICENSE"}
|
license = {file = "LICENSE"}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ if site_packages_dir not in sys.path:
|
|||||||
sys.path.insert(0, site_packages_dir)
|
sys.path.insert(0, site_packages_dir)
|
||||||
|
|
||||||
|
|
||||||
from bar.main import *
|
from sims.main import *
|
||||||
|
|
||||||
sys.argv[0] = os.path.join(script_dir, os.path.basename(__file__))
|
sys.argv[0] = os.path.join(script_dir, os.path.basename(__file__))
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from platformdirs import user_config_dir
|
|||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
|
|
||||||
APP_NAME = "makku_bar"
|
APP_NAME = "sims"
|
||||||
|
|
||||||
XDG_CONFIG_HOME = user_config_dir(appname=APP_NAME)
|
XDG_CONFIG_HOME = user_config_dir(appname=APP_NAME)
|
||||||
XDG_CONFIG_FILE = os.path.join(XDG_CONFIG_HOME, "config.yaml")
|
XDG_CONFIG_FILE = os.path.join(XDG_CONFIG_HOME, "config.yaml")
|
||||||
@@ -32,7 +32,7 @@ def load_config(config_path=XDG_CONFIG_FILE):
|
|||||||
|
|
||||||
|
|
||||||
def load_args():
|
def load_args():
|
||||||
parser = argparse.ArgumentParser(description="makku_bar")
|
parser = argparse.ArgumentParser(description="sims")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-c",
|
"-c",
|
||||||
"--config",
|
"--config",
|
||||||
@@ -34,7 +34,7 @@ finder = FuzzyWindowFinder()
|
|||||||
bar_windows = []
|
bar_windows = []
|
||||||
notmuch_widget = None
|
notmuch_widget = None
|
||||||
|
|
||||||
app = Application("bar", dummy, finder)
|
app = Application("sims", dummy, finder)
|
||||||
|
|
||||||
# Load CSS - use Stylix if enabled, otherwise use default
|
# Load CSS - use Stylix if enabled, otherwise use default
|
||||||
if STYLIX.get("enable", False):
|
if STYLIX.get("enable", False):
|
||||||
@@ -5,20 +5,20 @@ from fabric.widgets.image import Image
|
|||||||
from fabric.widgets.overlay import Overlay
|
from fabric.widgets.overlay import Overlay
|
||||||
from fabric.widgets.datetime import DateTime
|
from fabric.widgets.datetime import DateTime
|
||||||
from fabric.widgets.centerbox import CenterBox
|
from fabric.widgets.centerbox import CenterBox
|
||||||
from bar.modules.player import Player
|
from sims.modules.player import Player
|
||||||
from bar.modules.vinyl import VinylButton
|
from sims.modules.vinyl import VinylButton
|
||||||
from bar.modules.quick_menu import QuickMenuOpener
|
from sims.modules.quick_menu import QuickMenuOpener
|
||||||
from bar.modules.battery import Battery
|
from sims.modules.battery import Battery
|
||||||
from bar.modules.calendar import CalendarService, CalendarPopup
|
from sims.modules.calendar import CalendarService, CalendarPopup
|
||||||
from bar.modules.notmuch import NotmuchWidget
|
from sims.modules.notmuch import NotmuchWidget
|
||||||
from fabric.widgets.wayland import WaylandWindow as Window
|
from fabric.widgets.wayland import WaylandWindow as Window
|
||||||
from fabric.system_tray.widgets import SystemTray
|
from fabric.system_tray.widgets import SystemTray
|
||||||
from bar.widgets.fenster import FensterWorkspaces, FensterWorkspaceButton, FensterActiveWindow
|
from sims.widgets.fenster import FensterWorkspaces, FensterWorkspaceButton, FensterActiveWindow
|
||||||
from bar.services.fenster import get_i3_connection
|
from sims.services.fenster import get_i3_connection
|
||||||
from fabric.widgets.circularprogressbar import CircularProgressBar
|
from fabric.widgets.circularprogressbar import CircularProgressBar
|
||||||
from bar.services.system_stats import SystemStatsService
|
from sims.services.system_stats import SystemStatsService
|
||||||
|
|
||||||
from bar.config import VINYL, BATTERY, BAR_HEIGHT, WINDOW_TITLE, NOTMUCH
|
from sims.config import VINYL, BATTERY, BAR_HEIGHT, WINDOW_TITLE, NOTMUCH
|
||||||
|
|
||||||
|
|
||||||
class StatusBar(Window):
|
class StatusBar(Window):
|
||||||
@@ -29,7 +29,7 @@ class StatusBar(Window):
|
|||||||
monitor: int = 1,
|
monitor: int = 1,
|
||||||
):
|
):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
name="bar",
|
name="sims",
|
||||||
layer="top",
|
layer="top",
|
||||||
anchor="left top right",
|
anchor="left top right",
|
||||||
margin="0px 0px -2px 0px",
|
margin="0px 0px -2px 0px",
|
||||||
@@ -130,7 +130,7 @@ class StatusBar(Window):
|
|||||||
center_children.append(self.active_window)
|
center_children.append(self.active_window)
|
||||||
|
|
||||||
self.children = CenterBox(
|
self.children = CenterBox(
|
||||||
name="bar-inner",
|
name="sims-inner",
|
||||||
start_children=Box(
|
start_children=Box(
|
||||||
name="start-container",
|
name="start-container",
|
||||||
spacing=6,
|
spacing=6,
|
||||||
@@ -2,7 +2,7 @@ from gi.repository import GLib
|
|||||||
from fabric.widgets.box import Box
|
from fabric.widgets.box import Box
|
||||||
from fabric.widgets.label import Label
|
from fabric.widgets.label import Label
|
||||||
from fabric.widgets.image import Image
|
from fabric.widgets.image import Image
|
||||||
from bar.services.battery import BatteryService
|
from sims.services.battery import BatteryService
|
||||||
|
|
||||||
|
|
||||||
class Battery(Box):
|
class Battery(Box):
|
||||||
@@ -12,7 +12,7 @@ from fabric.widgets.button import Button
|
|||||||
from fabric.widgets.image import Image
|
from fabric.widgets.image import Image
|
||||||
from fabric.widgets.wayland import WaylandWindow as Window
|
from fabric.widgets.wayland import WaylandWindow as Window
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
from bar.config import CALENDAR
|
from sims.config import CALENDAR
|
||||||
|
|
||||||
# Try to import khal as a Python library
|
# Try to import khal as a Python library
|
||||||
try:
|
try:
|
||||||
@@ -9,7 +9,7 @@ from fabric.widgets.label import Label
|
|||||||
from fabric.widgets.button import Button
|
from fabric.widgets.button import Button
|
||||||
from fabric.widgets.image import Image
|
from fabric.widgets.image import Image
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
from bar.config import NOTMUCH
|
from sims.config import NOTMUCH
|
||||||
|
|
||||||
|
|
||||||
class NotmuchService:
|
class NotmuchService:
|
||||||
@@ -11,11 +11,11 @@ from fabric.widgets.circularprogressbar import CircularProgressBar
|
|||||||
from fabric.widgets.overlay import Overlay
|
from fabric.widgets.overlay import Overlay
|
||||||
from fabric.widgets.stack import Stack
|
from fabric.widgets.stack import Stack
|
||||||
from ..widgets.circle_image import CircleImage
|
from ..widgets.circle_image import CircleImage
|
||||||
import bar.modules.icons as icons
|
import sims.modules.icons as icons
|
||||||
from bar.services.mpris import MprisPlayerManager, MprisPlayer
|
from sims.services.mpris import MprisPlayerManager, MprisPlayer
|
||||||
from fabric import Fabricator
|
from fabric import Fabricator
|
||||||
|
|
||||||
# from bar.modules.cavalcade import SpectrumRender
|
# from sims.modules.cavalcade import SpectrumRender
|
||||||
|
|
||||||
|
|
||||||
def get_player_progress(fabricator, mpris_player):
|
def get_player_progress(fabricator, mpris_player):
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
from bar.config import STYLIX
|
from sims.config import STYLIX
|
||||||
import tempfile
|
import tempfile
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ def generate_stylix_css():
|
|||||||
}}
|
}}
|
||||||
|
|
||||||
/* Bar styling */
|
/* Bar styling */
|
||||||
#bar-inner {{
|
#sims-inner {{
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
border-bottom: solid 2px;
|
border-bottom: solid 2px;
|
||||||
border-color: #{colors["base02"]};
|
border-color: #{colors["base02"]};
|
||||||
@@ -4,7 +4,7 @@ from fabric.widgets.box import Box
|
|||||||
from fabric.widgets.label import Label
|
from fabric.widgets.label import Label
|
||||||
from fabric.widgets.entry import Entry
|
from fabric.widgets.entry import Entry
|
||||||
from gi.repository import Gdk
|
from gi.repository import Gdk
|
||||||
from bar.services.fenster import get_i3_connection
|
from sims.services.fenster import get_i3_connection
|
||||||
|
|
||||||
|
|
||||||
class FuzzyWindowFinder(Window):
|
class FuzzyWindowFinder(Window):
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#bar-inner {
|
#sims-inner {
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
border-bottom: solid 2px;
|
border-bottom: solid 2px;
|
||||||
border-color: var(--border-color);
|
border-color: var(--border-color);
|
||||||
@@ -9,7 +9,7 @@ from fabric.utils.helpers import bulk_connect
|
|||||||
from fabric.widgets.box import Box
|
from fabric.widgets.box import Box
|
||||||
from fabric.widgets.button import Button
|
from fabric.widgets.button import Button
|
||||||
from fabric.widgets.label import Label
|
from fabric.widgets.label import Label
|
||||||
from bar.services.fenster import get_i3_connection
|
from sims.services.fenster import get_i3_connection
|
||||||
|
|
||||||
|
|
||||||
class FensterWorkspaceButton(Button):
|
class FensterWorkspaceButton(Button):
|
||||||
Reference in New Issue
Block a user