style waybar, add mpd module, other fixes

This commit is contained in:
tristan 2023-09-07 16:17:35 +01:00
parent 32500bffd0
commit ce1c48b4a4
8 changed files with 121 additions and 92 deletions

View file

@ -46,6 +46,8 @@ in
obs-studio obs-studio
selectdefaultapplication selectdefaultapplication
input-leap input-leap
pwvucontrol
easyeffects
inkscape inkscape
libsForQt5.okular libsForQt5.okular
@ -58,7 +60,6 @@ in
bitwarden bitwarden
libsForQt5.kasts libsForQt5.kasts
libreoffice libreoffice
gimp
(makeDesktopItem { (makeDesktopItem {
name = "logseq"; name = "logseq";
desktopName = "Logseq"; desktopName = "Logseq";
@ -97,23 +98,6 @@ in
]; ];
}; };
programs.ncmpcpp = {
enable = true;
settings.mpd_host = "music.local";
bindings = [
{ key = "j"; command = "scroll_down"; }
{ key = "k"; command = "scroll_up"; }
{ key = "l"; command = "next_column"; }
{ key = "h"; command = "previous_column"; }
{ key = "J"; command = [ "select_item" "scroll_down" ]; }
{ key = "K"; command = [ "select_item" "scroll_up" ]; }
];
};
services.mpd-mpris.enable = true;
services.mpd-mpris.mpd = {
host = "music.local";
};
programs.mpv.enable = true; programs.mpv.enable = true;
programs.mpv.bindings = { programs.mpv.bindings = {
l = "seek 5"; l = "seek 5";
@ -340,6 +324,9 @@ in
Service = { Service = {
ExecStart = "${pkgs.snapcast}/bin/snapclient -h music.local"; ExecStart = "${pkgs.snapcast}/bin/snapclient -h music.local";
}; };
Install = {
WantedBy = ["graphical-session.target"];
};
}; };
}; };
@ -348,49 +335,6 @@ in
indicator = true; indicator = true;
}; };
wayland.windowManager.sway = {
enable = true;
config = {
modifier = "Mod4";
input = {
"type:keyboard" = {
xkb_layout = "gb";
xkb_options = "caps:escape";
xkb_numlock = "enable";
};
"type:touchpad" = {
natural_scroll = "enabled";
tap = "enabled";
};
};
gaps = {
inner = 10;
};
keybindings =
let
modifier = config.wayland.windowManager.sway.config.modifier;
in
lib.mkOptionDefault {
"${modifier}+Shift+x" = "kill";
"${modifier}+d" = "exec ${pkgs.wofi}/bin/wofi --show drun";
"${modifier}+o" = "exec ${my-deps.fileman}";
XF86AudioRaiseVolume = "exec ${ my-deps.amixer } sset Master 5%+ && ${ my-deps.amixer } sset Master unmute";
XF86AudioLowerVolume = "exec ${ my-deps.amixer } sset Master 5%-";
# XF86AudioPlay = "exec ${ my-scripts.play-pause }/bin/play-pause";
XF86AudioNext = "exec ${ my-deps.playerctl } next";
XF86AudioPrev = "exec ${ my-deps.playerctl } previous";
# XF86MonBrightnessUp = "exec ${ my-scripts.brightness-up }/bin/brightness-up";
# XF86MonBrightnessDown = "exec ${ my-scripts.brightness-down }/bin/brightness-down";
# "${modifier}+P" = "exec ${ my-scripts.bwmenu }/bin/bwmenu";
# "${modifier}+SHIFT+P" = "exec ${ my-scripts.bwotpmenu }/bin/bwotpmenu";
# "${modifier}+SHIFT+S" = "exec ${ my-scripts.screenshot }/bin/screenshot";
"${modifier}+M" = "exec ${ my-deps.terminal } -e ncmpcpp";
"${modifier}+Z" = "exec ${pkgs.swaylock-effects}/bin/swaylock -f";
};
bars = [ ];
};
};
programs.qutebrowser = { programs.qutebrowser = {
enable = true; enable = true;
searchEngines = { searchEngines = {

View file

@ -74,6 +74,8 @@ user: { config, pkgs, ... }:
layout = "gb"; layout = "gb";
xkbOptions = "caps:escape"; xkbOptions = "caps:escape";
}; };
hardware.opentabletdriver.enable = true;
qt.enable = true; qt.enable = true;
qt.platformTheme = "gtk2"; qt.platformTheme = "gtk2";

View file

@ -87,19 +87,18 @@
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
extraConfig = '' extraConfig = ''
workspace = DP-1, 1 workspace = DP-1, 1
workspace = HDMI-A-1, 6
workspace = 1, monitor:DP-1 workspace = 1, monitor:DP-1
workspace = 2, monitor:DP-1 workspace = 2, monitor:DP-1
workspace = 3, monitor:DP-1 workspace = 3, monitor:DP-1
workspace = 4, monitor:DP-1 workspace = 4, monitor:DP-1
workspace = 5, monitor:DP-1 workspace = 5, monitor:DP-1
workspace = 6, monitor:HDMI-A-1
workspace = 7, monitor:HDMI-A-1
workspace = 8, monitor:HDMI-A-1
workspace = 9, monitor:HDMI-A-1
workspace = 10,monitor:HDMI-A-1
''; '';
}; };
programs.waybar.settings.mainBar."hyprland/workspaces".persistent_workspaces = {
DP-1 = 5;
};
home.packages = with pkgs; [ monado openxr-loader ];
}]; }];
} }

View file

@ -17,6 +17,7 @@
(import ./modules/work.nix { inherit user; }) (import ./modules/work.nix { inherit user; })
(import ./modules/menu.nix { inherit user; }) (import ./modules/menu.nix { inherit user; })
(import ./modules/email.nix { inherit user userName; }) (import ./modules/email.nix { inherit user userName; })
(import ./modules/mpd.nix { inherit user; })
(import ./modules/git.nix { inherit user userName; }) (import ./modules/git.nix { inherit user userName; })
(import ./modules/laptop.nix { inherit user; }) (import ./modules/laptop.nix { inherit user; })
(import ./modules/dev.nix { inherit user; }) (import ./modules/dev.nix { inherit user; })
@ -33,5 +34,6 @@
programs.menu.enable = true; programs.menu.enable = true;
roles.work.enable = work; roles.work.enable = work;
roles.personal.enable = !work; roles.personal.enable = !work;
roles.mpd.enable = true;
} }

32
lib/modules/mpd.nix Normal file
View file

@ -0,0 +1,32 @@
{ user }: { lib, pkgs, config, ... }:
with lib;
let
cfg = config.roles.mpd;
in
{
options.roles.mpd = {
enable = mkEnableOption "setup mpd client";
host = mkOption {default = "music.local";};
};
config = mkIf cfg.enable {
home-manager.users.${user}.imports = [{
programs.ncmpcpp = {
enable = true;
settings.mpd_host = cfg.host;
bindings = [
{ key = "j"; command = "scroll_down"; }
{ key = "k"; command = "scroll_up"; }
{ key = "l"; command = "next_column"; }
{ key = "h"; command = "previous_column"; }
{ key = "J"; command = [ "select_item" "scroll_down" ]; }
{ key = "K"; command = [ "select_item" "scroll_up" ]; }
];
};
services.mpd-mpris = {
enable = true;
mpd.host = cfg.host;
};
}];
};
}

View file

@ -18,8 +18,8 @@ with lib;
home-manager.users.${user}.imports = [{ home-manager.users.${user}.imports = [{
services.nextcloud-client.enable = true; services.nextcloud-client.enable = true;
services.gnome-keyring.enable = true;
home.packages = with pkgs; [ home.packages = with pkgs; [
nextcloud-client
godot_4 godot_4
ardour ardour
blender blender
@ -30,6 +30,20 @@ with lib;
transmission-remote-gtk transmission-remote-gtk
krita krita
]; ];
accounts.calendar = {
basePath = "Calendars";
accounts."tristan@files.tristans.cloud" = {
primary = true;
remote = {
type = "caldav";
url = "https://files.tristans.cloud/remote.php/dav/";
userName = "tristan";
passwordCommand = [ "${pkgs.rbw}/bin/rbw" "get" "files.tristans.cloud" "tristan" ];
};
};
};
}]; }];
}; };
} }

View file

@ -101,30 +101,30 @@ in
submap = reset submap = reset
workspace = 11, default:true workspace = 11, default:true
bind = SUPER,1,workspace,11 bind = SUPER,1,workspace,1
bind = SUPER,2,workspace,12 bind = SUPER,2,workspace,2
bind = SUPER,3,workspace,13 bind = SUPER,3,workspace,3
bind = SUPER,4,workspace,14 bind = SUPER,4,workspace,4
bind = SUPER,5,workspace,15 bind = SUPER,5,workspace,5
bind = SUPER,6,workspace,16 bind = SUPER,6,workspace,6
bind = SUPER,7,workspace,17 bind = SUPER,7,workspace,7
bind = SUPER,8,workspace,18 bind = SUPER,8,workspace,8
bind = SUPER,9,workspace,19 bind = SUPER,9,workspace,9
bind = SUPER,0,workspace,20 bind = SUPER,0,workspace,10
bind = SUPER,left,workspace,r-1 bind = SUPER,left,workspace,r-1
bind = SUPER,right,workspace,r+1 bind = SUPER,right,workspace,r+1
bind = SUPER_SHIFT,1,movetoworkspace,11 bind = SUPER_SHIFT,1,movetoworkspace,1
bind = SUPER_SHIFT,2,movetoworkspace,12 bind = SUPER_SHIFT,2,movetoworkspace,2
bind = SUPER_SHIFT,3,movetoworkspace,13 bind = SUPER_SHIFT,3,movetoworkspace,3
bind = SUPER_SHIFT,4,movetoworkspace,14 bind = SUPER_SHIFT,4,movetoworkspace,4
bind = SUPER_SHIFT,5,movetoworkspace,15 bind = SUPER_SHIFT,5,movetoworkspace,5
bind = SUPER_SHIFT,6,movetoworkspace,16 bind = SUPER_SHIFT,6,movetoworkspace,6
bind = SUPER_SHIFT,7,movetoworkspace,17 bind = SUPER_SHIFT,7,movetoworkspace,7
bind = SUPER_SHIFT,8,movetoworkspace,18 bind = SUPER_SHIFT,8,movetoworkspace,8
bind = SUPER_SHIFT,9,movetoworkspace,19 bind = SUPER_SHIFT,9,movetoworkspace,9
bind = SUPER_SHIFT,0,movetoworkspace,20 bind = SUPER_SHIFT,0,movetoworkspace,10
gestures { gestures {
workspace_swipe = yes workspace_swipe = yes
@ -149,6 +149,7 @@ in
} }
general { general {
gaps_out = 10
resize_on_border = yes resize_on_border = yes
layout = master layout = master
col.active_border = rgb(FFFF00) rgb(00FFFF) rgb(FF00FF) col.active_border = rgb(FFFF00) rgb(00FFFF) rgb(FF00FF)
@ -209,7 +210,7 @@ in
layer = "top"; layer = "top";
position = "top"; position = "top";
height = 36; height = 36;
modules-left = [ "hyprland/window" ]; modules-left = [ "hyprland/workspaces" "hyprland/window" ];
modules-right = [ "mpris" "pulseaudio" "clock" "tray" "battery" ]; modules-right = [ "mpris" "pulseaudio" "clock" "tray" "battery" ];
clock = { clock = {
format = "📅 {:%a %b-%d %I:%M %p}"; format = "📅 {:%a %b-%d %I:%M %p}";
@ -231,6 +232,9 @@ in
paused = ""; paused = "";
}; };
}; };
mpd = {
server = "music.local";
};
battery = { battery = {
format = "{icon} {capacity}%"; format = "{icon} {capacity}%";
format-icons = [ "🤏" "🪫" "🔋" "🔋" ]; format-icons = [ "🤏" "🪫" "🔋" "🔋" ];
@ -245,6 +249,38 @@ in
enable = true; enable = true;
target = "graphical-session.target"; target = "graphical-session.target";
}; };
style = ''
* {
min-height: 0;
text-shadow: 0 0 3px #080C39, 1px 1px black;
}
window#waybar {
font-size: small;
background: none;
}
#workspaces button {
border-radius: 1rem;
padding: 0px .5rem;
margin: 0px .5rem 0px 0px;
}
#workspaces button.active {
background: rgba(155,155,155,0.3);
}
.modules-right widget label {
padding: 0 1rem;
margin: 0 .5rem;
}
#tray {
min-width: 5rem;
}
'';
}; };

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
let let
my-deps = { my-deps = {
notify-send = "${pkgs.libnotify}/bin/notify-send"; notify-send = "${pkgs.libnotify}/bin/notify-send";
@ -122,7 +122,7 @@ in
key = "G"; key = "G";
}]; }];
} }
{ (lib.mkIf config.roles.mpd.enable {
name = "ncmpcpp"; name = "ncmpcpp";
text = '' text = ''
${my-deps.terminal} -e ncmpcpp ${my-deps.terminal} -e ncmpcpp
@ -131,7 +131,7 @@ in
key = "M"; key = "M";
}]; }];
install = false; install = false;
} })
{ {
name = "menu"; name = "menu";
text = '' text = ''