citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

cfg.def.h (8657B)


      1 /* See LICENSE file for copyright and license details. */
      2 /* Default settings; can be overriden by command line. */
      3 
      4 enum position {
      5 	POSITION_TOP,
      6 	POSITION_LEFT,
      7 	POSITION_RIGHT,
      8 	POSITION_BOTTOM
      9 };
     10 
     11 static int xpad = 6;
     12 static int ypad = 2;
     13 
     14 static enum position position = POSITION_TOP;
     15 
     16 
     17 static const char *separator = " → ";
     18 
     19 /* -fn option overrides fonts[0]; default X11 font or font set */
     20 static const char *fonts[] = {
     21 	"terminus:pixelsize=16"
     22 };
     23 
     24 #define scheme_bg "#222222"
     25 
     26 static struct scheme schemes[SchemeLast] = {
     27 	[SchemeNorm]  = { .bg = scheme_bg,
     28 			  .bind = "#D19A66",
     29 			  .arrow = "#888",
     30 			  .prefix = "",
     31 			  .name = "#bbbbbb"
     32 	                },
     33 
     34 	[SchemePrefix] = { .bg = scheme_bg,
     35 			   .bind = "#eeeeee",
     36 			   .arrow = "#888",
     37 			   .prefix = "",
     38 			   .name = "#c678dd"
     39 	                 },
     40 };
     41 
     42 static struct command bitcoin_commands[] = {
     43 	DEFCMD("p", "price", "n btc")
     44 	DEFCMD("b", "bcalc", "dmenupn bcalc bcalc")
     45 };
     46 
     47 static struct command chromecast_commands[] = {
     48 	DEFCMD(" ", "play/pause", "n chromecast space play-paused")
     49 	DEFCMD("p", "prev", "n chromecast p prev")
     50 	DEFCMD("n", "next", "n chromecast n next")
     51 	DEFCMD("s", "stop", "n chromecast s stopped")
     52 	DEFCMD("q", "quit", "n chromecast quit quit")
     53 	DEFCMD("t", "subtitles", "n chromecast t subtitles")
     54 	DEFCMD("m", "mute", "n chromecast m muted")
     55 };
     56 
     57 static struct command phone_music_commands[] = {
     58 	DEFCMD("p", "play/pause", "phonectl music:playpause")
     59 	DEFCMD("=", "volume up", "phonectl music:up")
     60 	DEFCMD("-", "volume down", "phonectl music:down")
     61 };
     62 
     63 static struct command phone_clipboard[] = {
     64 	DEFCMD("f", "from phone", "phone-clipboard | xclip && xclip -o | xargs notify-send")
     65 	DEFCMD("t", "to phone", "xclip -o | xargs phone-clipboard")
     66 };
     67 
     68 static struct command phone_commands[] = {
     69 	DEFCMD("b", "battery", "n phone-batt")
     70 	DEFPREFIX("c", "clipboard", phone_clipboard)
     71 	DEFCMD("r", "ring", "n phonectl ring:100")
     72 	DEFCMD("s", "stop ring", "n phonectl ring:stop")
     73 	DEFPREFIX("m", "music", phone_music_commands)
     74 };
     75 
     76 static struct command email_notifications[] = {
     77 	DEFCMD("1", "on", "nostat +h && n echo email notifications on")
     78 	DEFCMD("0", "off", "nostat -h && n echo email notifications off")
     79 	DEFCMD("n", "status", "n nostat")
     80 };
     81 
     82 static struct command email_commands[] = {
     83 	DEFCMD("c", "inbox zero", "n email-count")
     84 	DEFCMD("f", "fetch", "email-fetch")
     85 	DEFCMD("m", "sync monad", "n muchsync monad-local")
     86 	DEFCMD("s", "status", "n email-status-once")
     87 	DEFPREFIX("n", "notifications", email_notifications)
     88 };
     89 
     90 static struct command vm_commands[] = {
     91 	DEFCMD("p", "pause/resume", "vmtoggle")
     92 	DEFCMD("c", "close", "vmclose")
     93 	DEFCMD("v", "virtualbox", "VirtualBox")
     94 };
     95 
     96 
     97 static struct command sync_commands[] = {
     98 	DEFCMD("t", "quiver -> monad", "n sync-todo quiver monad")
     99 	DEFCMD("f", "monad -> quiver", "n sync-todo monad quiver")
    100 };
    101 
    102 static struct command theme_commands[] = {
    103 	DEFCMD("d", "dark", "themeswitch dark")
    104 	DEFCMD("l", "light", "themeswitch light")
    105 };
    106 
    107 static struct command snap_commands[] = {
    108 	DEFCMD("F", "full no upload", "snap -n")
    109 	DEFCMD("f", "full", "snap")
    110 	DEFCMD("S", "selection no upload", "sleep 0.2; snap -n -s")
    111 	DEFCMD("s", "selection", "sleep 0.2; snap -s")
    112 	DEFCMD("d", "dragon last ss", "dragon $(last_ss)")
    113 	DEFCMD("D", "select no upload dragon", "sleep 0.2; snap -n -s; sleep 0.2; dragon $(last_ss)")
    114 };
    115 
    116 //static struct command query_commands[] = {
    117 //	DEFCMD("u", "urban-dict", "dmenupn ud ud -plain")
    118 //};
    119 
    120 static struct command focus_commands[] = {
    121 	DEFCMD("z", "zoom", "focus-zoom")
    122 	DEFCMD("s", "signal", "wmctrl -a Signal")
    123 	DEFCMD("b", "browser", "wmctrl -a qutebrowser")
    124 	DEFCMD("a", "android", "wmctrl -a 'Android Studio'")
    125 	DEFCMD("w", "wow", "focus-wow")
    126 	DEFCMD("p", "pdf", "wmctrl -a pdf")
    127 };
    128 
    129 static struct command notify_commands[] = {
    130 	DEFCMD("c", "close all", "dunstctl close-all")
    131 	DEFCMD("C", "close last", "dunstctl close")
    132 	DEFCMD("n", "open last", "dunstctl history-pop")
    133 	DEFCMD("N", "open last 5", "dunstctl history-pop;dunstctl history-pop;dunstctl history-pop;dunstctl history-pop;dunstctl history-pop")
    134 };
    135 
    136 static struct command kill_commands[] = {
    137 	DEFCMD("z", "zoom", "pkill zoom")
    138 	DEFCMD("m", "spotify", "/home/jb55/bin/killspotify")
    139 	DEFCMD("s", "signal", "pkill --oldest signal-desktop")
    140 	DEFCMD("S", "skype", "pkill --oldest skype")
    141 	DEFCMD("b", "browser", "browser kill")
    142 };
    143 
    144 static struct command window_commands[] = {
    145 	DEFPREFIX("s", "snap", snap_commands)
    146 	DEFPREFIX("t", "theme", theme_commands)
    147 	DEFPREFIX("k", "kill", kill_commands)
    148 	DEFPREFIX("f", "focus", focus_commands)
    149 	DEFCMD("b", "bright", "bright")
    150 	DEFCMD("c", "colorpick", "colorpick")
    151 	DEFCMD("w", "switch", "dswitcher")
    152 };
    153 
    154 static struct command restart_commands[] = {
    155 	DEFCMD("s", "spotifyd", "systemctl --user restart spotifyd && notify-send restarted spotfyd")
    156 	DEFCMD("e", "emacs", "systemctl --user restart emacs && notify-send restarted emacs")
    157 	DEFCMD("p", "phonectl", "systemctl --user restart phonectl && notify-send restarted phonectl")
    158 };
    159 
    160 static struct command system_commands[] = {
    161 	DEFPREFIX("c", "copy/sync", sync_commands)
    162 	DEFPREFIX("r", "restart services", restart_commands)
    163 	DEFCMD("S", "suspend", "suspend")
    164 	DEFCMD("s", "my suspend", "my-suspend")
    165 	DEFCMD("k", "kill session", "killsession")
    166 };
    167 
    168 static struct command issue_commands[] = {
    169 	DEFCMD("l", "lightning issue", "xclip -o | head -n1 | xargs ghissue ElementsProject lightning")
    170 	DEFCMD("b", "bitcoin issue", "xclip -o | head -n1 | xargs ghissue bitcoin bitcoin")
    171 };
    172 
    173 static struct command calendar_commands[] = {
    174 	DEFCMD("c", "viscal", "/home/jb55/src/c/viscal/open-my-cals")
    175 	DEFCMD("s", "viscal-sync", "/home/jb55/src/c/viscal/sync")
    176 	DEFCMD("m", "to-monad", "rsync -avzP /home/jb55/var/cal/ 172.24.242.111:/home/jb55/var/cal/")
    177 	DEFCMD("M", "from-monad", "rsync -avzP 172.24.242.111:/home/jb55/var/cal/ /home/jb55/var/cal/ && n echo done || n echo failed")
    178 };
    179 
    180 static struct command auth_commands[] = {
    181 	DEFCMD("p", "lastpass", "dmenu-lpass")
    182 	DEFCMD("o", "otp", "n otp | xclip")
    183 };
    184 
    185 static struct command app_commands[] = {
    186 	DEFPREFIX("c", "calendar", calendar_commands)
    187 	DEFPREFIX("a", "auth", auth_commands)
    188 	DEFPREFIX("v", "vm", vm_commands)
    189 	DEFCMD("b", "browser", "browser")
    190 	DEFCMD("B", "browser-work", "browser -r work")
    191 	DEFCMD("e", "edit", "edit -c")
    192 	DEFCMD("s", "signal", "signal-desktop")
    193 	DEFCMD("m", "spotify", "spotify")
    194 	DEFCMD("S", "skype", "skypeforlinux")
    195 	DEFCMD("q", "qalc", "dmenupn calc qalc -t")
    196 	DEFCMD("z", "zoom", "zoom-us")
    197 };
    198 
    199 /* static struct command spotify_commands[] = { */
    200 /* 	DEFCMD("n", "next", "spotify-next") */
    201 /* 	DEFCMD("p", "prev", "spotify-prev") */
    202 /* 	DEFCMD(" ", "play/pause", "spotify-playpause") */
    203 /* }; */
    204 
    205 
    206 static struct command media_commands[] = {
    207 	DEFPREFIX("c", "chromecast", chromecast_commands)
    208 	DEFCMD("b", "connect-bose", "connect-bose")
    209 	DEFCMD("n", "next", "spotify-next")
    210 	DEFCMD("p", "prev", "spotify-prev")
    211 	DEFCMD(" ", "play/pause", "spotify-playpause")
    212 	/* DEFPREFIX("s", "spotify", spotify_commands) */
    213 	DEFCMD("k", "vol+", "amixer sset Master 10%+")
    214 	DEFCMD("j", "vol-", "amixer sset Master 10%-")
    215 };
    216 
    217 static struct command date_commands[] = {
    218 	DEFCMD("d", "local", "n mydate")
    219 	DEFCMD("u", "utc", "n mydate -u")
    220 	DEFCMD("l", "utc-local", "dmenupn localutc localutc")
    221 };
    222 
    223 static struct command open_doc_commands[] = {
    224 	DEFCMD("p", "downloads pdf", "open-dl /home/jb55/Downloads pdf")
    225 	DEFCMD("P", "papers pdf", "open-dl /home/jb55/docs/papers pdf")
    226 	DEFCMD("c", "edit clipboard", "edit-clipboard")
    227 	DEFCMD("d", "docs pdf", "open-dl /home/jb55/docs pdf")
    228 };
    229 
    230 static struct command open_zoom_commands[] = {
    231 	DEFCMD("s", "steamoji-standup", "steamoji-zoom")
    232 	DEFCMD("z", "zoom link", "xclip -o | xargs zoom-link-opener")
    233 	DEFCMD("i", "zoom id", "xclip -o | xargs zoom-id")
    234 };
    235 
    236 static struct command open_commands[] = {
    237 	DEFPREFIX("d", "documents", open_doc_commands)
    238 	DEFPREFIX("i", "issues", issue_commands)
    239 	//DEFPREFIX("q", "query", query_commands)
    240 	DEFPREFIX("z", "zoom", open_zoom_commands)
    241 	DEFCMD("s", "spotify", "xclip -o | xargs spotify-open")
    242 	DEFCMD("u", "urban-dict", "dmenupn ud ud -plain")
    243 };
    244 
    245 static struct command commands[] = {
    246 	DEFPREFIX("B", "bitcoin", bitcoin_commands)
    247 	DEFPREFIX("a", "apps", app_commands)
    248 	DEFPREFIX("e", "email", email_commands)
    249 	DEFPREFIX("m", "media", media_commands)
    250 	DEFPREFIX("p", "phone", phone_commands)
    251 	DEFPREFIX("s", "system", system_commands)
    252 	DEFPREFIX("w", "window", window_commands)
    253 	DEFPREFIX("d", "date", date_commands)
    254 	DEFPREFIX("n", "notify", notify_commands)
    255 	DEFPREFIX("o", "open", open_commands)
    256 	DEFCMD("b", "battery", "n acpi")
    257 	DEFCMD("l", "lock", "lock")
    258 	DEFCMD("u", "clip", "dclip")
    259 };