summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2020-05-25 16:08:23 +0200
committerlassulus <lassulus@lassul.us>2020-05-25 16:08:23 +0200
commitbbbf850e2b8f98a0d4067cded1ea21b0b596a37d (patch)
treea6613c206370a0f6ccae7bcbc2679f1e0e95b958
parent5d6b454ff9d9c86181374b28ed041b33f58f7663 (diff)
parent18accefeaf45648e8e88da3a9f97ecc49a59c833 (diff)
Merge remote-tracking branch 'ni/master'
-rw-r--r--tv/2configs/imgur.nix25
-rw-r--r--tv/2configs/xserver/default.nix7
-rw-r--r--tv/5pkgs/haskell/xmonad-tv/src/Paths.hs3
-rw-r--r--tv/5pkgs/haskell/xmonad-tv/src/main.hs7
4 files changed, 41 insertions, 1 deletions
diff --git a/tv/2configs/imgur.nix b/tv/2configs/imgur.nix
new file mode 100644
index 0000000..ba84fd2
--- /dev/null
+++ b/tv/2configs/imgur.nix
@@ -0,0 +1,25 @@
+with import <stockholm/lib>;
+{ config, pkgs, ... }: {
+
+ services.nginx.virtualHosts."ni.r" = {
+ locations."/image" = {
+ extraConfig = /* nginx */ ''
+ client_max_body_size 20M;
+
+ proxy_set_header Host $host;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+
+ proxy_pass http://127.0.0.1:${toString config.krebs.htgen.imgur.port};
+ proxy_pass_header Server;
+ '';
+ };
+ };
+
+ krebs.htgen.imgur = {
+ port = 7771;
+ script = /* sh */ ''
+ (. ${pkgs.htgen-imgur}/bin/htgen-imgur)
+ '';
+ };
+}
diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix
index 3577445..4e9e307 100644
--- a/tv/2configs/xserver/default.nix
+++ b/tv/2configs/xserver/default.nix
@@ -108,6 +108,13 @@ in {
};
path = [
config.tv.slock.package
+ (pkgs.flameshot-once.override {
+ config.imgur.enable = true;
+ config.imgur.createUrl = "http://ni.r/image";
+ config.imgur.deleteUrl = "http://ni.r/image/delete/%1";
+ config.imgur.xdg-open.browser = "/etc/profiles/per-user/tv/bin/cr";
+ config.timeout = 200;
+ })
pkgs.fzmenu
pkgs.pulseaudioLight.out
pkgs.rxvt_unicode
diff --git a/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs b/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs
index dd21511..6b72355 100644
--- a/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs
+++ b/tv/5pkgs/haskell/xmonad-tv/src/Paths.hs
@@ -3,6 +3,9 @@ module Paths where
import Helpers.Path
+flameshot :: FilePath
+flameshot = findExecutable "flameshot-once"
+
otpmenu :: FilePath
otpmenu = findExecutable "otpmenu"
diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs
index 400c87a..047239e 100644
--- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs
+++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs
@@ -22,7 +22,8 @@ import qualified XMonad.StackSet as W
import Data.Map (Map)
import qualified Data.Map as Map
import XMonad.Hooks.UrgencyHook (SpawnUrgencyHook(..), withUrgencyHook)
-import XMonad.Hooks.ManageHelpers (doCenterFloat)
+import XMonad.Hooks.ManageHelpers (doCenterFloat,doRectFloat)
+import Data.Ratio
import XMonad.Hooks.Place (placeHook, smart)
import XMonad.Actions.PerWorkspaceKeys (chooseAction)
@@ -66,6 +67,8 @@ mainNoArgs = do
composeAll
[ appName =? "fzmenu-urxvt" --> doCenterFloat
, appName =? "pinentry" --> doCenterFloat
+ , title =? "Upload to Imgur" -->
+ doRectFloat (W.RationalRect 0 0 (1 % 8) (1 % 8))
, placeHook (smart (1,0))
]
, startupHook =
@@ -163,6 +166,8 @@ myKeys conf = Map.fromList $
, ((_4, xF86XK_AudioMute), pavucontrol [])
, ((_4, xK_Prior), forkFile Paths.xcalib ["-invert", "-alter"] Nothing)
+
+ , ((0, xK_Print), forkFile Paths.flameshot [] Nothing)
]
where
_4 = mod4Mask