summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--cfg.def.h83
m---------cmdtree0
-rw-r--r--packages.nix18
4 files changed, 100 insertions, 4 deletions
diff --git a/.gitmodules b/.gitmodules
index 12a8194..fbea7c8 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -4,6 +4,3 @@
[submodule "home-manager"]
path = home-manager
url = git@github.com:rycee/home-manager.git
-[submodule "cmdtree"]
- path = cmdtree
- url = git@git.sr.ht:~ben/cmdtree
diff --git a/cfg.def.h b/cfg.def.h
new file mode 100644
index 0000000..643c907
--- /dev/null
+++ b/cfg.def.h
@@ -0,0 +1,83 @@
+/*
+
+cmdtree <git.sr.ht/~jb55/cmdtree> configuration file
+
+This gets applied a compile time.
+
+ */
+
+enum position {
+ POSITION_TOP,
+ POSITION_LEFT,
+ POSITION_RIGHT,
+ POSITION_BOTTOM
+};
+
+static int xpad = 6;
+static int ypad = 2;
+
+static enum position position = POSITION_TOP;
+
+static const char *separator = " → ";
+
+/* -fn option overrides fonts[0]; default X11 font or font set */
+static const char *fonts[] = {
+ "monospace:size=12"
+};
+
+#define scheme_bg "#222222"
+
+static struct scheme schemes[SchemeLast] = {
+ [SchemeNorm] = { .bg = scheme_bg,
+ .bind = "#D19A66",
+ .arrow = "#888",
+ .prefix = "",
+ .name = "#bbbbbb"
+ },
+
+ [SchemePrefix] = { .bg = scheme_bg,
+ .bind = "#eeeeee",
+ .arrow = "#888",
+ .prefix = "",
+ .name = "#c678dd"
+ },
+};
+
+struct command volume_commands[] = {
+ DEFCMD("k", "up" , "amixer -q sset Master 2%+")
+ DEFCMD("j", "down", "amixer -q sset Master 2%-")
+ DEFCMD("m", "mute", "amixer -q sset Master toggle")
+};
+
+static struct command system_commands[] = {
+ // DEFPREFIX("c", "copy/sync", sync_commands)
+ DEFCMD("R", "reboot", "reboot")
+ DEFCMD("S", "suspend", "systemctl suspend")
+ DEFCMD("h", "h-m switch", "home-manager switch")
+ DEFCMD("w", "fresh wall", "n wal")
+ DEFCMD("x", "restart xbindkeys", "pkill xbindkeys && xbindkeys")
+
+ DEFCMD("l", "light theme", "xtheme light")
+ DEFCMD("d", "dark theme", "xtheme dark")
+};
+
+static struct command apps[] = {
+ DEFCMD("c", "chromium", "chromium")
+ DEFCMD("d", "dolphin", "dolphin")
+ DEFCMD("f", "firefox", "firefox")
+ DEFCMD("r", "ranger", "xterm ranger")
+ DEFCMD("t", "telegram", "telegram-desktop")
+ DEFCMD("q", "qutebrowser", "qutebrowser")
+};
+
+static struct command commands[] = {
+ DEFPREFIX ("a", "apps" , apps)
+ DEFCMD ("e", "emacs" , "emacsclient -c")
+ DEFCMD ("f", "flameshot" , "flameshot gui")
+ DEFCMD ("m", "mail" , "notmuch new")
+ DEFPREFIX ("s", "system" , system_commands)
+ DEFCMD ("r", "run" , "rofi -sidebar-mode -show run")
+ DEFPREFIX ("v", "volume" , volume_commands)
+ DEFCMD ("w", "windows" , "rofi -sidebar-mode -show window")
+ DEFCMD ("z", "seeme" , "seeme")
+};
diff --git a/cmdtree b/cmdtree
deleted file mode 160000
-Subproject 67e75d74a0ec188bf864acb1fc0c6c13f16de2d
diff --git a/packages.nix b/packages.nix
index 75a3f15..1d397cc 100644
--- a/packages.nix
+++ b/packages.nix
@@ -2,7 +2,23 @@
with pkgs;
let
- cmdtree = import ./cmdtree { nixpkgs = pkgs; };
+ cmdtree = stdenv.mkDerivation {
+ name = "cmdtree";
+ src = fetchGit {
+ url = "https://git.sr.ht/~jb55/cmdtree";
+ ref = "master";
+ rev = "5606078e8fa02462f0208d9f9cad98c7673812e6";
+ };
+ buildPhase = ''
+ cp ${./cfg.def.h} ./cfg.def.h
+ make
+ '';
+ installPhase = ''
+ mkdir -p $out/bin
+ cp ./cmdtree $out/bin
+ '';
+ buildInputs = [ pkgs.xorg.libX11 pkgs.xorg.libXft ];
+ };
in
[
ag