-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ _: { | |
./kitty | ||
./mpv | ||
./obsidian | ||
./planify | ||
./redshift | ||
./rofi | ||
./rustdesk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: | ||
let | ||
cfg = config.myHomeApps.planify; | ||
|
||
mkPlanifyWrapper = | ||
name: cmd: | ||
(pkgs.writeShellScriptBin name '' | ||
# hack to make planify behave properly in high DPI (GDK_SCALE will scale icons, while settings.ini hack will scale font back down) | ||
TMPCONFIG="$(mktemp -d)" | ||
cp -arL "$XDG_CONFIG_HOME/gtk-4.0" "$TMPCONFIG" | ||
cp -arL "$XDG_CONFIG_HOME/dconf" "$TMPCONFIG" | ||
NEWSIZE="$(( "$(sed -nE 's/gtk-font-name[^0-9]*([0-9]+)$/\1/p' "$TMPCONFIG/gtk-4.0/settings.ini")" / 2 ))" | ||
sed -i -E "s/(gtk-font-name[^0-9]*) [0-9]+$/\1 $NEWSIZE/" "$TMPCONFIG/gtk-4.0/settings.ini" | ||
export GDK_SCALE=2 | ||
export XDG_CONFIG_HOME="$TMPCONFIG" | ||
${cmd} | ||
rm -rf "$TMPCONFIG" | ||
''); | ||
|
||
planifyPkg = mkPlanifyWrapper "planify" (lib.getExe pkgs.planify); | ||
planifyQuickAddPkg = mkPlanifyWrapper "planify-quickadd" ( | ||
lib.getExe' pkgs.planify "io.github.alainm23.planify.quick-add" | ||
); | ||
in | ||
{ | ||
options.myHomeApps.planify = { | ||
enable = lib.mkEnableOption "planify"; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
home.packages = [ | ||
planifyPkg | ||
planifyQuickAddPkg | ||
]; | ||
|
||
myHomeApps.awesome.extraConfig = '' | ||
local home = os.getenv("HOME") | ||
local xdg_config_home = os.getenv("XDG_CONFIG_HOME") or (os.getenv("HOME") .. "/.config") | ||
local planifykeys = gears.table.join( | ||
awful.key({ RC.vars.modkey }, "'", function() | ||
awful.util.spawn("${lib.getExe planifyQuickAddPkg}") | ||
end, { description = "planify quick add", group = "apps" }) | ||
) | ||
RC.globalkeys = gears.table.join(RC.globalkeys, planifykeys) | ||
root.keys(RC.globalkeys) | ||
''; | ||
|
||
myHomeApps.awesome.autorun = [ (lib.getExe planifyPkg) ]; | ||
}; | ||
} |