From c4956eedd1902489da8be5038af08f14c0212029 Mon Sep 17 00:00:00 2001 From: Max Hohlfeld Date: Sun, 6 Nov 2022 01:48:09 +0100 Subject: [PATCH] further xmonad rework --- justfile | 18 ++++++++++-------- roles/xmonad/files/xmonad_t460p.hs | 8 ++++++-- roles/xmonad/tasks/main.yml | 13 ++++++++++++- site.yml | 17 ++++++++++++----- 4 files changed, 40 insertions(+), 16 deletions(-) diff --git a/justfile b/justfile index 64b96ed..b6c3d6a 100644 --- a/justfile +++ b/justfile @@ -1,15 +1,17 @@ +allTags := "nvim,xmonad" + default: just --list -sync-qwerty: - ansible-playbook site.yml -K -t "pc,qwerty" +sync-qwerty tags=allTags: + ansible-playbook site.yml -K -t "pc,qwerty,{{tags}}" -sync-x220: - ansible-playbook site.yml -K -t "pc,x220" +sync-x220 tags=allTags: + ansible-playbook site.yml -K -t "pc,x220,{{tags}}" -sync-t460p: - ansible-playbook site.yml -K -t "pc,t460p" +sync-t460p tags=allTags: + ansible-playbook site.yml -K -t "pc,t460p,{{tags}}" -sync-server: - ansible-playbook site.yml -K -t "server" +sync-server tags=allTags: + ansible-playbook site.yml -K -t "server,{{tags}}" diff --git a/roles/xmonad/files/xmonad_t460p.hs b/roles/xmonad/files/xmonad_t460p.hs index 0d93a2d..bf5493f 100644 --- a/roles/xmonad/files/xmonad_t460p.hs +++ b/roles/xmonad/files/xmonad_t460p.hs @@ -108,8 +108,12 @@ spawnShell = currentTopicDir myTopicConfig >>= spawnShellIn spawnShellIn :: Dir -> X () spawnShellIn dir = spawn $ "st -d " ++ dir -spawnCommand :: String -> X() -spawnCommand cmd = spawn $ "st -d" ++ cmd +spawnShellWith :: String -> X() +-- spawnShellWith cmd = spawn $ "st -e " ++ cmd +spawnShellWith cmd = currentTopicDir myTopicConfig >>= spawnShellInWith cmd + +spawnShellInWith :: Dir -> String -> X () +spawnShellInWith dir cmd = spawn $ "st -d " ++ dir ++ " -e " ++ cmd -- getDir :: X Dir -> String -- getDir (X dir) = dir diff --git a/roles/xmonad/tasks/main.yml b/roles/xmonad/tasks/main.yml index 8cd950f..a1c7820 100644 --- a/roles/xmonad/tasks/main.yml +++ b/roles/xmonad/tasks/main.yml @@ -5,10 +5,11 @@ - xmonad - xmonad-contrib - xmobar + - alacritty state: present tags: pc -# - name: Build and install custom st, dmenu and slock +# - name: Build and install custom st, dmenu and slock # tags: pc - name: Create config directories @@ -30,3 +31,13 @@ - { src: xmonad_t460p.hs, dest: ~/.config/xmonad/xmonad.hs } - { src: xmobarrc_t460p, dest: ~/.config/xmobar/xmobarrc } tags: t460p + +- name: Copy over qwerty config files + ansible.builtin.copy: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + mode: '0644' + with_items: + - { src: xmonad_qwerty.hs, dest: ~/.config/xmonad/xmonad.hs } + - { src: xmobarrc_qwerty, dest: ~/.config/xmobar/xmobarrc } + tags: qwerty diff --git a/site.yml b/site.yml index bf2e129..4fcd886 100644 --- a/site.yml +++ b/site.yml @@ -1,8 +1,15 @@ --- - name: Dotfile Playbook hosts: localhost - roles: - - role: nvim - tags: nvim - - role: xmonad - tags: xmonad + # roles: + # - role: nvim + # tags: nvim + # - role: xmonad + # tags: xmonad + tasks: + - ansible.builtin.include_role: + name: nvim + tags: nvim + - ansible.builtin.include_role: + name: xmonad + tags: xmonad