1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 23:00:39 +02:00

feat: add rofi theme

This commit is contained in:
oddlama 2024-06-11 13:14:36 +02:00
parent 98f228fca7
commit e693ed5d3d
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
7 changed files with 130 additions and 191 deletions

View file

@ -20,7 +20,7 @@
icon = pkgs.fetchurl {
url = "https://web.poecdn.com/image/Art/2DItems/Currency/TransferOrb.png";
hash = "sha256-LP6qB68GLq5dstsUxXC/uj0afceQRPYoymgCDU/5l6k=";
hash = "sha256-K6cG5ybC3uIveu/4JIcc5mGQFgDlQSw8L9aSzbkLe1w=";
};
in
pkgs.appimageTools.wrapType2 {

View file

@ -14,11 +14,10 @@
./signal.nix
./theme.nix
./thunderbird.nix
# XXX: disabled for the time being because gaming under nvidia+wayland has too many bugs
# XXX: retest this in the future. Problems were flickering under gles, black screens and refresh issues under vulkan, black wine windows.
# ./sway.nix
./i3.nix
./rofi.nix
./hyprland.nix
./waybar.nix
]
++ lib.optionals nixosConfig.graphical.gaming.enable [
./games

View file

@ -9,11 +9,12 @@
concatMap
elem
flip
getExe
mkIf
mkMerge
optionals
;
rofi-drun = "rofi -show drun -theme ~/.config/rofi/launchers/type-1/style-10.rasi";
in {
home.packages = with pkgs; [
wl-clipboard
@ -47,8 +48,8 @@ in {
"SUPER + CTRL + SHIFT,q,exit"
# Applications
"SUPER,code:49,exec,${getExe pkgs.rofi-wayland} -show drun" # SUPER+^
",Menu,exec,${getExe pkgs.rofi-wayland} -show drun"
"SUPER,code:49,exec,${rofi-drun}" # SUPER+^
",Menu,exec,${rofi-drun}"
"SUPER,t,exec,kitty"
"SUPER,b,exec,firefox"

View file

@ -0,0 +1,33 @@
{pkgs, ...}: {
programs.rofi = {
enable = true;
package = pkgs.rofi-wayland;
extraConfig = {
matching = "fuzzy";
terminal = "kitty";
};
};
home.file = let
rofi-themes = pkgs.fetchFromGitHub {
owner = "adi1090x";
repo = "rofi";
rev = "3a28753b0a8fb666f4bd0394ac4b0e785577afa2";
hash = "sha256-G3sAyIZbq1sOJxf+NBlXMOtTMiBCn6Sat8PHryxRS0w=";
};
in {
".config/rofi/colors" = {
source = "${rofi-themes}/files/colors";
recursive = true;
};
".config/rofi/launchers/type-1/style-10.rasi".source = "${rofi-themes}/files/launchers/type-1/style-10.rasi";
".config/rofi/launchers/type-1/shared/colors.rasi".text =
/*
css
*/
''
@import "~/.config/rofi/colors/onedark.rasi"
'';
".config/rofi/launchers/type-1/shared/fonts.rasi".text = "";
};
}

View file

@ -1,184 +0,0 @@
{
lib,
config,
nixosConfig,
pkgs,
...
}: let
inherit
(lib)
mapAttrs'
nameValuePair
;
bindWithModifier = mapAttrs' (k: nameValuePair (cfg.modifier + "+" + k));
cfg = config.wayland.windowManager.sway.config;
in {
wayland.windowManager.sway = {
enable = true;
config =
{
modifier = "Mod4";
terminal = "kitty";
# Excuse me, le füque
focus.followMouse = false;
focus.mouseWarping = false;
# TODO menu = "rofi -show run";
keybindings =
{
"XF86AudioRaiseVolume" = "exec --no-startup-id wpctl set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" = "exec --no-startup-id wpctl set-sink-volume @DEFAULT_SINK@ -5%";
"XF86AudioMute" = "exec --no-startup-id wpctl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" = "exec --no-startup-id wpctl set-source-mute @DEFAULT_SOURCE@ toggle";
#"Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
#"${mod}+Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot save area";
}
# // optionalAttrs useBacklight {
# "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5";
# "XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 5";
# }
// {
"Menu" = "exec ${cfg.menu}";
}
# General mappings that start with $modifier+...
// bindWithModifier {
"t" = "exec ${cfg.terminal}";
"asciicircum" = "exec ${cfg.menu}";
"b" = "exec firefox";
"Shift+r" = "reload";
"q" = "kill";
"Left" = "focus left";
"Right" = "focus right";
"Up" = "focus up";
"Down" = "focus down";
"Shift+Left" = "move left";
"Shift+Right" = "move right";
"Shift+Up" = "move up";
"Shift+Down" = "move down";
"s" = "splith";
"v" = "splitv";
"f" = "floating toggle";
"Return" = "fullscreen toggle";
"Space" = "focus mode_toggle";
# "a" = "focus parent";
# "s" = "layout stacking";
# "w" = "layout tabbed";
# "e" = "layout toggle split";
"Shift+Ctrl+q" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
"r" = "mode resize";
"1" = "workspace number 1";
"2" = "workspace number 2";
"3" = "workspace number 3";
"4" = "workspace number 4";
"5" = "workspace number 5";
"6" = "workspace number 6";
"7" = "workspace number 7";
"8" = "workspace number 8";
"9" = "workspace number 9";
"Comma" = "workspace prev";
"Period" = "workspace next";
"Shift+1" = "move container to workspace number 1";
"Shift+2" = "move container to workspace number 2";
"Shift+3" = "move container to workspace number 3";
"Shift+4" = "move container to workspace number 4";
"Shift+5" = "move container to workspace number 5";
"Shift+6" = "move container to workspace number 6";
"Shift+7" = "move container to workspace number 7";
"Shift+8" = "move container to workspace number 8";
"Shift+9" = "move container to workspace number 9";
"Shift+Comma" = "move container to workspace prev";
"Shift+Period" = "move container to workspace next";
};
window.titlebar = false;
input = {
"type:keyboard" = {
repeat_delay = "235";
repeat_rate = "60";
xkb_layout = "de";
xkb_variant = "nodeadkeys";
xkb_numlock = "enabled";
};
"type:pointer" = {
accel_profile = "flat";
pointer_accel = "0";
};
};
assigns = {
"9" = [
{class = "^steam_app_";}
{app_id = "^steam$";}
{class = "^steam$";}
];
};
# TODO eww -> bars = [ ];
}
# Extra configuration based on which system we are on. It's not ideal to
# distinguish by node name here, but at least this way it can stay in the
# sway related config file.
// {
kroma = let
monitorMain = "LG Electronics 27GN950 111NTGYLB719";
monitorLeft = "LG Electronics LG Ultra HD 0x00077939";
in {
output = {
# TODO "*" = { background = background; };
${monitorLeft} = {
mode = "3840x2160@60Hz";
pos = "0 0";
adaptive_sync = "enable";
subpixel = "rgb";
};
${monitorMain} = {
mode = "3840x2160@144Hz";
pos = "3840 0";
adaptive_sync = "enable";
subpixel = "rgb";
render_bit_depth = "10";
};
};
workspaceOutputAssign = [
{
workspace = "1";
output = monitorMain;
}
{
workspace = "7";
output = monitorLeft;
}
];
};
}
.${nixosConfig.node.name}
or {};
};
# TODO for_window [app_id="flameshot"] border pixel 0, floating enable, fullscreen disable, move absolute position 0 0
home.sessionVariables = {
# Let nixos electron wrappers enable wayland
NIXOS_OZONE_WL = 1;
# Cursor is invisible otherwise
# XXX: retest in 2024
WLR_NO_HARDWARE_CURSORS = 1;
# opengl backend flickers, also vulkan is love.
WLR_RENDERER = "vulkan";
};
home.packages = with pkgs; [
wdisplays
wl-clipboard
];
}

View file

View file

@ -0,0 +1,90 @@
{
programs.waybar = {
enable = true;
style = builtins.readFile ./waybar-style.css;
settings.main = {
layer = "top";
position = "top";
height = 30;
modules-left = ["wlr/workspaces" "wlr/taskbar"];
modules-center = ["hyprland/window"];
modules-right = ["network" "clock" "bluetooth" "cpu" "memory" "tray"];
"wlr/workspaces" = {
format = "{icon}";
on-click = "activate";
format-icons = {
urgent = "";
};
sort-by-number = true;
all-outputs = true;
};
clock = {
format = "{:%H:%M}";
format-alt = "{:%A, %B %d, %Y (%R)}";
tooltip-format = "<tt><small>{calendar}</small></tt>";
calendar = {
mode = "year";
mode-mon-col = 3;
weeks-pos = "right";
on-scroll = 1;
on-click-right = "mode";
format = {
months = "<span color='#ffead3'><b>{}</b></span>";
days = "<span color='#ecc6d9'><b>{}</b></span>";
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
};
actions = {
on-click-right = "mode";
on-click-forward = "tz_up";
on-click-backward = "tz_down";
on-scroll-up = "shift_up";
on-scroll-down = "shift_down";
};
};
};
network = {
interval = 5;
format-ethernet = " {ipaddr}/{cidr}"; # Icon: ethernet
format-disconnected = " Disconnected";
tooltip-format = ": {bandwidthDownBytes} : {bandwidthUpBytes}";
};
bluetooth = {
format = " {status} ";
format-connected = " {device_alias}";
format-connected-battery = " {device_alias} {device_battery_percentage}%";
tooltip-format = "{controller_alias}\t{controller_address}\n\n{num_connections} connected";
tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}";
tooltip-format-enumerate-connected = "{device_alias}\t{device_address}";
tooltip-format-enumerate-connected-battery = "{device_alias}\t{device_address}\t{device_battery_percentage}%";
};
memory = {
interval = 5;
format = " {}%";
states = {
warning = 70;
critical = 90;
};
};
cpu = {
interval = 5;
format = " {icon0} {icon1} {icon2} {icon3} {icon4} {icon5} {icon6} {icon7}";
tooltip-format = "{usage}";
format-icons = ["" "" "" "" "" "" "" ""];
};
tray = {
icon-size = 21;
spacing = 10;
};
};
};
}