From 8fdd9b3a8ff4836ba718278708c1748ff1fff3ee Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 14 Dec 2021 22:45:16 +0100 Subject: flameshot-once profile: use toINI --- krebs/5pkgs/simple/flameshot-once/profile.nix | 28 +++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/krebs/5pkgs/simple/flameshot-once/profile.nix b/krebs/5pkgs/simple/flameshot-once/profile.nix index 991b4611..91628c4f 100644 --- a/krebs/5pkgs/simple/flameshot-once/profile.nix +++ b/krebs/5pkgs/simple/flameshot-once/profile.nix @@ -1,5 +1,6 @@ { config, pkgs }: with pkgs.stockholm.lib; +with generators; let # Refs https://github.com/lupoDharkael/flameshot/blob/master/src/widgets/capture/capturebutton.h @@ -159,18 +160,21 @@ let "QList<${t}>${le.x4 0}${le.x4 (length xs)}${concatMapStrings le.x4 xs}"; XDG_CONFIG_HOME = pkgs.write "flameshot-config" { - "/flameshot/flameshot.ini".text = '' - [General] - buttons=@Variant(\0\0\0\x7f\0\0\0\v${toQList "int" cfg.buttons}) - disabledTrayIcon=${toJSON cfg.disabledTrayIcon} - drawThickness=${toJSON cfg.drawThickness} - filenamePattern=${toJSON cfg.filenamePattern} - savePath=${toJSON cfg.savePath} - showDesktopNotification=${toJSON cfg.showDesktopNotification} - showHelp=${toJSON cfg.showHelp} - [Shortcuts] - TYPE_COPY=Return - ''; + "/flameshot/flameshot.ini".text = + toINI {} { + General = { + buttons = ''@Variant(\0\0\0\x7f\0\0\0\v${toQList "int" cfg.buttons})''; + disabledTrayIcon = cfg.disabledTrayIcon; + drawThickness = cfg.drawThickness; + filenamePattern = cfg.filenamePattern; + savePath = cfg.savePath; + showDesktopNotification = cfg.showDesktopNotification; + showHelp = cfg.showHelp; + }; + Shortcuts = { + TYPE_COPY = "Return"; + }; + }; }; in -- cgit v1.2.3