From a3e84258a9289834ee9fed6b14d4f4bbeb6a41ba Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Thu, 24 Dec 2020 23:33:23 +0300 Subject: [PATCH] Get rid of gcalcli --- modules/default.nix | 1 - modules/workspace/gcalcli.nix | 37 ------------------- modules/workspace/i3blocks/default.nix | 2 +- .../workspace/i3blocks/scripts/calendar.nix | 22 ----------- .../workspace/i3blocks/scripts/default.nix | 1 - 5 files changed, 1 insertion(+), 62 deletions(-) delete mode 100644 modules/workspace/gcalcli.nix delete mode 100644 modules/workspace/i3blocks/scripts/calendar.nix diff --git a/modules/default.nix b/modules/default.nix index 1c79d30..534e144 100755 --- a/modules/default.nix +++ b/modules/default.nix @@ -23,7 +23,6 @@ device: ./workspace/light.nix ./workspace/mako.nix ./workspace/mopidy.nix - ./workspace/gcalcli.nix ./workspace/xresources.nix ./themes.nix ./applications.nix diff --git a/modules/workspace/gcalcli.nix b/modules/workspace/gcalcli.nix deleted file mode 100644 index bd44696..0000000 --- a/modules/workspace/gcalcli.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ pkgs, lib, config, ... }: { - home-manager.users.balsoft = lib.mkIf (! isNull config.secrets.gcal) { - home.file.".gcalcli_oauth.home".text = lib.optionals - (!(isNull config.secrets.gcal)) (builtins.toJSON { - access_token = ""; - client_id = config.secrets.gcal.client-id; - client_secret = config.secrets.gcal.client-secret; - refresh_token = config.secrets.gcal.refresh-token; - token_expiry = "2019-03-31T11:26:27Z"; - token_uri = https://oauth2.googleapis.com/token; - user_agent = "gcalcli/v4.0.4"; - revoke_uri = "https=//oauth2.googleapis.com/revoke"; - id_token = null; - id_token_jwt = null; - token_response = { - access_token = ""; - expires_in = 0; - scope = - "https=//www.googleapis.com/auth/urlshortener https=//www.googleapis.com/auth/calendar"; - token_type = "Bearer"; - }; - scopes = [ - "https=//www.googleapis.com/auth/calendar" - "https=//www.googleapis.com/auth/urlshortener" - ]; - token_info_uri = "https=//oauth2.googleapis.com/tokeninfo"; - invalid = false; - _class = "OAuth2Credentials"; - _module = "oauth2client.client"; - }); - home.activation.gcalcli = { - after = ["linkGeneration"]; - before = []; - data = "cp .gcalcli_oauth.home .gcalcli_oauth"; - }; - }; -} diff --git a/modules/workspace/i3blocks/default.nix b/modules/workspace/i3blocks/default.nix index 038c604..b184d0b 100644 --- a/modules/workspace/i3blocks/default.nix +++ b/modules/workspace/i3blocks/default.nix @@ -40,7 +40,7 @@ in { interval=60 markup=pango '' + genIniOrdered (optional (!isNull config.secrets.mail) (scr "email") - ++ [ (scrint "weather" 600) (scr "calendar") (scr "emacs") (scr "nixos") ] + ++ [ (scrint "weather" 600) (scr "emacs") (scr "nixos") ] ++ optional (!isNull config.secrets.wage) (scrint "youtrack-wage" 3600) ++ [ (scrint "music" 3) (scrint "sound" 1) ] ++ [ (scrint "cpu" 5) diff --git a/modules/workspace/i3blocks/scripts/calendar.nix b/modules/workspace/i3blocks/scripts/calendar.nix deleted file mode 100644 index e5adf78..0000000 --- a/modules/workspace/i3blocks/scripts/calendar.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ config, gcalcli, bash, iconfont, ... }: '' - #!${bash}/bin/bash - ping -c 1 calendar.google.com &> /dev/null || exit 1 - AGENDA_NEXT="`PYTHONIOENCODING=utf8 ${ - gcalcli - }/bin/gcalcli --nocolor search "*" 'now' 'now+6d' --nostarted --tsv | head -1`" - DATE="`awk '{print $1 " " $2}' <<< "$AGENDA_NEXT"`" - echo -n " " - if [[ `date -d "$DATE" +'%u'` -eq `date +'%u'` ]] - then - echo -n `date -d "$DATE" +'%H:%M'` - else - echo -n `date -d "$DATE" +'%H:%M %a'` - fi - if [[ $((`date -d "$DATE" +%s`-`date +%s`)) -lt 1800 ]] - then - code=33 - else - code=0 - fi - echo ":`awk '{$1=""; $2=""; $3=""; $4=""; print}' <<< "$AGENDA_NEXT" | tr -s " " | tr -s " "`" -'' diff --git a/modules/workspace/i3blocks/scripts/default.nix b/modules/workspace/i3blocks/scripts/default.nix index 30f3c02..d4a522e 100644 --- a/modules/workspace/i3blocks/scripts/default.nix +++ b/modules/workspace/i3blocks/scripts/default.nix @@ -31,7 +31,6 @@ builtins.mapAttrs buildHaskellScript { } // builtins.mapAttrs writeScript { battery = ./battery.nix; brightness = ./brightness.nix; - calendar = ./calendar.nix; email = ./email.nix; emacs = ./emacs.nix; bluetooth = ./bluetooth.nix;