diff --git a/configs/nvim/init.vim b/configs/nvim/init.vim index cab8e5d..14f4ce4 100644 --- a/configs/nvim/init.vim +++ b/configs/nvim/init.vim @@ -30,9 +30,6 @@ endif " Enable Leap lua require('leap').add_default_mappings() -" Enable Helix-style command suggestions -"lua require('command-completion').setup() - " Enable trailing space detection lua require('mini.trailspace').setup() @@ -43,15 +40,3 @@ highlight Pmenu ctermbg=none ctermfg=white nnoremap :Commentary vnoremap :Commentary inoremap :Commentary - -" Custom functions -function! MkdirAndWrite() - let dir = expand('%:p:h') - exec '!mkdir -p ' . dir - exec 'w' -endfunction -command Wmk call MkdirAndWrite() - -" LSP Support -"lua require "lspconfig".rust_analyzer.setup {} -"lua vim.keymap.set('n', 'e', vim.diagnostic.open_float) diff --git a/configs/systemd/user/sync-guru-issues.service b/configs/systemd/user/sync-guru-issues.service new file mode 100644 index 0000000..657b566 --- /dev/null +++ b/configs/systemd/user/sync-guru-issues.service @@ -0,0 +1,6 @@ +[Unit] +Description = Sync Guru GitLab issues to Trello + +[Service] +Type = oneshot +ExecStart = python3 %h/.config/ewconfig/scripts/guru-sync-issues \ No newline at end of file diff --git a/configs/systemd/user/sync-guru-issues.timer b/configs/systemd/user/sync-guru-issues.timer new file mode 100644 index 0000000..39419ac --- /dev/null +++ b/configs/systemd/user/sync-guru-issues.timer @@ -0,0 +1,9 @@ +[Unit] +Description = Sync Guru GitLab issues to Trello + +[Timer] +OnCalendar = hourly +Persistent = true + +[Install] +WantedBy = timers.target diff --git a/scripts/guru-sync-issues b/scripts/guru-sync-issues index 33216e8..99c118b 100755 --- a/scripts/guru-sync-issues +++ b/scripts/guru-sync-issues @@ -1,4 +1,5 @@ #! /usr/bin/env python3 +# NOTE: This script might be called by systemd. Run `systemctl --user list-timers --all` to see if it is active # fmt:off import sys @@ -175,6 +176,13 @@ def main() -> int: level=logging.DEBUG if args.verbose else logging.INFO, format="%(levelname)s: %(message)s", ) + + # Try to ping the gitlab server, and exit if it fails + try: + requests.get(GITLAB_ENDPOINT) + except requests.exceptions.ConnectionError: + logger.error("Could not connect to GitLab server") + return 1 # Find all issues issues = get_personal_gitlab_issues()