From ceaa2d1671ec036e2f56dcf3cba1b966c5fc3c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 4 Nov 2022 14:07:37 +0100 Subject: [PATCH 01/15] Make rssVideos use release date --- config/scripts/rssVideos | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config/scripts/rssVideos b/config/scripts/rssVideos index c95866f..2219d55 100755 --- a/config/scripts/rssVideos +++ b/config/scripts/rssVideos @@ -148,7 +148,12 @@ class RVElement: @property def date(self) -> datetime.datetime: - return datetime.datetime.fromtimestamp(self.item["published"]) + timestamp = ( + int(self.item.get("timestampUsec", "0")) / 1000000 + or int(self.item.get("crawlTimeMsec", "0")) / 1000 + or self.item["published"] + ) + return datetime.datetime.fromtimestamp(timestamp) @property def is_researched(self) -> bool: @@ -475,7 +480,7 @@ class RVDatabase: def ytdl_opts(self) -> dict: # Get user/system options prev_argv = sys.argv - sys.argv = ['yt-dlp'] + sys.argv = ["yt-dlp"] _, _, _, ydl_opts = yt_dlp.parse_options() sys.argv = prev_argv return ydl_opts From 060e9db9957da9558e2964b5fdb05fd9f26b65a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 4 Nov 2022 14:09:01 +0100 Subject: [PATCH 02/15] picture_name_date: Remove progress bar supportsuffixes --- config/scripts/picture_name_date | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/config/scripts/picture_name_date b/config/scripts/picture_name_date index 4cf0df8..c39976c 100755 --- a/config/scripts/picture_name_date +++ b/config/scripts/picture_name_date @@ -9,7 +9,6 @@ import typing import coloredlogs import exifread -import progressbar log = logging.getLogger(__name__) coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s", logger=log) @@ -38,12 +37,7 @@ def main(args: argparse.Namespace) -> None: log.warning("Counting files...") kwargs = {"directory": args.dir, "skip_renamed": args.skip_renamed} log.warning("Processing files...") - if args.hide_bar: - iterator = get_pictures(**kwargs) - else: - nb_imgs = len(list(get_pictures(**kwargs))) - iterator = progressbar.progressbar(get_pictures(**kwargs), max_value=nb_imgs) - for full_path in iterator: + for full_path in get_pictures(**kwargs): # Find date with open(full_path, 'rb') as fd: exif_data = exifread.process_file(fd) @@ -62,7 +56,7 @@ def main(args: argparse.Namespace) -> None: ext = os.path.splitext(full_path)[1].lower() if ext == '.jpeg': ext = '.jpg' - new_name = date.isoformat().replace(":", "-").replace("T", "_") + new_name = date.isoformat().replace(":", "-").replace("T", "_") + args.suffix # First substitution is to allow images being sent to a NTFS filesystem # Second substitution is for esthetics new_path = os.path.join(args.dir, f"{new_name}{ext}") @@ -71,7 +65,7 @@ def main(args: argparse.Namespace) -> None: while os.path.exists(new_path): if full_path == new_path: break - log.debug(f"{full_path} already exists, incrementing") + log.debug(f"{new_path} already exists, incrementing") i += 1 new_path = os.path.join(args.dir, f"{new_name}_{i}{ext}") @@ -103,16 +97,16 @@ if __name__ == "__main__": help="Do not actually rename, just show old and new path", ) parser.add_argument( - "-s", + "-r", "--skip-renamed", action="store_true", help="Skip images whose filename doesn't match usual camera output filenames.", ) parser.add_argument( - "-b", - "--hide-bar", - action="store_true", - help="Do not show a progress bar. Also skip counting images", + "-s", + "--suffix", + default="", + help="Text to add before the extension", ) args = parser.parse_args() main(args) From 4030606ec8fd45b92f7209b2663c398c6682fefe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 4 Nov 2022 14:12:16 +0100 Subject: [PATCH 03/15] Add screen brightness in jour/nuit/crepuscule Wanted to do that in Ansible but those things have been living in the script themselves forever and making this repo never fully commited, got fed up of that and made a loosy "if $HOSTNAME" so I can move on wit it. Still need to do the same on the other devices though. --- config/scripts/crepuscule | 8 ++++---- config/scripts/jour | 8 ++++---- config/scripts/nuit | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/config/scripts/crepuscule b/config/scripts/crepuscule index ebd3d53..88c2fbc 100755 --- a/config/scripts/crepuscule +++ b/config/scripts/crepuscule @@ -1,7 +1,7 @@ #!/usr/bin/env bash -# TODO De-hardcode - -echo 30000 | sudo tee /sys/class/backlight/intel_backlight/brightness -xrandr --output HDMI-0 --brightness 1 +if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] +then + echo 10000 | sudo tee /sys/class/backlight/intel_backlight/brightness +fi automatrop -e base16_scheme=solarized-dark --tags color diff --git a/config/scripts/jour b/config/scripts/jour index f251dd7..f190896 100755 --- a/config/scripts/jour +++ b/config/scripts/jour @@ -1,7 +1,7 @@ #!/usr/bin/env bash -# TODO De-hardcode - -echo 30000 | sudo tee /sys/class/backlight/intel_backlight/brightness -xrandr --output HDMI-0 --brightness 1 +if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] +then + echo 40000 | sudo tee /sys/class/backlight/intel_backlight/brightness +fi automatrop -e base16_scheme=solarized-light --tags color diff --git a/config/scripts/nuit b/config/scripts/nuit index e6a4954..a59ce4c 100755 --- a/config/scripts/nuit +++ b/config/scripts/nuit @@ -1,7 +1,7 @@ #!/usr/bin/env bash -# TODO De-hardcode - -echo 1 | sudo tee /sys/class/backlight/intel_backlight/brightness -xrandr --output HDMI-0 --brightness 0.5 +if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ] +then + echo 1 | sudo tee /sys/class/backlight/intel_backlight/brightness +fi automatrop -e base16_scheme=solarized-dark --tags color From d5e9cc22734fddd21617b7f5adac39b8920fd8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 4 Nov 2022 14:13:55 +0100 Subject: [PATCH 04/15] camera_name_date: formatting pass --- config/scripts/camera_name_date | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/scripts/camera_name_date b/config/scripts/camera_name_date index eed88e3..0001baa 100755 --- a/config/scripts/camera_name_date +++ b/config/scripts/camera_name_date @@ -67,8 +67,8 @@ def main(args: argparse.Namespace) -> None: new_filename = ( f"{m['Y']}-{m['M']}-{m['D']}_" f"{m['h']}-{m['m']}-{m['s']}" - f"{m.get('dup', '')}" - f"{m.get('spec', '')}" + f"{m.get('dup') or ''}" + f"{m.get('spec') or ''}" f"{args.suffix}" f".{m['ext']}" ) From 9fac2c370107d0397e9f505cbe8baeb981959318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 4 Nov 2022 14:14:13 +0100 Subject: [PATCH 05/15] cached_pass: Re-ask password if previously failed --- config/scripts/cached_pass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/scripts/cached_pass b/config/scripts/cached_pass index b92f6ec..401b797 100755 --- a/config/scripts/cached_pass +++ b/config/scripts/cached_pass @@ -19,7 +19,7 @@ chmod 700 "$BASEDIR" name_base64="$(echo "$name" | base64)" file="${BASEDIR}/${name_base64}" -if [ ! -f "${file}" ] +if [ ! -s "${file}" ] then notify-send -u low "cached_pass" "Asking to cache: ${name}" pass ${name} > "${file}" From eddb48e461f806faa633c27c1f65e6a57f020d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 4 Nov 2022 14:15:01 +0100 Subject: [PATCH 06/15] Disable power button Oh I didn't commit this, probably why I still have the problem on the Pinebook x) --- config/automatrop/roles/system/handlers/main.yaml | 5 +++++ config/automatrop/roles/system/tasks/main.yml | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/config/automatrop/roles/system/handlers/main.yaml b/config/automatrop/roles/system/handlers/main.yaml index b7065d7..595a97f 100644 --- a/config/automatrop/roles/system/handlers/main.yaml +++ b/config/automatrop/roles/system/handlers/main.yaml @@ -39,3 +39,8 @@ debug: msg: "The Panfrost display driver configuration was changed, but needs a reboot to be applied." listen: panfrost config changed + +- name: Reload systemd-logind + command: systemctl kill -s HUP systemd-logind + become: yes + listen: systemd-logind config changed diff --git a/config/automatrop/roles/system/tasks/main.yml b/config/automatrop/roles/system/tasks/main.yml index 262ff40..aade07b 100644 --- a/config/automatrop/roles/system/tasks/main.yml +++ b/config/automatrop/roles/system/tasks/main.yml @@ -356,6 +356,19 @@ - etc changed - systemd changed +- name: Disable power button + lineinfile: + path: /etc/systemd/logind.conf + line: 'HandlePowerKey=ignore' + regexp: '^#? *HandlePowerKey=' + insertafter: '^\[Login\]$' + become: yes + notify: systemd-logind config changed + # Reason: I sometimes press it accidentally + # (hoping to start it when it's already started, + # or really accidentally on the Pinebook). + # Suspend would be nice, but it doesn't have the locker then + # TODO Hibernation, if that's relevant # $ sudo blkid | grep 'TYPE="swap"' # $ sudoedit /etc/default/grub From 0d86e537d11586f74220378efcf09cb210918c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 4 Nov 2022 14:19:38 +0100 Subject: [PATCH 07/15] Apparently it's Intel Graphics? --- config/automatrop/roles/system/files/xorg/intel_backlight.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/automatrop/roles/system/files/xorg/intel_backlight.conf b/config/automatrop/roles/system/files/xorg/intel_backlight.conf index 6b68693..36f6eb5 100644 --- a/config/automatrop/roles/system/files/xorg/intel_backlight.conf +++ b/config/automatrop/roles/system/files/xorg/intel_backlight.conf @@ -1,5 +1,5 @@ Section "Device" - Identifier "intel" + Identifier "Intel Graphics" Driver "intel" Option "Backlight" "intel_backlight" EndSection From f86c4d1882933b8f603d876d6c09df43bad4de4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 4 Nov 2022 17:46:44 +0100 Subject: [PATCH 08/15] Fix nvim plugins --- .../vim/templates/plugins/nvim_lspconfig.j2 | 8 ++-- .../roles/vim/templates/plugins/treesitter.j2 | 39 ++++++++++++++++++- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 b/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 index 1c23972..31ff649 100644 --- a/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 +++ b/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 @@ -29,10 +29,10 @@ local on_attach = function(client, bufnr) buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) -- buf_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) -- buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) - buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) - buf_set_keymap('n', '[e', 'lua vim.lsp.diagnostic.goto_prev()', opts) - buf_set_keymap('n', ']e', 'lua vim.lsp.diagnostic.goto_next()', opts) --- buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) + buf_set_keymap('n', 'e', 'lua vim.diagnostic.open_float(0, {scope="cursor"})', opts) + buf_set_keymap('n', '[e', 'lua vim.diagnostic.goto_prev()', opts) + buf_set_keymap('n', ']e', 'lua vim.diagnostic.goto_next()', opts) +-- buf_set_keymap('n', 'q', 'lua vim.diagnostic.set_loclist()', opts) buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) buf_set_keymap("v", "f", "lua vim.lsp.buf.range_formatting()", opts) diff --git a/config/automatrop/roles/vim/templates/plugins/treesitter.j2 b/config/automatrop/roles/vim/templates/plugins/treesitter.j2 index be789d8..c4ded51 100644 --- a/config/automatrop/roles/vim/templates/plugins/treesitter.j2 +++ b/config/automatrop/roles/vim/templates/plugins/treesitter.j2 @@ -5,7 +5,44 @@ #} lua < Date: Fri, 4 Nov 2022 20:21:49 +0100 Subject: [PATCH 09/15] nvim: Modernize lspconfig... config --- .../vim/templates/plugins/nvim_lspconfig.j2 | 54 +++++++++---------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 b/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 index 31ff649..187810d 100644 --- a/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 +++ b/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 @@ -3,39 +3,38 @@ lua << EOF local nvim_lsp = require('lspconfig') +-- Mappings. +-- See `:help vim.diagnostic.*` for documentation on any of the below functions +local opts = { noremap=true, silent=true } +vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) +vim.keymap.set('n', '[e', vim.diagnostic.goto_prev, opts) +vim.keymap.set('n', ']e', vim.diagnostic.goto_next, opts) +-- vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) + -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer local on_attach = function(client, bufnr) - - local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end - local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end - - --Enable completion triggered by - buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') + -- Enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') -- Mappings. - local opts = { noremap=true, silent=true } - -- See `:help vim.lsp.*` for documentation on any of the below functions - buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) --- buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) - buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) - buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) - buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) - buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) - buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) - buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) - buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) - buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) --- buf_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) --- buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) - buf_set_keymap('n', 'e', 'lua vim.diagnostic.open_float(0, {scope="cursor"})', opts) - buf_set_keymap('n', '[e', 'lua vim.diagnostic.goto_prev()', opts) - buf_set_keymap('n', ']e', 'lua vim.diagnostic.goto_next()', opts) --- buf_set_keymap('n', 'q', 'lua vim.diagnostic.set_loclist()', opts) - buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) - buf_set_keymap("v", "f", "lua vim.lsp.buf.range_formatting()", opts) - + local bufopts = { noremap=true, silent=true, buffer=bufnr } + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) +-- vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) + vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufopts) + vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) + vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) + vim.keymap.set('n', 'wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, bufopts) + vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, bufopts) +-- vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, bufopts) +-- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) + vim.keymap.set('n', 'f', function() vim.lsp.buf.format { async = true } end, bufopts) end -- Use a loop to conveniently call 'setup' on multiple servers and @@ -56,7 +55,6 @@ for _, lsp in ipairs(servers) do on_attach = on_attach, flags = { debounce_text_changes = 150, - } } end From dfee5340c424bbaa429a715c6aaf22361794afa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 20 Nov 2022 14:00:57 +0100 Subject: [PATCH 10/15] Make use of i3 new "daemon" mode --- config/i3/config.j2 | 2 +- config/i3/terminal | 3 +++ config/shell/shrc | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100755 config/i3/terminal diff --git a/config/i3/config.j2 b/config/i3/config.j2 index eb7c452..95f4963 100644 --- a/config/i3/config.j2 +++ b/config/i3/config.j2 @@ -50,7 +50,7 @@ bindsym $mod+Shift+d exec --no-startup-id rofi -modi drun -show drun # Start Applications # bindsym $mod+Return exec urxvtc -bindsym $mod+Return exec alacritty -e zsh +bindsym $mod+Return exec ~/.config/i3/terminal bindsym $mod+Shift+Return exec urxvt bindsym $mod+p exec thunar bindsym $mod+m exec qutebrowser --override-restore --backend=webengine diff --git a/config/i3/terminal b/config/i3/terminal new file mode 100755 index 0000000..8426c9b --- /dev/null +++ b/config/i3/terminal @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +alacritty msg create-window || exec alacritty -e zsh diff --git a/config/shell/shrc b/config/shell/shrc index e0bc1dd..7be4a5e 100644 --- a/config/shell/shrc +++ b/config/shell/shrc @@ -31,7 +31,7 @@ alias please=sudo alias ll="ls -l" alias la="ls -la" alias s='sudo -s -E' -alias n='alacritty & disown' +alias n='$HOME/.config/i3/terminal & disown' alias x='startx $HOME/.config/xinitrc; logout' alias nx='nvidia-xrun $HOME/.config/xinitrc; sudo systemctl start nvidia-xrun-pm; logout' From 154615ff02f322b54ce765477c917dccd74b102c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sun, 20 Nov 2022 14:01:21 +0100 Subject: [PATCH 11/15] telescope stuff --- config/automatrop/roles/vim/templates/plugins/telescope.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/config/automatrop/roles/vim/templates/plugins/telescope.j2 b/config/automatrop/roles/vim/templates/plugins/telescope.j2 index ef9eadc..c8424ca 100644 --- a/config/automatrop/roles/vim/templates/plugins/telescope.j2 +++ b/config/automatrop/roles/vim/templates/plugins/telescope.j2 @@ -23,6 +23,7 @@ vnoremap ga Telescope lsp_range_code_actions noremap ge Telescope lsp_document_diagnostics noremap gE Telescope lsp_workspace_diagnostics noremap gd Telescope lsp_definitions +noremap gs Telescope lsp_document_symbols lua << EOF require('telescope').setup{ From 383336a0744a62e06874487dcdb8a199af55bce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 8 Dec 2022 10:56:47 +0100 Subject: [PATCH 12/15] Default color for gho --- config/automatrop/host_vars/gho.geoffrey.frogeye.fr | 1 + .../roles/desktop_environment/{vars => default}/main.yml | 0 2 files changed, 1 insertion(+) rename config/automatrop/roles/desktop_environment/{vars => default}/main.yml (100%) diff --git a/config/automatrop/host_vars/gho.geoffrey.frogeye.fr b/config/automatrop/host_vars/gho.geoffrey.frogeye.fr index 3aebfe0..0fb38cb 100644 --- a/config/automatrop/host_vars/gho.geoffrey.frogeye.fr +++ b/config/automatrop/host_vars/gho.geoffrey.frogeye.fr @@ -10,3 +10,4 @@ extensions: x11_screens: - HDMI-1 - HDMI-2 +base16_scheme: solarized-light diff --git a/config/automatrop/roles/desktop_environment/vars/main.yml b/config/automatrop/roles/desktop_environment/default/main.yml similarity index 100% rename from config/automatrop/roles/desktop_environment/vars/main.yml rename to config/automatrop/roles/desktop_environment/default/main.yml From 814f6cb71bd23d95f7875afd7c551d4dd0835f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 8 Dec 2022 10:57:28 +0100 Subject: [PATCH 13/15] i3 automatic screen workspace spread --- config/automatrop/roles/desktop_environment/tasks/main.yml | 2 ++ config/autorandr/postswitch | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/config/automatrop/roles/desktop_environment/tasks/main.yml b/config/automatrop/roles/desktop_environment/tasks/main.yml index 31a7f92..ce68c8e 100644 --- a/config/automatrop/roles/desktop_environment/tasks/main.yml +++ b/config/automatrop/roles/desktop_environment/tasks/main.yml @@ -55,6 +55,7 @@ register: base16_schemes tags: - color + - i3 - name: Configure Alacritty template: @@ -106,6 +107,7 @@ - i3-reload tags: - color + - i3 when: display_server == 'x11' - name: Set base16 theme for rofi diff --git a/config/autorandr/postswitch b/config/autorandr/postswitch index 145748f..bc03c7f 100755 --- a/config/autorandr/postswitch +++ b/config/autorandr/postswitch @@ -24,3 +24,9 @@ fi feh --no-fehbg --bg-fill "$filepath" +# Make i3 distribute the workspaces on all screens +monitors_json="$(xrandr --listmonitors | tail -n+2 | awk '{ print $4 }' | sed 's|.\+|"\0"|' | tr '\n' ',')" +automatrop -e '{"x11_screens":['"$monitors_json"']}' --tags i3 + +# TODO Make sure it goes from left to right +# Either with the "main" display or using the geometry data From 8e0d49307ae5a7bb36738c46a676deeb51502cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Thu, 8 Dec 2022 10:58:06 +0100 Subject: [PATCH 14/15] =?UTF-8?q?Add=20perl=20dev=20stuff=20=F0=9F=98=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/automatrop/host_vars/curacao.geoffrey.frogeye.fr | 1 + config/automatrop/host_vars/gho.geoffrey.frogeye.fr | 1 + .../roles/software/templates/snippets/pm_dev_perl.j2 | 3 +++ .../automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 | 3 +++ 4 files changed, 8 insertions(+) create mode 100644 config/automatrop/roles/software/templates/snippets/pm_dev_perl.j2 diff --git a/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr b/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr index fe7b3db..7fa997f 100644 --- a/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr +++ b/config/automatrop/host_vars/curacao.geoffrey.frogeye.fr @@ -4,6 +4,7 @@ dev_stuffs: - ansible - docker - network + - perl - php - python - shell diff --git a/config/automatrop/host_vars/gho.geoffrey.frogeye.fr b/config/automatrop/host_vars/gho.geoffrey.frogeye.fr index 0fb38cb..4b885a1 100644 --- a/config/automatrop/host_vars/gho.geoffrey.frogeye.fr +++ b/config/automatrop/host_vars/gho.geoffrey.frogeye.fr @@ -4,6 +4,7 @@ dev_stuffs: - shell - network - ansible + - perl - python extensions: - gh diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_perl.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_perl.j2 new file mode 100644 index 0000000..7349969 --- /dev/null +++ b/config/automatrop/roles/software/templates/snippets/pm_dev_perl.j2 @@ -0,0 +1,3 @@ +{% if arch_based %} +perl-perl-languageserver +{% endif %} diff --git a/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 b/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 index 187810d..afc236a 100644 --- a/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 +++ b/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 @@ -40,6 +40,9 @@ end -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches local servers = { +{% if 'perl' in dev_stuffs %} + "perlls", +{% endif %} {% if 'python' in dev_stuffs %} "pylsp", {% endif %} From 28e120146b42fbb498c0cc1eb5f127844590198e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Fri, 16 Dec 2022 16:14:19 +0100 Subject: [PATCH 15/15] Ansible language server --- .../roles/software/templates/snippets/pm_dev_ansible.j2 | 1 + .../automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 | 3 +++ 2 files changed, 4 insertions(+) diff --git a/config/automatrop/roles/software/templates/snippets/pm_dev_ansible.j2 b/config/automatrop/roles/software/templates/snippets/pm_dev_ansible.j2 index c0a684d..373384a 100644 --- a/config/automatrop/roles/software/templates/snippets/pm_dev_ansible.j2 +++ b/config/automatrop/roles/software/templates/snippets/pm_dev_ansible.j2 @@ -1,3 +1,4 @@ ansible ansible-lint +ansible-language-server {# EOF #} diff --git a/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 b/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 index afc236a..ec9f88e 100644 --- a/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 +++ b/config/automatrop/roles/vim/templates/plugins/nvim_lspconfig.j2 @@ -40,6 +40,9 @@ end -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches local servers = { +{% if 'ansible' in dev_stuffs %} + "ansiblels", +{% endif %} {% if 'perl' in dev_stuffs %} "perlls", {% endif %}