2021-10-27 22:54:05 +00:00
|
|
|
{ pkgs, lib, ... }@args:
|
2021-07-06 12:15:57 +00:00
|
|
|
let
|
2021-10-27 22:54:05 +00:00
|
|
|
hotkeys = import ./hotkeys.nix args;
|
2021-07-06 12:15:57 +00:00
|
|
|
mkTuple = lib.hm.gvariant.mkTuple;
|
2021-07-14 13:06:58 +00:00
|
|
|
statusScript = pkgs.writeHaskellScript
|
|
|
|
{
|
|
|
|
name = "status-script";
|
2022-02-20 15:58:23 +00:00
|
|
|
bins = [ pkgs.notmuch pkgs.coreutils pkgs.git pkgs.playerctl pkgs.khal ];
|
2021-07-14 13:06:58 +00:00
|
|
|
imports = [
|
|
|
|
"Control.Exception"
|
2021-07-14 13:35:04 +00:00
|
|
|
"System.Directory"
|
2021-07-14 13:06:58 +00:00
|
|
|
];
|
|
|
|
} ''
|
2021-11-18 14:38:40 +00:00
|
|
|
data Mode = Klausur | Orga | Communication | Code | Leisure | Unrestricted deriving (Eq, Ord, Show, Enum, Bounded)
|
2021-10-16 21:29:38 +00:00
|
|
|
modes = enumFrom Klausur
|
2021-07-14 13:06:58 +00:00
|
|
|
getMode = do
|
|
|
|
name <- Text.strip <$> readFileText "/home/maralorn/.mode" `onException` say "File /home/maralorn/.mode not found."
|
|
|
|
maybe (say [i|Unknown mode #{name}|] >> error [i|Unknown mode #{name}|]) pure $ find (\mode -> name == (Text.toLower $ show mode)) $ modes
|
|
|
|
|
2021-10-11 20:14:33 +00:00
|
|
|
isDirty gitDir = ((/= "") <$> (git "--no-optional-locks" "-C" gitDir "status" "--porcelain" |> captureTrim)) `catch` (\(_ :: SomeException) -> pure True)
|
2021-07-14 13:35:04 +00:00
|
|
|
isUnpushed gitDir = do
|
2021-10-11 20:14:33 +00:00
|
|
|
revs <- LBS.split 10 <$> tryCmd (git "--no-optional-locks" "-C" gitDir "rev-parse" "@{u}" "HEAD")
|
2021-08-03 18:15:47 +00:00
|
|
|
pure $ length revs /= 2 || (revs !!? 0 /= revs !!? 1)
|
2021-07-14 13:35:04 +00:00
|
|
|
|
2021-07-31 10:36:34 +00:00
|
|
|
tryCmd x = ignoreFailure x |> captureTrim
|
|
|
|
|
2021-07-14 13:06:58 +00:00
|
|
|
main = do
|
2022-02-21 00:26:28 +00:00
|
|
|
playing <- Text.intercalate " - " . fmap decodeUtf8 . filter (/= "") <$> mapM tryCmd [playerctl "status", playerctl "metadata" "title", playerctl "metadata" "artist"]
|
2022-02-20 15:58:23 +00:00
|
|
|
appointments <- Text.intercalate "; ". lines . decodeUtf8 <$> (tryCmd $ khal ["list", "-a", "Standard", "-a", "Planung", "-a", "Uni", "-a", "Maltaire", "now", "2h", "-df", ""])
|
2021-07-14 13:06:58 +00:00
|
|
|
mode <- getMode
|
|
|
|
unread <- notmuch "count" "folder:hera/Inbox" "tag:unread" |> captureTrim
|
|
|
|
inbox <- notmuch "count" "folder:hera/Inbox" |> captureTrim
|
2021-11-18 14:38:40 +00:00
|
|
|
codeMails <- notmuch "count" "folder:hera/Code" |> captureTrim
|
2021-07-14 13:35:04 +00:00
|
|
|
dirs <- listDirectory "/home/maralorn/git"
|
|
|
|
dirty <- fmap toText <$> filterM (isDirty . ("/home/maralorn/git/"<>)) dirs
|
|
|
|
unpushed <- fmap toText <$> filterM (isUnpushed . ("/home/maralorn/git/"<>)) dirs
|
2022-02-21 00:26:28 +00:00
|
|
|
say . Text.unwords $
|
|
|
|
["<executor.markup.true><span background='white'>", [i|<span foreground='\#8b008b'>#{appointments}</span>|],playing, [i|<span foreground='\#0000aa'>#{show mode}</span>|]] ++
|
|
|
|
memptyIfFalse ((unread /= "0") && mode >= Orga) (one [i|<span foreground='\#DC143C'>Unread: #{unread}</span>|]) ++
|
|
|
|
memptyIfFalse ((inbox /= "0") && mode == Leisure) (one [i|<span foreground='\#7fff00'>Inbox: #{inbox}</span>|]) ++
|
|
|
|
memptyIfFalse ((codeMails /= "0") && mode == Code) (one [i|<span foreground='\#006400'>Code: #{codeMails}</span>|]) ++
|
|
|
|
memptyIfFalse (length unpushed /= 0) (one [i|<span foreground='\#d2691e'>Unpushed: #{Text.intercalate " " unpushed}</span>|]) ++
|
|
|
|
memptyIfFalse (length dirty /= 0) (one [i|<span foreground='\#ff7f50'>Dirty: #{Text.intercalate " " dirty}</span>|]) ++ ["</span>"]
|
2021-07-14 13:06:58 +00:00
|
|
|
'';
|
2021-07-06 12:15:57 +00:00
|
|
|
in
|
|
|
|
{
|
2020-05-21 23:09:19 +00:00
|
|
|
services.gpg-agent.pinentryFlavor = "gnome3";
|
2020-05-16 14:36:59 +00:00
|
|
|
dconf.settings = {
|
2021-07-06 12:15:57 +00:00
|
|
|
"org/gnome/desktop/wm/keybindings" = {
|
|
|
|
switch-input-source = [ ];
|
|
|
|
switch-input-source-backward = [ ];
|
2021-07-10 10:47:43 +00:00
|
|
|
switch-applications = [ ];
|
|
|
|
switch-applications-backward = [ ];
|
|
|
|
cycle-windows = [ "<Super>Tab" ];
|
|
|
|
cycle-windows-backward = [ "<Shift><Super>Tab" ];
|
2021-07-06 12:15:57 +00:00
|
|
|
};
|
|
|
|
|
2021-07-10 18:56:00 +00:00
|
|
|
"org/gnome/settings-daemon/plugins/color" = {
|
|
|
|
night-light-enabled = true;
|
|
|
|
night-light-schedule-automatic = false;
|
2021-07-11 10:06:13 +00:00
|
|
|
night-light-schedule-from = 23.0;
|
2021-07-10 18:56:00 +00:00
|
|
|
};
|
|
|
|
|
2021-07-06 12:15:57 +00:00
|
|
|
"org/gnome/settings-daemon/plugins/power" = {
|
2021-07-11 10:06:13 +00:00
|
|
|
sleep-inactive-ac-timeout = 900;
|
2021-07-08 22:32:08 +00:00
|
|
|
sleep-inactive-ac-type = "suspend";
|
2021-07-06 12:15:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
"org/gnome/desktop/wm/keybindings" = {
|
|
|
|
close = [ "<Super>q" ];
|
|
|
|
};
|
|
|
|
|
2021-07-12 20:13:39 +00:00
|
|
|
"org/gnome/shell/extensions/gtile" =
|
|
|
|
let
|
|
|
|
left = r: "0:${r} 1:${r},0:${r} 2:${r},0:${r} 3:${r},0:${r} 0:${r}, 1:${r} 1:${r}";
|
|
|
|
right = r: "4:${r} 5:${r},3:${r} 5:${r},2:${r} 5:${r},5:${r} 5:${r}, 4:${r} 4:${r}";
|
2021-07-29 09:30:44 +00:00
|
|
|
middle = r: "2:${r} 3:${r}, 1:${r} 4:${r}, 0:${r} 5:${r}, 1:${r} 3:${r}, 2:${r} 4:${r}, 2:${r} 2:${r}, 3:${r} 3:${r}";
|
2021-07-12 20:13:39 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
global-presets = true;
|
|
|
|
grid-sizes = "6x2";
|
2022-02-17 18:53:41 +00:00
|
|
|
preset-resize-1 = [ "<Control><Super>m" ];
|
|
|
|
preset-resize-2 = [ "<Control><Super>comma" ];
|
|
|
|
preset-resize-3 = [ "<Control><Super>period" ];
|
|
|
|
preset-resize-4 = [ "<Control><Super>n" ];
|
|
|
|
preset-resize-5 = [ "<Control><Super>r" ];
|
|
|
|
preset-resize-6 = [ "<Control><Super>t" ];
|
|
|
|
preset-resize-7 = [ "<Control><Super>h" ];
|
|
|
|
preset-resize-8 = [ "<Control><Super>g" ];
|
|
|
|
preset-resize-9 = [ "<Control><Super>f" ];
|
2021-07-12 20:13:39 +00:00
|
|
|
resize1 = "6x2 ${left "1"}";
|
|
|
|
resize2 = "6x2 ${middle "1"}";
|
|
|
|
resize3 = "6x2 ${right "1"}";
|
|
|
|
resize4 = "6x1 ${left "0"}";
|
|
|
|
resize5 = "6x1 ${middle "0"}";
|
|
|
|
resize6 = "6x1 ${right "0"}";
|
2021-07-12 20:45:39 +00:00
|
|
|
resize7 = "6x2 ${left "0"}";
|
|
|
|
resize8 = "6x2 ${middle "0"}";
|
|
|
|
resize9 = "6x2 ${right "0"}";
|
2021-07-12 20:13:39 +00:00
|
|
|
show-toggle-tiling-alt = [ "<Super>t" ];
|
|
|
|
show-icon = false;
|
|
|
|
};
|
2022-02-17 20:53:19 +00:00
|
|
|
# Generated via dconf2nix: https://github.com/gvolpe/dconf2nix
|
2022-02-18 12:41:07 +00:00
|
|
|
"org/gnome/desktop/a11y/keyboard" = {
|
2022-02-17 20:53:19 +00:00
|
|
|
mousekeys-accel-time = 2000;
|
|
|
|
mousekeys-enable = true;
|
|
|
|
mousekeys-init-delay = 0;
|
|
|
|
mousekeys-max-speed = 2000;
|
|
|
|
};
|
2021-07-09 16:16:14 +00:00
|
|
|
|
2021-07-06 12:15:57 +00:00
|
|
|
"org/gnome/desktop/interface" = {
|
|
|
|
gtk-theme = "Arc";
|
|
|
|
icon-theme = "Arc";
|
2021-07-09 16:16:14 +00:00
|
|
|
document-font-name = "B612 9";
|
|
|
|
font-antialiasing = "rgba";
|
|
|
|
font-hinting = "slight";
|
|
|
|
font-name = "B612 9";
|
|
|
|
clock-show-weekday = true;
|
|
|
|
monospace-font-name = "JetBrainsMono Nerd Font Mono Bold 9";
|
2021-11-02 13:24:43 +00:00
|
|
|
locate-pointer = true;
|
2021-07-06 12:15:57 +00:00
|
|
|
};
|
|
|
|
|
2021-07-09 16:16:14 +00:00
|
|
|
"org/gnome/desktop/calendar" = {
|
|
|
|
show-weekdate = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
"org/gnome/desktop/wm/preferences" = {
|
|
|
|
titlebar-font = "B612 9";
|
2021-07-06 12:15:57 +00:00
|
|
|
};
|
|
|
|
|
2021-07-14 13:06:58 +00:00
|
|
|
"org/gnome/shell/extensions/executor" = {
|
|
|
|
center-active = true;
|
|
|
|
center-commands-json = ''{"commands":[{"command":"${statusScript}/bin/status-script","interval":1,"uuid":"d20a15a4-aea9-48e1-955f-4bd9f55b08bc"}]}'';
|
|
|
|
center-index = 0;
|
|
|
|
left-active = false;
|
|
|
|
location = 1;
|
|
|
|
right-active = false;
|
|
|
|
};
|
|
|
|
|
2021-07-06 12:15:57 +00:00
|
|
|
"org/gnome/shell" = {
|
2021-11-26 03:02:41 +00:00
|
|
|
disable-extension-version-validation = true;
|
2021-07-06 12:15:57 +00:00
|
|
|
disable-user-extensions = false;
|
2021-07-09 16:16:14 +00:00
|
|
|
enabled-extensions = [
|
|
|
|
"gTile@vibou"
|
|
|
|
"clipboard-indicator@tudmotu.com"
|
|
|
|
"appindicatorsupport@rgcjonas.gmail.com"
|
|
|
|
"nothing-to-say@extensions.gnome.wouter.bolsterl.ee"
|
|
|
|
"drive-menu@gnome-shell-extensions.gcampax.github.com"
|
|
|
|
"user-theme@gnome-shell-extensions.gcampax.github.com"
|
|
|
|
"caffeine@patapon.info"
|
|
|
|
"dash-to-panel@jderose9.github.com"
|
|
|
|
"system-monitor@paradoxxx.zero.gmail.com"
|
2021-07-09 17:37:11 +00:00
|
|
|
"windowsNavigator@gnome-shell-extensions.gcampax.github.com"
|
2021-07-14 13:06:58 +00:00
|
|
|
"executor@raujonas.github.io"
|
2021-07-09 16:16:14 +00:00
|
|
|
];
|
2021-07-06 12:15:57 +00:00
|
|
|
welcome-dialog-last-shown-version = "40.1";
|
|
|
|
};
|
|
|
|
|
2021-07-09 16:16:14 +00:00
|
|
|
"org/gnome/shell/extensions/dash-to-panel" = {
|
|
|
|
animate-app-switch = false;
|
|
|
|
animate-window-launch = false;
|
|
|
|
appicon-margin = 0;
|
|
|
|
appicon-padding = 4;
|
|
|
|
group-apps = false;
|
|
|
|
group-apps-label-font-color = "#613583";
|
|
|
|
group-apps-label-font-color-minimized = "#1a5fb4";
|
|
|
|
group-apps-label-font-size = 13;
|
|
|
|
group-apps-label-font-weight = "inherit";
|
|
|
|
group-apps-underline-unfocused = false;
|
|
|
|
group-apps-use-fixed-width = false;
|
|
|
|
group-apps-use-launchers = false;
|
|
|
|
isolate-monitors = false;
|
|
|
|
isolate-workspaces = true;
|
|
|
|
leftbox-padding = -1;
|
|
|
|
overview-click-to-exit = false;
|
2021-08-10 12:47:15 +00:00
|
|
|
panel-element-positions = ''{"0":[{"element":"showAppsButton","visible":false,"position":"stackedTL"},{"element":"taskbar","visible":false,"position":"stackedTL"},{"element":"dateMenu","visible":true,"position":"stackedTL"},{"element":"leftBox","visible":true,"position":"stackedTL"},{"element":"activitiesButton","visible":false,"position":"stackedTL"},{"element":"centerBox","visible":true,"position":"stackedBR"},{"element":"rightBox","visible":true,"position":"stackedBR"},{"element":"systemMenu","visible":true,"position":"stackedBR"},{"element":"desktopButton","visible":false,"position":"stackedBR"}]," 0 ":[{" element ":" showAppsButton "," visible ":false," position ":" stackedTL "},{" element ":" activitiesButton "," visible ":false," position ":" stackedTL "},{" element ":" dateMenu "," visible ":true," position ":" stackedTL "},{" element ":" leftBox "," visible ":true," position ":" stackedTL "},{" element ":" taskbar "," visible ":true," position ":" stackedTL "},{" element ":" rightBox "," visible ":true," position ":" stackedBR "},{" element ":" centerBox "," visible ":true," position ":" stackedTL "},{" element ":" systemMenu "," visible ":true," position ":" stackedBR "},{" element ":" desktopButton "," visible ":true," position ":" stackedBR "}]}'';
|
2021-07-09 16:16:14 +00:00
|
|
|
panel-positions = ''{"0":"TOP"}'';
|
|
|
|
panel-sizes = ''{"0":32}'';
|
|
|
|
show-appmenu = true;
|
|
|
|
show-favorites = false;
|
|
|
|
show-running-apps = true;
|
|
|
|
status-icon-padding = -1;
|
|
|
|
trans-panel-opacity = 0.8;
|
|
|
|
trans-use-custom-opacity = true;
|
|
|
|
tray-padding = -1;
|
|
|
|
};
|
|
|
|
|
2021-07-06 12:15:57 +00:00
|
|
|
"org/gnome/shell/extensions/user-theme" = {
|
|
|
|
name = "Arc-Lighter";
|
|
|
|
};
|
|
|
|
|
|
|
|
"system/locale" = {
|
|
|
|
region = "en_DK.UTF-8";
|
|
|
|
};
|
|
|
|
|
2021-10-08 10:32:57 +00:00
|
|
|
"org/gnome/desktop/screensaver" = {
|
|
|
|
lock-delay = "0"; # lock screen immediately on screen blank
|
|
|
|
};
|
|
|
|
|
|
|
|
"org/gnome/desktop/session" = {
|
|
|
|
idle-delay = "300"; # blank screen after 5 minutes
|
|
|
|
};
|
|
|
|
|
2021-07-06 12:15:57 +00:00
|
|
|
"org/gnome/shell/extensions/system-monitor" = {
|
|
|
|
center-display = true;
|
|
|
|
compact-display = true;
|
|
|
|
cpu-show-menu = false;
|
|
|
|
cpu-show-text = false;
|
|
|
|
cpu-style = "graph";
|
|
|
|
icon-display = false;
|
|
|
|
memory-show-text = false;
|
|
|
|
memory-style = "graph";
|
|
|
|
move-clock = false;
|
|
|
|
net-show-menu = true;
|
|
|
|
net-show-text = false;
|
|
|
|
net-speed-in-bits = true;
|
|
|
|
net-style = "both";
|
|
|
|
show-tooltip = true;
|
|
|
|
};
|
|
|
|
|
2020-09-28 11:35:45 +00:00
|
|
|
"org/gnome/desktop/input-sources" = {
|
2021-07-06 12:15:57 +00:00
|
|
|
sources = [ (mkTuple [ "xkb" "de+neo" ]) ]; # use neo
|
2020-09-28 11:35:45 +00:00
|
|
|
xkb-options = [
|
|
|
|
"altwin:swap_lalt_lwin" # swap alt and win
|
|
|
|
"lv3:menu_switch" # So that gnome-settings does not set it to ralt
|
|
|
|
];
|
|
|
|
};
|
2020-05-16 14:36:59 +00:00
|
|
|
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal" =
|
|
|
|
{
|
|
|
|
binding = "<Super>Return";
|
2020-07-03 16:13:13 +00:00
|
|
|
command = "kitty mytmux";
|
2020-05-16 14:36:59 +00:00
|
|
|
name = "Terminal";
|
|
|
|
};
|
|
|
|
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/hotkeys" =
|
|
|
|
{
|
|
|
|
binding = "<Super>space";
|
2021-10-13 14:51:32 +00:00
|
|
|
command = "kitty ${pkgs.haskell-dialog}/bin/hotkeys ${pkgs.writeText "hotkeys.yaml" (builtins.toJSON hotkeys)}";
|
2020-05-16 14:36:59 +00:00
|
|
|
name = "Hotkeys";
|
|
|
|
};
|
2021-07-06 18:04:33 +00:00
|
|
|
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/standby" = {
|
|
|
|
binding = "<Super>F5";
|
|
|
|
command = "systemctl suspend";
|
|
|
|
name = "Standby";
|
|
|
|
};
|
|
|
|
|
2021-03-03 17:29:08 +00:00
|
|
|
"org/gnome/shell/extensions/nothing-to-say" = {
|
2021-07-06 12:15:57 +00:00
|
|
|
icon-visibility = "always";
|
2021-03-02 19:06:34 +00:00
|
|
|
keybinding-toggle-mute = [ "<Primary><Shift>U+2113" ]; # Mouse key side middle
|
|
|
|
};
|
2020-05-16 14:36:59 +00:00
|
|
|
"org/gnome/settings-daemon/plugins/media-keys" = {
|
|
|
|
custom-keybindings = [
|
|
|
|
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal/"
|
|
|
|
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/hotkeys/"
|
2021-07-06 18:04:33 +00:00
|
|
|
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/standby/"
|
2020-05-16 14:36:59 +00:00
|
|
|
];
|
|
|
|
next = [ "<Primary><Shift>dollar" ];
|
|
|
|
play = [ "<Primary><Shift>guillemotleft" ];
|
|
|
|
previous = [ "<Primary><Shift>EuroSign" ];
|
|
|
|
screensaver = [ "<Primary>Escape" ];
|
|
|
|
volume-down = [ "<Primary><Shift>section" ];
|
|
|
|
volume-up = [ "<Primary><Shift>degree" ];
|
2020-06-09 08:14:40 +00:00
|
|
|
area-screenshot-clip = [ "Print" ];
|
2021-05-18 14:33:28 +00:00
|
|
|
screenshot = [ ];
|
2020-05-16 14:36:59 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|