init: public

This commit is contained in:
2025-04-13 15:09:14 +08:00
parent 5995c2050b
commit 50247d94e8
253 changed files with 12964 additions and 567 deletions

22
modules/desktop/all.nix Normal file
View File

@@ -0,0 +1,22 @@
{ config, lib, ... }:
lib.my.makeSwitch {
inherit config;
optionName = "all desktop things";
optionPath = [
"desktop"
"all"
];
config' = {
my.desktop = {
browser.all.enable = true;
gaming.all.enable = true;
media.all.enable = true;
notify.all.enable = true;
screencast.all.enable = true;
terminal.all.enable = true;
wm.all.enable = true;
style.enable = true;
quickshell.enable = true;
};
};
}

View File

@@ -0,0 +1,17 @@
{ config, lib, ... }:
lib.my.makeSwitch {
inherit config;
optionName = "all desktop browsers";
optionPath = [
"desktop"
"browser"
"all"
];
config' = {
my.desktop.browser = {
firefox.enable = true;
librewolf.enable = true;
chromium.enable = true;
};
};
}

View File

@@ -0,0 +1,54 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "chromium";
optionPath = [
"desktop"
"browser"
"chromium"
];
extraConfig = {
my.home.programs.chromium = {
package = pkgs.ungoogled-chromium;
extensions = [
{
id = "jokpcbcafcbkjgcbjdcbadhfhimkafab"; # BitWarden
}
{
id = "ipgcaebkhediiaeinmmaneoehfjpjkle"; # Dark Reader
}
{
id = "leehfofbonhkmfimcelojmjnccdfemhl"; # New Tab
}
{
id = "padekgcemlokbadohgkifijomclgjgif"; # SwitchyOmega
}
{
id = "bgnkhhnnamicmpeenaelnjfhikgbkllg"; # AdGuard
}
{
id = "ocaahdebbfolfmndjeplogmgcagdmblk"; # Web Store
}
{
id = "pinabllndpmfdcknifcfcmdgdngjcfii"; # Firefox Dark Theme
}
{
id = "bpoadfkcbjbfhfodiogcnhhhpibjhbnh"; # Immersive Translate
}
{
id = "fnaicdffflnofjppbagibeoednhnbjhg"; # Floccus Bookmarks Sync
}
];
commandLineArgs = [
"--ozone-platform=wayland"
"--enable-wayland-ime"
"--wayland-text-input-version=3"
];
};
};
}

View File

@@ -0,0 +1,9 @@
{ ... }:
{
imports = [
./all.nix
./firefox.nix
./librewolf.nix
./chromium.nix
];
}

View File

@@ -0,0 +1,15 @@
{ config, lib, ... }:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "firefox";
optionPath = [
"desktop"
"browser"
"firefox"
];
extraConfig = {
my.persist.homeDirs = [
".mozilla"
];
};
}

View File

@@ -0,0 +1,15 @@
{ config, lib, ... }:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "librewolf";
optionPath = [
"desktop"
"browser"
"librewolf"
];
extraConfig = {
my.persist.homeDirs = [
".librewolf"
];
};
}

View File

@@ -0,0 +1,15 @@
{ ... }:
{
imports = [
./all.nix
./browser
./gaming
./media
./notify
./screencast
./terminal
./wm
./style
./quickshell
];
}

View File

@@ -0,0 +1,16 @@
{ config, lib, ... }:
lib.my.makeSwitch {
inherit config;
optionName = "all desktop gaming things";
optionPath = [
"desktop"
"gaming"
"all"
];
config' = {
my.desktop.gaming = {
minecraft.enable = true;
steam.enable = true;
};
};
}

View File

@@ -0,0 +1,8 @@
{ ... }:
{
imports = [
./all.nix
./minecraft.nix
./steam.nix
];
}

View File

@@ -0,0 +1,27 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "minecraft";
optionPath = [
"desktop"
"gaming"
"minecraft"
];
config' = {
my.home.home.packages = with pkgs; [
hmcl
openjdk21
];
my.persist.homeDirs = [
".minecraft"
".local/share/hmcl"
];
};
}

View File

@@ -0,0 +1,24 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "steam";
optionPath = [
"desktop"
"gaming"
"steam"
];
config' = {
programs.steam = {
enable = true;
package = pkgs.steam;
extraPackages = with pkgs; [
gamescope
];
};
};
}

View File

@@ -0,0 +1,20 @@
{ config, lib, ... }:
lib.my.makeSwitch {
inherit config;
optionName = "all desktop media things";
optionPath = [
"desktop"
"media"
"all"
];
config' = {
my.desktop.media = {
mpv.enable = true;
shotwell.enable = true;
thunderbird.enable = true;
vlc.enable = true;
spotify.enable = true;
spotube.enable = true;
};
};
}

View File

@@ -0,0 +1,12 @@
{ ... }:
{
imports = [
./all.nix
./mpv.nix
./shotwell.nix
./thunderbird.nix
./vlc.nix
./spotify.nix
./spotube.nix
];
}

View File

@@ -0,0 +1,16 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "mpv";
packagePath = [ "mpv" ];
optionPath = [
"desktop"
"media"
"mpv"
];
}

View File

@@ -0,0 +1,16 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "shotwell";
packagePath = [ "shotwell" ];
optionPath = [
"desktop"
"media"
"shotwell"
];
}

View File

@@ -0,0 +1,16 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "spotify";
packagePath = [ "spotify" ];
optionPath = [
"desktop"
"media"
"spotify"
];
}

View File

@@ -0,0 +1,16 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "spotube";
packagePath = [ "spotube" ];
optionPath = [
"desktop"
"media"
"spotube"
];
}

View File

@@ -0,0 +1,21 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "thunderbird";
packagePath = [ "thunderbird" ];
optionPath = [
"desktop"
"media"
"thunderbird"
];
extraConfig = {
my.persist.homeDirs = [
".thunderbird"
];
};
}

View File

@@ -0,0 +1,16 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "vlc";
packagePath = [ "vlc" ];
optionPath = [
"desktop"
"media"
"vlc"
];
}

View File

@@ -0,0 +1,16 @@
{ config, lib, ... }:
lib.my.makeSwitch {
inherit config;
optionName = "all desktop notify tools";
optionPath = [
"desktop"
"notify"
"all"
];
config' = {
my.desktop.notify = {
dunst.enable = true;
swaync.enable = true;
};
};
}

View File

@@ -0,0 +1,8 @@
{ ... }:
{
imports = [
./all.nix
./dunst
./swaync
];
}

View File

@@ -0,0 +1,19 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "dunst";
packagePath = [ "dunst" ];
optionPath = [
"desktop"
"notify"
"dunst"
];
extraConfig = {
my.home.xdg.configFile."dunst/dunstrc".source = ./dunstrc;
};
}

View File

@@ -0,0 +1,459 @@
# See dunst(5) for all configuration options
[global]
### Display ###
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a window manager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern window managers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = mouse
### Geometry ###
# dynamic width from 0 to 300
# width = (0, 300)
# constant width of 300
width = 300
# The maximum height of a single notification, excluding the frame.
height = 300
# Position the notification in the top right corner
origin = top-right
# Offset from the origin
offset = 5x15
# Scale factor. It is auto-detected if value is 0.
scale = 0
# Maximum number of notification (0 means no limit)
notification_limit = 20
### Progress bar ###
# Turn on the progess bar. It appears when a progress hint is passed with
# for example dunstify -h int:value:12
progress_bar = true
# Set the progress bar height. This includes the frame, so make sure
# it's at least twice as big as the frame width.
progress_bar_height = 10
# Set the frame width of the progress bar
progress_bar_frame_width = 1
# Set the minimum width for the progress bar
progress_bar_min_width = 150
# Set the maximum width for the progress bar
progress_bar_max_width = 300
# Corner radius for the progress bar. 0 disables rounded corners.
progress_bar_corner_radius = 2
# Corner radius for the icon image.
icon_corner_radius = 0
# Show how many messages are currently hidden (because of
# notification_limit).
indicate_hidden = yes
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing window manager is
# present (e.g. xcompmgr, compiz, etc.). (X11 only)
transparency = 0
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
# If gap_size is greater than 0, this setting will be ignored.
separator_height = 2
# Padding between text and separator.
padding = 8
# Horizontal padding.
horizontal_padding = 8
# Padding between text and icon.
text_icon_padding = 0
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 3
# Defines color of the frame around the notification window.
frame_color = "#2A2C36"
# Size of gap to display between notifications - requires a compositor.
# If value is greater than 0, separator_height will be ignored and a border
# of size frame_width will be drawn around each notification instead.
# Click events on gaps do not currently propagate to applications below.
gap_size = 4
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = frame
# Sort messages by urgency.
sort = yes
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
# A client can set the 'transient' hint to bypass this. See the rules
# section for how to disable this if necessary
# idle_threshold = 120
### Text ###
font = JetBrains Mono 11
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
# Possible values are:
# full: Allow a small subset of html markup in notifications:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <https://docs.gtk.org/Pango/pango_markup.html>.
#
# strip: This setting is provided for compatibility with some broken
# clients that send markup even though it's not enabled on the
# server. Dunst will try to strip the markup but the parsing is
# simplistic so using this option outside of matching rules for
# specific applications *IS GREATLY DISCOURAGED*.
#
# no: Disable markup parsing, incoming notifications will be treated as
# plain text. Dunst will not advertise that it has the body-markup
# capability if this is set as a global setting.
#
# It's important to note that markup inside the format option will be parsed
# regardless of what this is set to.
markup = full
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# %n progress value if set without any extra characters
# %% Literal %
# Markup is allowed
format = "<b>%s</b>\n%b"
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# Vertical alignment of message text and icon.
# Possible values are "top", "center" and "bottom".
vertical_alignment = center
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Specify where to make an ellipsis in long lines.
# Possible values are "start", "middle" and "end".
ellipsize = middle
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Stack together notifications with the same content
stack_duplicates = true
# Hide the count of stacked notifications with the same content
hide_duplicate_count = false
# Display indicators for URLs (U) and actions (A).
show_indicators = false
### Icons ###
# Recursive icon lookup. You can set a single theme, instead of having to
# define all lookup paths.
enable_recursive_icon_lookup = true
# Set icon theme (only used for recursive icon lookup)
icon_theme = Win11, breeze
# You can also set multiple icon themes, with the leftmost one being used first.
# icon_theme = "Adwaita, breeze"
# Align icons left/right/top/off
icon_position = left
# Scale small icons up to this size, set to 0 to disable. Helpful
# for e.g. small files or high-dpi screens. In case of conflict,
# max_icon_size takes precedence over this.
min_icon_size = 32
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 32
# Paths to default icons (only neccesary when not using recursive icon lookup)
icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
### History ###
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 20
### Misc/Advanced ###
# dmenu path.
dmenu = /usr/bin/dmenu -p dunst:
# Browser for opening urls in context menu.
browser = /usr/bin/microsoft-edge-stable
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true
# Define the title of the windows spawned by dunst
title = Dunst
# Define the class of the windows spawned by dunst
class = Dunst
# Define the corner radius of the notification window
# in pixel size. If the radius is 0, you have no rounded
# corners.
# The radius will be automatically lowered if it exceeds half of the
# notification height to avoid clipping text and/or icons.
corner_radius = 10
# Ignore the dbus closeNotification message.
# Useful to enforce the timeout set by dunst configuration. Without this
# parameter, an application may close the notification sent before the
# user defined timeout.
ignore_dbusclose = false
### Wayland ###
# These settings are Wayland-specific. They have no effect when using X11
# Uncomment this if you want to let notications appear under fullscreen
# applications (default: overlay)
layer = top
# Set this to true to use X11 output on Wayland.
force_xwayland = false
### Legacy
# Use the Xinerama extension instead of RandR for multi-monitor support.
# This setting is provided for compatibility with older nVidia drivers that
# do not support RandR and using it on systems that support RandR is highly
# discouraged.
#
# By enabling this setting dunst will not be able to detect when a monitor
# is connected or disconnected which might break follow mode if the screen
# layout changes.
force_xinerama = false
### mouse
# Defines list of actions for each mouse event
# Possible values are:
# * none: Don't do anything.
# * do_action: Invoke the action determined by the action_name rule. If there is no
# such action, open the context menu.
# * open_url: If the notification has exactly one url, open it. If there are multiple
# ones, open the context menu.
# * close_current: Close current notification.
# * close_all: Close all notifications.
# * context: Open context menu for the notification.
# * context_all: Open context menu for all notifications.
# These values can be strung together for each mouse event, and
# will be executed in sequence.
mouse_left_click = do_action, close_current
mouse_middle_click = close_all
mouse_right_click = close_current
# Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases.
[experimental]
# Calculate the dpi to use on a per-monitor basis.
# If this setting is enabled the Xft.dpi value will be ignored and instead
# dunst will attempt to calculate an appropriate dpi value for each monitor
# using the resolution and physical size. This might be useful in setups
# where there are multiple screens with very different dpi values.
per_monitor_dpi = false
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#1E1E2E"
foreground = "#888888"
timeout = 10
# Icon for notifications with low urgency, uncomment to enable
#default_icon = /path/to/icon
[urgency_normal]
background = "#1E1E2E"
foreground = "#ffffff"
timeout = 10
# Icon for notifications with normal urgency, uncomment to enable
default_icon = /home/imxyy/Pictures/icon/notice.png
[urgency_critical]
background = "#1E1E2E"
foreground = "#CB2027"
#frame_color = "#94393E"
timeout = 0
# Icon for notifications with critical urgency, uncomment to enable
default_icon = /home/imxyy/Pictures/icon/critical.png
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
#
# Messages can be matched by
# appname (discouraged, see desktop_entry)
# body
# category
# desktop_entry
# icon
# match_transient
# msg_urgency
# stack_tag
# summary
#
# and you can override the
# background
# foreground
# format
# frame_color
# fullscreen
# new_icon
# set_stack_tag
# set_transient
# set_category
# timeout
# urgency
# icon_position
# skip_display
# history_ignore
# action_name
# word_wrap
# ellipsize
# alignment
# hide_text
#
# Shell-like globbing will get expanded.
#
# Instead of the appname filter, it's recommended to use the desktop_entry filter.
# GLib based applications export their desktop-entry name. In comparison to the appname,
# the desktop-entry won't get localized.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
# Disable the transient hint so that idle_threshold cannot be bypassed from the
# client
#[transient_disable]
# match_transient = yes
# set_transient = no
#
# Make the handling of transient notifications more strict by making them not
# be placed in history.
#[transient_history_ignore]
# match_transient = yes
# history_ignore = yes
# fullscreen values
# show: show the notifications, regardless if there is a fullscreen window opened
# delay: displays the new notification, if there is no fullscreen window active
# If the notification is already drawn, it won't get undrawn.
# pushback: same as delay, but when switching into fullscreen, the notification will get
# withdrawn from screen again and will get delayed like a new notification
#[fullscreen_delay_everything]
# fullscreen = delay
#[fullscreen_show_critical]
# msg_urgency = critical
# fullscreen = show
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# skip_display = true
#[history-ignore]
# # This notification will not be saved in history
# summary = "foobar"
# history_ignore = yes
#[skip-display]
# # This notification will not be displayed, but will be included in the history
# summary = "foobar"
# skip_display = yes
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
#[stack-volumes]
# appname = "some_volume_notifiers"
# set_stack_tag = "volume"
#
# vim: ft=cfg

View File

@@ -0,0 +1,62 @@
{
"$schema": "/etc/xdg/swaync/configSchema.json",
"positionX": "right",
"positionY": "top",
"control-center-positionX": "none",
"control-center-positionY": "none",
"control-center-margin-top": 8,
"control-center-margin-bottom": 8,
"control-center-margin-right": 8,
"control-center-margin-left": 8,
"control-center-height": 600,
"control-center-width": 400,
"fit-to-screen": false,
"layer": "top",
"control-center-layer": "top",
"cssPriority": "user",
"notification-icon-size": 40,
"notification-body-image-height": 100,
"notification-body-image-width": 200,
"notification-inline-replies": true,
"notification-2fa-action": false,
"timeout": 10,
"timeout-low": 5,
"timeout-critical": 0,
"notification-window-width": 317,
"keyboard-shortcuts": true,
"image-visibility": "when-available",
"transition-time": 200,
"hide-on-clear": false,
"hide-on-action": false,
"script-fail-notify": true,
"widgets": [
"inhibitors",
"title",
"dnd",
"mpris",
"notifications"
],
"widget-config": {
"inhibitors": {
"text": "Inhibitors",
"button-text": "Clear All",
"clear-all-button": true
},
"title": {
"text": "Notifications",
"clear-all-button": true,
"button-text": "Clear All"
},
"dnd": {
"text": "Do Not Disturb"
},
"label": {
"max-lines": 5,
"text": "Label Text"
},
"mpris": {
"image-size": 96,
"image-radius": 12
}
}
}

View File

@@ -0,0 +1,410 @@
/*
* vim: ft=less
*/
@define-color cc-bg rgba(42, 44, 54, 0.5);
@define-color noti-border-color rgba(255, 255, 255, 0.15);
@define-color noti-bg rgba(42, 44, 54, 0.6);
@define-color noti-bg-hover rgba(52, 54, 64, 0.6);
@define-color noti-bg-focus rgba(55, 57, 67, 0.4);
@define-color noti-close-bg rgba(255, 255, 255, 0.1);
@define-color noti-close-bg-hover rgba(255, 255, 255, 0.15);
@define-color text-color rgba(255, 255, 255, 0.6);
@define-color text-color-low rgba(136, 136, 136, 0.6);
@define-color mpris-album-art-overlay rgba(52, 54, 64, 0.6);
@define-color mpris-button-hover rgba(55, 57, 67, 0.4);
@define-color bg-selected rgb(0, 128, 255);
* {
font-family: monospace;
}
.low {
color: @text-color-low;
}
.normal {
color: @text-color;
}
.critical {
color: red;
}
.testing {
background-color: red;
}
.notification-row {
all: unset;
font-size: 11px;
transition: all 200ms ease;
outline: none;
margin-bottom: 4px;
border-radius: 12px;
}
.notification-row:hover {
background: transparent;
}
.control-center .notification-row:focus,
.control-center .notification-row:hover {
opacity: 1;
background: transparent;
}
.notification-row:focus .notification,
.notification-row:hover .notification {
/* box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.5); */
/* box-shadow: 0px 0px 0px 3px @bg-selected; */
box-shadow: none;
}
.control-center .notification {
box-shadow: none;
}
.control-center .notification-row {
opacity: 0.5;
}
.notification {
background: @noti-bg;
transition: all 200ms ease;
border-radius: 12px;
margin: 6px 6px;
box-shadow: none;
padding: 0;
}
.notification-content {
background: transparent;
padding: 6px;
border-radius: 12px;
}
.close-button {
background: @noti-close-bg;
color: @text-color;
text-shadow: none;
padding: 0;
border-radius: 100%;
margin-top: 10px;
margin-right: 10px;
box-shadow: none;
border: none;
min-width: 24px;
min-height: 24px;
}
.close-button:hover {
box-shadow: none;
background: @noti-close-bg-hover;
transition: all 0.15s ease-in-out;
border: none;
}
.notification-default-action,
.notification-action {
padding: 4px;
margin: 0;
box-shadow: none;
background: @noti-bg;
border: 0px;
color: white;
transition: all 200ms ease;
}
.notification-default-action:hover,
.notification-action:hover {
-gtk-icon-effect: none;
background: @noti-bg-hover;
}
.notification-default-action {
border-radius: 12px;
}
/* When alternative actions are visible */
.notification-default-action:not(:only-child) {
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}
.notification-action {
border-radius: 0px;
border-top: none;
border-right: none;
}
/* add bottom border radius to eliminate clipping */
.notification-action:first-child {
border-bottom-left-radius: 12px;
}
.notification-action:last-child {
border-bottom-right-radius: 12px;
border-right: 1px solid @noti-border-color;
}
.image {}
.body-image {
margin-top: 6px;
background-color: white;
border-radius: 12px;
}
.summary {
font-size: 16px;
font-weight: bold;
background: transparent;
color: @text-color;
text-shadow: none;
}
.time {
font-size: 16px;
font-weight: bold;
background: transparent;
color: @text-color;
text-shadow: none;
margin-right: 18px;
}
.body {
font-size: 15px;
font-weight: normal;
background: transparent;
color: @text-color;
text-shadow: none;
}
.control-center {
background: @cc-bg;
border-radius: 12px;
background-clip: border-box;
padding: 4px;
box-shadow: none;
}
.control-center-list {
background: transparent;
}
.control-center-list-placeholder {
opacity: 0.5;
}
.floating-notifications {
background: transparent;
}
/* Window behind control center and on all other monitors */
.blank-window {
background: transparent;
}
/*** Widgets ***/
/* Title widget */
.widget-title {
margin: 8px;
font-size: 1.5rem;
font-weight: bold;
color: @text-color;
}
.widget-title>button {
font-size: initial;
color: @text-color;
text-shadow: none;
background: @noti-bg;
border: 0px;
box-shadow: none;
border-radius: 12px;
}
.widget-title>button:hover {
background: @noti-bg-hover;
}
/* DND widget */
.widget-dnd {
margin: 8px;
font-size: 1.1rem;
color: @text-color;
}
.widget-dnd>switch {
font-size: initial;
border-radius: 12px;
background: @noti-bg;
border: 0px;
box-shadow: none;
}
.widget-dnd>switch:checked {
background: @text-color-low;
}
.widget-dnd>switch slider {
background: @noti-bg-hover;
border-radius: 12px;
}
/* Label widget */
.widget-label {
margin: 8px;
}
.widget-label>label {
font-size: 1.1rem;
}
/* Mpris widget */
.widget-mpris {
color: @text-color
}
.widget-mpris-player {
padding: 16px;
margin: 16px;
background-color: @mpris-album-art-overlay;
border-radius: 12px;
box-shadow: none;
}
.widget-mpris-album-art {
border-radius: 12px;
box-shadow: none;
}
.widget-mpris-player button {
/* The media player buttons (play, pause, next, etc...) */
color: @text-color;
/*background-color: @mpris-button-hover;*/
}
.widget-mpris-player button:disabled {
/* The media player buttons (play, pause, next, etc...) */
color: @text-color-low;
/*background-color: @mpris-button-hover;*/
}
.widget-mpris-player button:hover {
/* The media player buttons (play, pause, next, etc...) */
background-color: @mpris-button-hover;
/*background-color: @mpris-button-hover;*/
}
.widget-mpris>box>button {
color: @text-color;
}
.widget-mpris>box>button:disabled {
color: @text-color-low;
}
.widget-mpris-title {
font-weight: bold;
font-size: 1.25rem;
}
.widget-mpris-subtitle {
font-size: 1.1rem;
}
/* Buttons widget */
.widget-buttons-grid {
padding: 8px;
margin: 8px;
border-radius: 12px;
border: 0px;
background-color: @noti-bg;
}
.widget-buttons-grid>flowbox>flowboxchild>button {
color: @text-color;
background: @noti-bg;
border: 0px;
border-radius: 12px;
}
.widget-buttons-grid>flowbox>flowboxchild>button:hover {
background: @noti-bg-hover;
}
/* Menubar widget */
.widget-menubar>box>.menu-button-bar>button {
border: none;
background: transparent;
background: red;
}
/* .AnyName { Name defined in config after #
* background-color: @noti-bg;
* padding: 8px;
* margin: 8px;
* border-radius: 12px;
* }
*
* .AnyName>button {
* background: transparent;
* border: none;
* }
*
* .AnyName>button:hover {
* background-color: @noti-bg-hover;
* }
*/
.topbar-buttons>button {
/* Name defined in config after # */
border: none;
background: transparent;
background: blue;
}
/* Volume widget */
.widget-volume {
background-color: @noti-bg;
padding: 8px;
margin: 8px;
border-radius: 12px;
}
/* Backlight widget */
.widget-backlight {
background-color: @noti-bg;
padding: 8px;
margin: 8px;
border-radius: 12px;
}
/* Title widget */
.widget-inhibitors {
margin: 8px;
font-size: 1.5rem;
}
.widget-inhibitors>button {
font-size: initial;
color: white;
text-shadow: none;
background: @noti-bg;
border: 1px solid @noti-border-color;
box-shadow: none;
border-radius: 12px;
}
.widget-inhibitors>button:hover {
background: @noti-bg-hover;
}

View File

@@ -0,0 +1,29 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "swaync";
packagePath = [ "swaynotificationcenter" ];
optionPath = [
"desktop"
"notify"
"swaync"
];
extraConfig = {
my.home = {
programs.niri.settings.binds."Mod+End".action.spawn = [
"swaync-client"
"-t"
"-sw"
];
xdg.configFile."swaync" = {
source = ./config;
recursive = true;
};
};
};
}

View File

@@ -0,0 +1,48 @@
import Quickshell
import Quickshell.Services.UPower
import QtQuick
import QtQuick.Layouts
import org.kde.kirigami
Rectangle {
id: bat
Layout.preferredWidth: batIcon.width
Layout.fillHeight: true
color: 'transparent'
readonly property var battery: UPower.displayDevice
readonly property int percentage: Math.round(battery.percentage * 100)
property var size: height * 0.4
visible: battery.isLaptopBattery
Icon {
id: batIcon
anchors.centerIn: parent
implicitHeight: bat.size
implicitWidth: bat.size
// This recolors the entire svg, instead of only classless components.
// Hopefully in the future classes can be selected for recoloring.
isMask: true
color: 'white'
source: {
const nearestTen = Math.round(bat.percentage / 10) * 10;
const number = nearestTen.toString().padStart(2, "0");
let charging;
if (bat.battery.state == UPowerDeviceState.Charging) {
charging = "-charging";
} else if (bat.battery.state.toString() == UPowerDeviceState.FullyCharged) {
charging = "-charged";
} else {
charging = "";
}
return Quickshell.iconPath(`battery-level-${number}${charging}-symbolic`);
}
}
}

View File

@@ -0,0 +1,16 @@
import QtQuick
import QtQuick.Layouts
import "../../utils"
Rectangle {
Layout.fillHeight: true
color: "transparent"
implicitWidth: clockText.width
Text {
id: clockText
text: Time.time
color: Colors.fg
anchors.centerIn: parent
}
}

View File

@@ -0,0 +1,14 @@
import QtQuick
import QtQuick.Layouts
Rectangle {
Layout.fillHeight: true
color: "salmon"
implicitWidth: mprisText.width
Text {
id: mprisText
text: "Mpris"
anchors.centerIn: parent
}
}

View File

@@ -0,0 +1,54 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import "../../utils"
Rectangle {
id: resources
Layout.fillHeight: true
color: "transparent"
implicitWidth: rowLayout.width
property int valueSize: 8
property int textSize: 6
property string valueColor: "white"
property string textColor: "lightgray"
RowLayout {
id: rowLayout
anchors.centerIn: parent
ColumnLayout {
id: cpuColumn
Label {
color: textColor
font.pointSize: textSize
text: "CPU"
Layout.alignment: Qt.AlignCenter
}
Label {
color: valueColor
font.pointSize: valueSize
text: Resources.cpu_percent + "%"
Layout.alignment: Qt.AlignCenter
}
}
ColumnLayout {
Label {
color: textColor
font.pointSize: textSize
text: "MEM"
Layout.alignment: Qt.AlignCenter
}
Label {
color: valueColor
font.pointSize: valueSize
text: Resources.mem_percent + "%"
Layout.alignment: Qt.AlignCenter
}
}
}
}

View File

@@ -0,0 +1,5 @@
import QtQuick
Text {
renderType: Text.NativeRendering
}

View File

@@ -0,0 +1,14 @@
import QtQuick
import QtQuick.Layouts
Rectangle {
Layout.fillHeight: true
color: "lightblue"
implicitWidth: trayText.width
Text {
id: trayText
text: "Tray"
anchors.centerIn: parent
}
}

View File

@@ -0,0 +1,26 @@
import QtQuick
import QtQuick.Layouts
Rectangle {
id: ws
property bool hovered: false
Layout.preferredWidth: parent.height * 0.4
Layout.preferredHeight: parent.height * 0.4
Layout.alignment: Qt.AlignHCenter
radius: height / 2
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: () => {
ws.hovered = true;
}
onExited: () => {
ws.hovered = false;
}
onClicked: () => console.log(`workspace ?`)
}
}

View File

@@ -0,0 +1,55 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import "../../../utils"
import Quickshell.Hyprland
Rectangle {
id: workspaces
color: 'transparent'
width: workspacesRow.implicitWidth
Layout.fillHeight: true
RowLayout {
id: workspacesRow
height: parent.height
implicitWidth: (parent.height * 0.5 + spacing) * 2 - spacing
anchors.centerIn: parent
spacing: height / 7
Repeater {
id: repeater
model: HyprlandUtils.maxWorkspace
Workspace {
id: ws
required property int index
property HyprlandWorkspace currWorkspace: Hyprland.workspaces.values.find(e => e.id == index + 1) || null
property bool nonexistent: currWorkspace === null
property bool focused: index + 1 === Hyprland.focusedMonitor.activeWorkspace.id
Layout.preferredWidth: {
if (focused) {
return parent.height * 0.8;
} else {
return parent.height * 0.4;
}
}
color: {
if (nonexistent) {
return Colors.bgBlur;
} else {
return Colors.monitorColors[Hyprland.monitors.values.indexOf(Hyprland.workspaces.values.find(e => e.id === index + 1).monitor)];
}
}
}
}
}
}

View File

@@ -0,0 +1,6 @@
import "./windows"
import Quickshell // for ShellRoot and PanelWindow
ShellRoot {
Bar {}
}

View File

@@ -0,0 +1,9 @@
import Quickshell
pragma Singleton
Singleton {
property var bgBar: Qt.rgba(0, 0, 0, 0.21)
property var bgBlur: Qt.rgba(0, 0, 0, 0.3)
property var fg: "white"
property list<var> monitorColors: ["#e06c75", "#e5c07b", "#98c379", "#61afef"]
}

View File

@@ -0,0 +1,67 @@
pragma Singleton
import Quickshell
import Quickshell.Hyprland
import QtQuick
Singleton {
id: hyprland
property list<HyprlandWorkspace> workspaces: sortWorkspaces(Hyprland.workspaces.values)
property HyprlandWorkspace focusedWorkspace: Hyprland.focusedMonitor?.activeWorkspace
property int maxWorkspace: findMaxId()
function sortWorkspaces(ws) {
return [...ws].sort((a, b) => a?.id - b?.id);
}
function switchWorkspace(w: int): void {
console.log(`workspace: focus ${focusedWorkspace.id} -> ${w}`);
Hyprland.dispatch(`workspace ${w}`);
}
function findMaxId(): int {
let num = hyprland.workspaces.length;
return hyprland.workspaces[num - 1]?.id;
}
Connections {
target: Hyprland
function onRawEvent(event) {
// console.log("EVENT NAME", event.name);
// consow.wg("EVENT DATA", event.data);
let eventName = event.name;
switch (eventName) {
// Both of these are required in order to detect workspace changes
// even when switching monitors.
// case "workspacev2":
// {
// // hyprland.focusedWorkspace = Hyprland.focusedMonitor?.activeWorkspace;
// console.log(`workspace: ${hyprland.focusedWorkspace.id}`);
// console.log(`num workspaces ${hyprland.workspaces.length}`)
// console.log(`num workspaces (real) ${Hyprland.workspaces.values.length}`)
// break;
// }
// case "focusedmonv2":
// {
// // hyprland.focusedWorkspace = Hyprland.focusedMonitor?.activeWorkspace;
// console.log(`workspace: ${hyprland.focusedWorkspace.id}`);
// console.log(`num workspaces ${hyprland.workspaces.length}`)
// console.log(`num workspaces (real) ${Hyprland.workspaces.values.length}`)
// break;
// }
case "createworkspacev2":
{
hyprland.workspaces = hyprland.sortWorkspaces(Hyprland.workspaces.values);
hyprland.maxWorkspace = findMaxId();
}
case "destroyworkspacev2":
{
hyprland.workspaces = hyprland.sortWorkspaces(Hyprland.workspaces.values);
hyprland.maxWorkspace = findMaxId();
}
}
}
}
}

View File

@@ -0,0 +1,67 @@
pragma Singleton
import Quickshell
import Quickshell.Io
import QtQuick
Singleton {
property int cpu_percent
property string cpu_freq
property int mem_percent
property string mem_used
Process {
id: process_cpu_percent
running: true
command: ["sh", "-c", "top -bn1 | rg '%Cpu' | awk '{print 100-$8}'"]
stdout: SplitParser {
onRead: data => cpu_percent = Math.round(data)
}
}
Process {
id: process_cpu_freq
running: true
command: ["sh", "-c", "lscpu --parse=MHZ"]
stdout: SplitParser {
onRead: data => {
// delete the first 4 lines (comments)
const mhz = data.split("\n").slice(4);
// compute mean frequency
const freq = mhz.reduce((acc, e) => acc + Number(e), 0) / mhz.length;
cpu_freq = Math.round(freq) + " MHz";
}
}
}
Process {
id: process_mem_percent
running: true
command: ["sh", "-c", "free | awk 'NR==2{print $3/$2*100}'"]
stdout: SplitParser {
onRead: data => mem_percent = Math.round(data)
}
}
Process {
id: process_mem_used
running: true
command: ["sh", "-c", "free --si -h | awk 'NR==2{print $3}'"]
stdout: SplitParser {
onRead: data => mem_used = data
}
}
Timer {
interval: 2000
running: true
repeat: true
onTriggered: () => {
process_cpu_percent.running = true
process_cpu_freq.running = true
process_mem_percent.running = true
process_mem_used.running = true
}
}
}

View File

@@ -0,0 +1,29 @@
pragma Singleton
import Quickshell
import Quickshell.Io
import QtQuick
Singleton {
property var locale: Qt.locale()
function createDate(): string {
let date = new Date();
let hh = date.getHours().toString().padStart(2, 0);
let mm = date.getMinutes().toString().padStart(2, 0)
let weekday = locale.dayName(date.getDay(), Locale.ShortFormat)
let month = locale.monthName(date.getMonth(), Locale.ShortFormat)
let day = date.getDate()
return `${weekday} ${month} ${day} ${hh}:${mm}`
}
property var time: createDate()
Timer {
interval: 1000
running: true
repeat: true
onTriggered: time = createDate()
}
}

View File

@@ -0,0 +1,79 @@
//@ pragma NativeTextRendering
import Quickshell
import QtQuick
import QtQuick.Layouts
import "../utils"
import "../components/bar"
import "../components/bar/workspaces"
Scope {
PanelWindow {
id: barWindow
screen: Quickshell.screens[0]
anchors {
top: true
left: true
right: true
}
height: 32
color: "transparent"
Rectangle {
id: bar
anchors.fill: parent
color: Colors.bgBlur
// left
// RowLayout {
// id: barLeft
//
// anchors.bottom: parent.bottom
// anchors.left: parent.left
// anchors.top: parent.top
//
// anchors.leftMargin: height / 4
// anchors.rightMargin: height / 4
// spacing: height / 4
//
// Workspaces {}
// }
// middle
RowLayout {
id: barMiddle
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.leftMargin: height / 4
anchors.rightMargin: height / 4
spacing: height / 4
Mpris {}
}
// right
RowLayout {
id: barRight
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.top: parent.top
anchors.leftMargin: height / 4
anchors.rightMargin: height / 4
spacing: height / 4
Tray {}
Resources {}
Battery {}
Clock {}
}
}
}
}

View File

@@ -0,0 +1,29 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
default = false;
optionName = "quickshell";
optionPath = [
"desktop"
"quickshell"
];
config' = {
my.home = {
home.packages = [ pkgs.quickshell ];
home.sessionVariables.QML2_IMPORT_PATH = lib.concatStringsSep ":" [
"${pkgs.quickshell}/lib/qt-6/qml"
"${pkgs.kdePackages.qtdeclarative}/lib/qt-6/qml"
"${pkgs.kdePackages.kirigami.unwrapped}/lib/qt-6/qml"
];
xdg.configFile."quickshell" = {
source = ./config;
recursive = true;
};
};
};
}

View File

@@ -0,0 +1,15 @@
{ config, lib, ... }:
lib.my.makeSwitch {
inherit config;
optionName = "all screencast tools";
optionPath = [
"desktop"
"screencast"
"all"
];
config' = {
my.desktop.screencast = {
obs-studio.enable = true;
};
};
}

View File

@@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./all.nix
./obs-studio.nix
];
}

View File

@@ -0,0 +1,25 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "obs-studio";
optionPath = [
"desktop"
"screencast"
"obs-studio"
];
config' = {
my.home.home.packages = with pkgs; [
(pkgs.wrapOBS {
plugins = with pkgs.obs-studio-plugins; [
wlrobs
obs-backgroundremoval
];
})
];
};
}

View File

@@ -0,0 +1,73 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "style";
optionPath = [
"desktop"
"style"
];
config' = {
my.home = {
stylix = {
enable = true;
autoEnable = false;
base16Scheme = ./tokyonight-storm.yaml;
polarity = "dark";
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 24;
};
iconTheme = {
enable = true;
package = pkgs.win11-icon-theme;
dark = "Win11";
light = "Win11";
};
targets = {
nixos-icons.enable = false;
gnome-text-editor.enable = false;
};
};
# GTK
gtk = {
enable = true;
theme = {
package = pkgs.mono-gtk-theme;
name = "MonoThemeDark";
};
gtk2 = {
configLocation = "${config.my.home.xdg.configHome}/gtk-2.0/gtkrc";
};
gtk3 = {
extraConfig = {
gtk-decoration-layout = ":none";
gtk-application-prefer-dark-theme = 1;
};
};
gtk4 = {
extraConfig = {
gtk-decoration-layout = ":none";
gtk-application-prefer-dark-theme = 1;
};
};
};
#QT
qt = {
enable = true;
style.package = with pkgs; [
darkly-qt5
darkly-qt6
];
platformTheme.name = "qtct";
};
};
};
}

View File

@@ -0,0 +1,21 @@
system: "base16"
name: "Tokyo Night Storm"
author: "Michaël Ball"
variant: "dark"
palette:
base00: "#24283B"
base01: "#16161E"
base02: "#343A52"
base03: "#444B6A"
base04: "#787C99"
base05: "#A9B1D6"
base06: "#CBCCD1"
base07: "#D5D6DB"
base08: "#C0CAF5"
base09: "#A9B1D6"
base0A: "#0DB9D7"
base0B: "#9ECE6A"
base0C: "#B4F9F8"
base0D: "#2AC3DE"
base0E: "#BB9AF7"
base0F: "#F7768E"

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -0,0 +1,20 @@
{ config, lib, ... }:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "alacritty";
optionPath = [
"desktop"
"terminal"
"alacritty"
];
extraConfig = {
my.home.programs.alacritty.settings = {
general.import = [ ./tokyonight-storm.toml ];
cursor.style = {
shape = "Block";
blinking = "Never";
};
font.size = 14;
};
};
}

View File

@@ -0,0 +1,49 @@
# -----------------------------------------------------------------------------
# TokyoNight Alacritty Colors
# Theme: Tokyo Night Storm
# Upstream: https://github.com/folke/tokyonight.nvim/raw/main/extras/alacritty/tokyonight_storm.toml
# -----------------------------------------------------------------------------
# Default colors
[colors.primary]
background = '#24283b'
foreground = '#c0caf5'
[colors.cursor]
cursor = '#c0caf5'
text = '#24283b'
[colors.selection]
text = '#c0caf5'
background = '#2e3c64'
# Normal colors
[colors.normal]
black = '#1d202f'
red = '#f7768e'
green = '#9ece6a'
yellow = '#e0af68'
blue = '#7aa2f7'
magenta = '#bb9af7'
cyan = '#7dcfff'
white = '#a9b1d6'
# Bright colors
[colors.bright]
black = '#414868'
red = '#ff899d'
green = '#9fe044'
yellow = '#faba4a'
blue = '#8db0ff'
magenta = '#c7a9ff'
cyan = '#a4daff'
white = '#c0caf5'
# Indexed Colors
[[colors.indexed_colors]]
index = 16
color = '#ff9e64'
[[colors.indexed_colors]]
index = 17
color = '#db4b4b'

View File

@@ -0,0 +1,18 @@
{ config, lib, ... }:
lib.my.makeSwitch {
inherit config;
optionName = "all terminals";
optionPath = [
"desktop"
"terminal"
"all"
];
config' = {
my.desktop.terminal = {
alacritty.enable = true;
foot.enable = true;
kitty.enable = true;
ghostty.enable = true;
};
};
}

View File

@@ -0,0 +1,10 @@
{ ... }:
{
imports = [
./all.nix
./alacritty
./foot
./kitty
./ghostty
];
}

View File

@@ -0,0 +1,41 @@
{ config, lib, ... }:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "foot";
optionPath = [
"desktop"
"terminal"
"foot"
];
extraConfig = {
my.home.programs.foot = {
server.enable = true;
settings = {
main = {
font = "monospace:size=14";
initial-window-size-pixels = "800x600";
};
colors = {
background = "24283b";
foreground = "a9b1d6";
regular0 = "32344a";
regular1 = "f7768e";
regular2 = "9ece6a";
regular3 = "e0af68";
regular4 = "7aa2f7";
regular5 = "ad8ee6";
regular6 = "449dab";
regular7 = "9699a8";
bright0 = "444b6a";
bright1 = "ff7a93";
bright2 = "b9f27c";
bright3 = "ff9e64";
bright4 = "7da6ff";
bright5 = "bb9af7";
bright6 = "0db9d7";
bright7 = "acb0d0";
};
};
};
};
}

View File

@@ -0,0 +1,21 @@
{ config, lib, ... }:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "ghostty";
optionPath = [
"desktop"
"terminal"
"ghostty"
];
extraConfig = {
my.home.programs.ghostty = {
enableBashIntegration = true;
enableZshIntegration = true;
installBatSyntax = true;
settings = {
font-size = 14;
theme = "${./tokyonight-storm}";
};
};
};
}

View File

@@ -0,0 +1,22 @@
palette = 0=#1d202f
palette = 1=#f7768e
palette = 2=#9ece6a
palette = 3=#e0af68
palette = 4=#7aa2f7
palette = 5=#bb9af7
palette = 6=#7dcfff
palette = 7=#a9b1d6
palette = 8=#414868
palette = 9=#ff899d
palette = 10=#9fe044
palette = 11=#faba4a
palette = 12=#8db0ff
palette = 13=#c7a9ff
palette = 14=#a4daff
palette = 15=#c0caf5
background = #24283b
foreground = #c0caf5
cursor-color = #c0caf5
selection-background = #2e3c64
selection-foreground = #c0caf5

View File

@@ -0,0 +1,29 @@
{ config, lib, ... }:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "kitty";
optionPath = [
"desktop"
"terminal"
"kitty"
];
extraConfig = {
my.home.programs.kitty = {
settings = {
cursor_blink_interval = 0;
remember_window_size = "no";
initial_window_width = 800;
initial_window_height = 600;
enable_audio_bell = "no";
term = "xterm-256color";
};
font = {
name = "monospace";
size = 14;
};
extraConfig = ''
include ${./tokyonight-storm.conf}
'';
};
};
}

View File

@@ -0,0 +1,50 @@
# vim:ft=kitty
## name: Tokyo Night Storm
## license: MIT
## author: Folke Lemaitre
## upstream: https://github.com/folke/tokyonight.nvim/raw/main/extras/kitty/tokyonight_storm.conf
background #24283b
foreground #c0caf5
selection_background #2e3c64
selection_foreground #c0caf5
url_color #73daca
cursor #c0caf5
cursor_text_color #24283b
# Tabs
active_tab_background #7aa2f7
active_tab_foreground #1f2335
inactive_tab_background #292e42
inactive_tab_foreground #545c7e
#tab_bar_background #1d202f
# Windows
active_border_color #7aa2f7
inactive_border_color #292e42
# normal
color0 #1d202f
color1 #f7768e
color2 #9ece6a
color3 #e0af68
color4 #7aa2f7
color5 #bb9af7
color6 #7dcfff
color7 #a9b1d6
# bright
color8 #414868
color9 #ff899d
color10 #9fe044
color11 #faba4a
color12 #8db0ff
color13 #c7a9ff
color14 #a4daff
color15 #c0caf5
# extended colors
color16 #ff9e64
color17 #db4b4b

View File

@@ -0,0 +1,21 @@
{
config,
lib,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "all window managers";
optionPath = [
"desktop"
"wm"
"all"
];
config' = {
my.desktop.wm = {
cage.enable = true;
dwm.enable = true;
niri.enable = true;
};
};
}

View File

@@ -0,0 +1,16 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "cage";
packagePath = [ "cage" ];
optionPath = [
"desktop"
"wm"
"cage"
];
}

View File

@@ -0,0 +1,9 @@
{ ... }:
{
imports = [
./all.nix
./cage.nix
./dwm.nix
./niri
];
}

View File

@@ -0,0 +1,16 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "dwm";
packagePath = [ "dwm" ];
optionPath = [
"desktop"
"wm"
"dwm"
];
}

View File

@@ -0,0 +1,259 @@
{
config,
lib,
pkgs,
...
}:
{
my.home.systemd.user.services.swaync.Unit.After = [ "graphical-session.target" ];
my.home.programs.niri.settings = {
input = {
focus-follows-mouse = {
enable = true;
max-scroll-amount = "40%";
};
workspace-auto-back-and-forth = true;
};
layout = {
gaps = 23;
center-focused-column = "never";
always-center-single-column = true;
focus-ring.enable = false;
border = {
enable = true;
width = 4;
inactive.color = "#2e2e3eee";
active.gradient = {
from = "#6186d6ee";
to = "#cba6f7ee";
angle = 180;
relative-to = "workspace-view";
};
};
preset-column-widths = [
{ proportion = 0.33333; }
{ proportion = 0.4; }
{ proportion = 0.5; }
{ proportion = 0.6; }
{ proportion = 0.66667; }
];
default-column-width.proportion = 0.4;
};
animations = {
enable = true;
slowdown = 1.5;
workspace-switch.spring = {
damping-ratio = 1.0;
stiffness = 1000;
epsilon = 0.0001;
};
};
prefer-no-csd = true;
hotkey-overlay.skip-at-startup = true;
window-rules = [
{
geometry-corner-radius = {
bottom-left = 14.;
bottom-right = 14.;
top-left = 14.;
top-right = 14.;
};
clip-to-geometry = true;
draw-border-with-background = false;
}
{
matches = [ { app-id = "kitty|foot|Alacritty|ghostty|chromium-browser|wofi"; } ];
opacity = 0.8;
}
{
matches = [ { app-id = "org.gnome.Nautilus|nemo"; } ];
opacity = 0.6;
}
];
environment = {
QT_QPA_PLATFORM = "wayland;xcb";
XDG_SESSION_TYPE = "wayland";
XDG_CURRENT_DESKTOP = "niri";
XDG_SESSION_DESKTOP = "niri";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
STEAM_FORCE_DESKTOPUI_SCALING = "1.25";
DISPLAY = ":0";
};
spawn-at-startup = map (c: { command = c; }) [
[
"alacritty"
"--daemon"
]
[ "${lib.getExe pkgs.xwayland-satellite-unstable}" ]
[
"${lib.getExe pkgs.swaybg}"
"-i"
(toString ./wallpaper.png)
]
[
"${lib.getExe pkgs.wl-clip-persist}"
"--clipboard"
"regular"
]
[
"wl-paste"
"--type"
"text"
"--watch"
"cliphist"
"store"
]
[
"wl-paste"
"--type"
"image"
"--watch"
"cliphist"
"store"
]
];
binds =
with config.my.home.lib.niri.actions;
{
"Ctrl+Alt+T".action.spawn = [
"alacritty"
"msg"
"create-window"
];
"Mod+T".action.spawn = [
"alacritty"
"msg"
"create-window"
];
"Mod+Return".action.spawn = [
"alacritty"
"msg"
"create-window"
];
"Mod+G".action.spawn = [ "chromium" ];
"Mod+E".action.spawn = [ "nemo" ];
"Mod+R".action.spawn = [
"sh"
"-c"
"pkill wofi || wofi --color ~/.config/wal/colors"
];
"Mod+V".action.spawn = [
"sh"
"-c"
"pkill ${lib.getExe pkgs.wofi} || ${lib.getExe pkgs.cliphist} list | wofi --dmenu --color ~/.config/wal/colors | cliphist decode | wl-copy"
];
"XF86AudioRaiseVolume" = {
allow-when-locked = true;
action.spawn = [
"pamixer"
"-i"
"2"
];
};
"XF86AudioLowerVolume" = {
allow-when-locked = true;
action.spawn = [
"pamixer"
"-d"
"2"
];
};
"XF86AudioMute" = {
allow-when-locked = true;
action.spawn = [
"playerctl"
"-i"
"firefox,chromium"
"play-pause"
];
};
"Mod+XF86AudioRaiseVolume" = {
allow-when-locked = true;
action.spawn = [
"playerctl"
"-i"
"firefox,chromium"
"next"
];
};
"Mod+XF86AudioLowerVolume" = {
allow-when-locked = true;
action.spawn = [
"playerctl"
"-i"
"firefox,chromium"
"previous"
];
};
"Mod+Q".action = close-window;
"Mod+Left".action = focus-column-left;
"Mod+Right".action = focus-column-right;
"Mod+Up".action = focus-window-up;
"Mod+Down".action = focus-window-down;
"Mod+Ctrl+Left".action = move-column-left;
"Mod+Ctrl+Right".action = move-column-right;
"Mod+Ctrl+Up".action = move-window-up;
"Mod+Ctrl+Down".action = move-window-down;
"Mod+Shift+Left".action = focus-monitor-left;
"Mod+Shift+Right".action = focus-monitor-right;
"Mod+Shift+Up".action = focus-monitor-up;
"Mod+Shift+Down".action = focus-monitor-down;
"Mod+Shift+Ctrl+Left".action = move-column-to-monitor-left;
"Mod+Shift+Ctrl+Right".action = move-column-to-monitor-right;
"Mod+Shift+Ctrl+Up".action = move-column-to-monitor-up;
"Mod+Shift+Ctrl+Down".action = move-column-to-monitor-down;
"Mod+Page_Up".action = focus-workspace-up;
"Mod+Page_Down".action = focus-workspace-down;
"Mod+Ctrl+Page_Up".action = move-column-to-workspace-up;
"Mod+Ctrl+Page_Down".action = move-column-to-workspace-down;
"Mod+Shift+Page_Up".action = move-workspace-up;
"Mod+Shift+Page_Down".action = move-workspace-down;
"Mod+Comma".action = consume-window-into-column;
"Mod+Period".action = expel-window-from-column;
"Mod+L".action = switch-preset-column-width;
"Mod+Shift+L".action = reset-window-height;
"Mod+M".action = maximize-column;
"Mod+Shift+M".action = fullscreen-window;
"Mod+C".action = center-column;
"Mod+F".action = toggle-window-floating;
"Mod+H".action = expand-column-to-available-width;
"Mod+Minus".action.set-column-width = "-10%";
"Mod+Equal".action.set-column-width = "+10%";
"Mod+Shift+Minus".action.set-window-height = "-10%";
"Mod+Shift+Equal".action.set-window-height = "+10%";
"Ctrl+Alt+A".action = screenshot;
# "Print".action = screenshot-screen;
"Alt+Print".action = screenshot-window;
"Mod+Shift+E".action = quit;
}
// lib.attrsets.mergeAttrsList (
map (n: {
"Mod+${toString n}".action.focus-workspace = n;
"Mod+Shift+${toString n}".action.move-column-to-workspace = n;
}) (lib.range 0 9)
);
};
}

View File

@@ -0,0 +1,87 @@
args@{
lib,
config,
pkgs,
...
}:
let
cfg = config.my.desktop.wm.niri;
pkg = pkgs.niri-unstable;
in
{
options.my.desktop.wm.niri = {
enable = lib.mkEnableOption "Niri";
};
imports = [
(lib.mkIf cfg.enable (import ./config.nix args))
];
config = lib.mkIf cfg.enable {
xdg.portal = {
enable = true;
config = {
niri = {
default = [
"gnome"
"gtk"
];
"org.freedesktop.impl.portal.Access" = [ "gtk" ];
"org.freedesktop.impl.portal.FileChooser" = [ "gtk" ];
"org.freedesktop.impl.portal.Notification" = [ "gtk" ];
"org.freedesktop.impl.portal.RemoteDesktop" = [ "gnome" ];
"org.freedesktop.impl.portal.ScreenCast" = [ "gnome" ];
"org.freedesktop.impl.portal.Screenshot" = [ "gnome" ];
"org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ];
};
};
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
xdg-desktop-portal-gnome
];
};
programs.uwsm = {
enable = true;
waylandCompositors = {
niri = {
prettyName = "niri";
comment = "Niri compositor managed by UWSM";
binPath = pkgs.writeShellScript "niri-session" ''
${lib.getExe pkg} --session
'';
};
};
};
programs.niri = {
enable = true;
package = pkg;
};
my.home = {
home.packages = with pkgs; [
wlr-randr
wl-clipboard
wl-clip-persist
cliphist
swaynotificationcenter
nemo-with-extensions
];
programs.wofi.enable = true;
xdg.configFile."wofi" = {
source = ./wofi;
recursive = true;
};
xdg.configFile."wal" = {
source = ./wal;
recursive = true;
};
programs.waybar = {
enable = true;
systemd.enable = true;
};
xdg.configFile."waybar/config.jsonc".text = builtins.toJSON (import ./waybar/config.nix args);
xdg.configFile."waybar/style.css" = {
source = ./waybar/style.css;
};
};
};
}

View File

@@ -0,0 +1,6 @@
#1e1e2e
#262636
#d9e0ee
#89b4fa
#f38ba8
#cba6f7

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -0,0 +1,118 @@
{ ... }:
{
layer = "top";
position = "top";
mod = "dock";
exclusive = true;
passthrough = false;
gtk-layer-shell = true;
height = 0;
modules-left = [
"clock"
"cpu"
"memory"
"niri/workspaces"
];
modules-center = [
"mpris"
];
modules-right = [
"custom/notification"
"tray"
"pulseaudio"
"pulseaudio#microphone"
];
"niri/workspaces" = {
format = "{value}";
};
cpu = {
interval = 1;
format = "󰞱 {}%";
max-length = 10;
on-click = "";
};
memory = {
interval = 10;
format = " {used:0.1f}G";
max-length = 10;
};
"custom/notification" = {
tooltip = false;
format = "{icon}";
format-icons = {
notification = "<span foreground='red'><sup></sup></span>";
none = "";
dnd-notification = "<span foreground='red'><sup></sup></span>";
dnd-none = "";
inhibited-notification = "<span foreground='red'><sup></sup></span>";
inhibited-none = "";
dnd-inhibited-notification = "<span foreground='red'><sup></sup></span>";
dnd-inhibited-none = "";
};
return-type = "json";
exec-if = "which swaync-client";
exec = "swaync-client -swb";
on-double-click = "swaync-client -t -sw";
on-click-right = "swaync-client -d -sw";
escape = true;
};
tray = {
icon-size = 13;
tooltip = false;
spacing = 10;
};
mpris = {
player = "musicfox";
interval = 1;
format = "{status_icon} {artist} - {title}";
max-length = 60;
status-icons = {
paused = "";
playing = "";
stopped = "";
};
tooltip = false;
toottip-format = "{status_icon} Musicfox {artist} - {album} - {title}";
on-scroll-up = "playerctl -p musicfox volume 0.05+";
on-scroll-down = "playerctl -p musicfox volume 0.05-";
};
clock = {
format = " {:%H:%M %m.%d}";
tooltip = false;
};
pulseaudio = {
format = "{icon} {volume}%";
tooltip = false;
format-muted = "󰟎 Muted";
on-click = "pamixer -t";
on-click-middle = "pavucontrol & disown";
on-scroll-up = "pamixer -i 5";
on-scroll-down = "pamixer -d 5";
scroll-step = 5;
format-icons = {
headphone = "󰋋";
hands-free = "󰋋";
headset = "󰋋";
phone = "";
portable = "";
car = "";
default = [
""
""
""
];
};
};
"pulseaudio#microphone" = {
format = "{format_source}";
tooltip = false;
format-source = "󰍬 {volume}%";
format-source-muted = "󰍭 Muted";
on-click = "pamixer --default-source -t";
on-scroll-up = "pamixer --default-source -i 5";
on-scroll-down = "pamixer --default-source -d 5";
scroll-step = 5;
};
}

View File

@@ -0,0 +1,247 @@
* {
border: none;
border-radius: 0;
font-family: monospace;
font-weight: bold;
font-size: 14px;
min-height: 0;
}
window#waybar {
background: rgba(21, 18, 27, 0);
color: #cdd6f4;
}
tooltip {
color: #cdd6f4;
font-family: monospace;
background: #1e1e2e;
border-radius: 10px;
border-width: 2px;
border-style: solid;
border-color: #2a2c36;
}
tooltip label {
color: #cdd6f4;
}
tooltip.background {
background-clip: padding-box;
}
tooltip * {
padding: 4px;
background-color: transparent;
color: white;
}
#workspaces button {
padding: 5px;
color: #313244;
margin-right: 5px;
}
#workspaces button.focused {
color: #a6adc8;
border-radius: 10px;
}
#workspaces button.urgent {
color: #11111b;
background: #a6e3a1;
border-radius: 10px;
}
#workspaces button:hover {
background: #11111b;
color: #cdd6f4;
border-radius: 10px;
}
#taskbar button {
padding: 5px;
color: #313244;
margin-right: 5px;
}
#taskbar button.focused {
color: #a6adc8;
background: #eba0ac;
border-radius: 10px;
}
#taskbar button.urgent {
color: #11111b;
background: #a6e3a1;
border-radius: 10px;
}
#workspaces button:hover {
background: #11111b;
color: #cdd6f4;
border-radius: 10px;
}
#tray menu {
color: #cdd6f4;
font-family: monospace;
background: #1e1e2e;
border-radius: 10px;
border-width: 2px;
border-style: solid;
border-color: #2a2c36;
}
#custom-language,
#custom-updates,
#custom-caffeine,
#custom-weather,
#window,
#clock,
#battery,
#pulseaudio,
#network,
#workspaces,
#taskbar,
#tray,
#custom-notification,
#mpd,
#mpris,
#cpu,
#memory,
#backlight {
background: #1e1e2e;
padding: 0px 10px;
margin: 3px 0px;
margin-top: 10px;
border: 1px solid #181825;
}
#tray {
border-radius: 10px;
margin-right: 10px;
}
#workspaces {
background: #1e1e2e;
border-radius: 10px;
margin-left: 10px;
padding-right: 0px;
padding-left: 5px;
}
#taskbar {
background: #1e1e2e;
border-radius: 10px;
margin-left: 10px;
padding-right: 0px;
padding-left: 5px;
}
#custom-language {
color: #f38ba8;
border-left: 0px;
border-right: 0px;
}
#custom-updates {
color: #f5c2e7;
border-left: 0px;
border-right: 0px;
border-radius: 10px 0px 0px 10px;
}
#custom-notification {
color: #cdd6f4;
font-size: 20px;
border-radius: 10px;
margin-right: 10px;
}
#mpd {
color: rgba(97, 134, 214, 0.973);
background: #1e1e2e;
border-radius: 10px;
border: 1px solid #181825;
}
#mpris {
color: rgba(97, 134, 214, 0.973);
background: #1e1e2e;
border-radius: 10px;
border: 1px solid #181825;
margin-right: 10px;
}
#window {
border-radius: 10px;
margin-left: 60px;
margin-right: 60px;
}
#window.empty {
border-radius: 0px;
background-color: transparent;
}
window#waybar.empty #window {
padding: 0px;
margin: 0px;
border: 0px;
background-color: transparent;
}
#clock {
color: #fab387;
border-radius: 10px 0px 0px 10px;
margin-left: 5px;
border-right: 0px;
}
#network {
color: #f9e2af;
border-left: 0px;
border-right: 0px;
}
#cpu {
color: #fab387;
border-radius: 0;
border-left: 0;
border-right: 0;
}
#memory {
color: #fab387;
border-radius: 0px 10px 10px 0px;
border-left: 0;
border-right: 0;
}
#pulseaudio {
color: #89b4fa;
border-right: 0px;
border-radius: 10px 0px 0px 10px;
}
#pulseaudio.microphone {
color: #cba6f7;
margin-right: 5px;
border-left: 0px;
border-radius: 0 10px 10px 0;
}
#battery {
color: #a6e3a1;
border-radius: 0 10px 10px 0;
margin-right: 10px;
border-left: 0px;
}
#custom-weather {
border-radius: 0px 10px 10px 0px;
border-left: 0;
border-right: 0;
margin-left: 0px;
}

View File

@@ -0,0 +1,39 @@
## Wofi Config
## General
show=drun
prompt=Apps
normal_window=true
layer=top
term=kitty
## Geometry
width=500px
height=305px
location=0
orientation=vertical
halign=fill
line_wrap=off
dynamic_lines=false
## Images
allow_markup=true
allow_images=true
image_size=24
## Search
exec_search=false
hide_search=false
parse_search=false
insensitive=false
## Other
hide_scroll=true
no_actions=true
sort_order=default
gtk_dark=true
filter_rate=100
## Keys
key_expand=Tab
key_exit=Escape

View File

@@ -0,0 +1,64 @@
/*
* Copyright (C) 2020-2022 Aditya Shakya <adi1090x@gmail.com>
*/
/** ********** Fonts ********** **/
* {
font-family: monospace;
font-size: 12px;
}
#window {
background-color: --wofi-color0;
color: --wofi-color2;
border: 2px solid --wofi-color1;
border-radius: 0px;
}
#outer-box {
padding: 20px;
}
#input {
background-color: --wofi-color1;
border: 0px solid --wofi-color3;
padding: 8px 12px;
}
#scroll {
margin-top: 20px;
}
#inner-box {
}
#img {
padding-right: 8px;
}
#text {
color: --wofi-color2;
}
#text:selected {
color: --wofi-color0;
}
#entry {
padding: 6px;
}
#entry:selected {
background-color: --wofi-color3;
color: --wofi-color0;
}
#unselected {
}
#selected {
}
#input, #entry:selected {
border-radius: 4px;
}