First commit

This commit is contained in:
Yorick Barbanneau 2022-11-29 00:42:29 +01:00
commit c8f2b3ef39
14 changed files with 372 additions and 0 deletions

60
Makefile Normal file
View file

@ -0,0 +1,60 @@
# Ansible options
ansible_user ?= ephase
ansible_roles := deps
ansible_options ?= --diff
ansible_playbook ?= playbook.yml
ansible_req ?= requirements.yml
# venv options
venv_source ?= .venv
venv_cmd := . $(venv_source)/bin/activate
#Python
python_bin ?= python
pip_req ?= requirements.txt
.PHONY: inventory
inventory:
ansible-inventory --graph -i inventory.ini
$(ansible_req):
deps: $(ansible_req)
$(shell mkdir -p $(ansible_roles))
ifeq ($(wildcard $(ansible_req)),)
$(error there is not requirements.yml file in $(ansible_data)!)
endif
$(venv_cmd) && ansible-galaxy install \
--ignore-errors \
--roles-path="$(ansible_roles)" \
--role-file="$(ansible_req)"
.PHONY: check-syntax
check-syntax: ## check-syntax #Check playbook syntax
$(venv_cmd) && ansible-playbook -i inventory.ini \
--syntax-check $(ansible_playbook)
.PHONY: dry-run
dry-run: ## dry-run #run playbook in check mode
$(venv_cmd) && ansible-playbook -i inventory.ini \
--check $(ansible_options) $(ansible_playbook) \
-u $(ansible_user)
.PHONY: dry-run
run: ## dry-run #run playbook in check mode
$(venv_cmd) && ansible-playbook -i inventory.ini \
$(ansible_options) $(ansible_playbook) \
-u $(ansible_user)
# venv management
$(venv_source):
$(python_bin) -m venv $(venv_source)
$(pip_req):
$(venv_source)/dep: $(venv_source) $(pip_req)
touch $(venv_source)/dep
$(venv_cmd) && pip install -r $(pip_req)
.PHONY: clean-venv
clean-venv:
[ -d $(venv_source) ] && rm -rf $(venv_source)

3
ansible.cfg Normal file
View file

@ -0,0 +1,3 @@
[defaults]
roles_path = deps
stdout_callback = yaml

22
group_vars/all/input.yml Normal file
View file

@ -0,0 +1,22 @@
---
sway_inputs:
- name: '1:1:AT_Translated_Set_2_keyboard'
options:
- option: 'xkb_layout'
value: 'gpdwinmax'
- name: '1003:8258:MNT_Reform_Keyboard'
options:
- option: 'xkb_layout'
value: 'us'
- option: 'xkb_variant'
value: 'altgr-intl'
- name: '2362:597:HTIX5288:00_093A:0255_Touchpad'
options:
- option: 'tap'
value: 'enabled'
- option: 'pointer_accel'
value: 0.3
- name: '1046:928:Goodix_Capacitive_TouchScreen'
options:
- option: 'map_to_output'
value: 'eDP-1'

19
group_vars/all/kanshi.yml Normal file
View file

@ -0,0 +1,19 @@
---
kanshi_profiles:
- profile: 'home'
screens:
- id: 'eDP-1'
status: enable
- profile: 'home'
screens:
- id: 'eDP-1'
status: 'disable'
- id: 'iiyama_27_4k'
position: '0,0'
- id: 'iiyama_23_fhd'
position: '1920,0'
mode: '1920x1080'
transform: 90
commands:
- swaymsg 'workspace $ws1, move workspace to +iiyama_23_fhd+'

View file

@ -0,0 +1,105 @@
---
sway_keybindings:
- mode: 'normal'
bindings:
- bindsym: '$mod+Return'
action: 'exec $term'
- bindsym: '$mod+Shift+q'
action: 'kill'
- bindsym: '$mod+d'
action: 'exec $menu'
- bindsym: '$mod+Shift+c'
action: 'reload'
- bindsym: '$mod+Shift+e'
action: >-
exec swaynag -t warning -m "You pressed the exit shortcut. \
Do you really want to exit sway? \
This will end your Wayland session." \
-B "Yes, exit sway" "swaymsg exit"
# Focus
- bindsym: '$mod+$left'
action: 'focus left'
- bindsym: '$mod+$down'
action: 'focus down'
- bindsym: '$mod+$up'
action: 'focus up'
- bindsym: '$mod+$right'
action: 'focus right'
# Use regular direction bindsym
- bindsym: '$mod+Left'
action: 'focus left'
- bindsym: '$mod+Down'
action: 'focus down'
- bindsym: '$mod+Up'
action: 'focus up'
- bindsym: '$mod+Right'
action: 'focus right'
# move the focused window with the same, but add Shift
- bindsym: '$mod+Shift+$left'
action: 'move left'
- bindsym: '$mod+Shift+$down'
action: 'move down'
- bindsym: '$mod+Shift+$up'
action: 'move up'
- bindsym: '$mod+Shift+$right'
action: 'move right'
- bindsym: '$mod+Shift+Left'
action: 'move left'
- bindsym: '$mod+Shift+Down'
action: 'move down'
- bindsym: '$mod+Shift+Up'
action: 'move up'
- bindsym: '$mod+Shift+Right'
action: 'move right'
# split
- bindsym: '$mod+b'
action: 'splith'
- bindsym: '$mod+v'
action: 'splitv'
# layout
- bindsym: '$mod+s'
action: 'layout stacking'
- bindsym: '$mod+w'
action: 'layout tabbed'
- bindsym: '$mod+e'
action: layout toggle split
# Fullscreen
- bindsym: '$mod+f'
action: 'fullscreen'
# Toggle floating mode
- bindsym: '$mod+Shift+space'
action: 'floating toggle'
# Swap focus between the tiling area and the floating area
- bindsym: '$mod+space'
action: 'focus mode_toggle'
# move focus to the parent container
- bindsym: '$mod+a'
action: 'focus parent'
# Scratchpad
- bindsym: '$mod+Shift+p'
action: 'move scratchpad'
- bindsym: '$mod+p'
action: 'scratchpad show'
- mode: 'resize'
bindings:
- bindsym: '$left'
action: 'resize shrink width 10 px or 10 ppt'
- bindsym: '$down'
action: 'resize grow height 10 px or 10 ppt'
- bindsym: '$up'
action: 'resize shrink height 10 px or 10 ppt'
- bindsym: '$right'
action: 'resize grow width 10 px or 10 ppt'
- bindsym: 'Return'
action: 'mode "default"'
- bindsym: Escape
action: 'mode "default"'

18
group_vars/all/output.yml Normal file
View file

@ -0,0 +1,18 @@
---
sway_outputs:
- id: 'bg'
name: '*'
options:
bg: '/usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill'
- id: 'eDP-1'
name: 'eDP-1'
options:
transform: 90
- id: 'iiyama_27_4k'
name: 'Iiyama North America PL2792UH 1166310803122'
status: absent
options:
scale: 2
- id: 'iiyama_23_fhd'
name: 'Iiyama North America PLX2380H 11177G3400889'
status: absent

View file

@ -0,0 +1,6 @@
---
sway_packages:
- sway
- swaybg
- swayidle
- swaylock

47
group_vars/all/theme.yml Normal file
View file

@ -0,0 +1,47 @@
---
sway_theme_parameters:
default_orientation: 'auto'
workspace_layout: 'default'
gaps: 'inner 3'
smart_gaps: 'on'
smart_borders: 'on'
font: 'pango:FuraCode Nerd Font Mono 10'
default_border: 'pixel 2'
default_floating_border: 'pixel 2'
title_align: 'center'
# client.focused #f268b3 #a82d70 #ffffff #f268b3 #ffffff
# client.focused_inactive #333333 #5f676a #ffffff #484e50 #5f676a
# client.focused_tab_title #2f343a 5f676a #ffffff
# client.unfocused #000000 #4d3d46 #cccccc #000000 #000000
# client.urgent #2f343a #900000 #cccccc #900000 #900000
sway_theme_colors:
focused:
border: '#f268b3'
backgound: '#a82d70'
text: '#ffffff'
indicator: '#f268b3'
child_border: '#f268b3'
focused_inactive:
border: '#333333'
backgound: '#5f676a'
text: '#ffffff'
indicator: '#484e50'
child_border: '#5f676a'
focused_tab_title:
border: '#2f343a'
backgound: '5f676a'
text: '#ffffff'
unfocused:
border: '#000000'
backgound: '#4d3d46'
text: '#cccccc'
indicator: '#000000'
child_border: '#000000'
urgent:
border: '#2f343a'
backgound: '#900000'
text: '#cccccc'
indicator: '#900000'
child_border: '#900000'

View file

@ -0,0 +1,14 @@
---
sway_variables:
- name: '$left'
value: 'h'
- name: '$down'
value: 'j'
- name: '$up'
value: 'k'
- name: '$right'
value: 'l'
- name: '$term'
value: 'foot'
- name: '$menu'
value: 'exec $term --app-id=launcher --title=launcher ~/.local/bin/launcher.sh'

View file

@ -0,0 +1,56 @@
---
sway_workspaces:
1: '1: '
2: '2: '
3: '3: '
4: '4: '
5: '5: '
6: '6: '
7: '7: '
8: '8'
9: '9'
0: '10'
sway_rules:
- verb: 'assign'
query: '[app_id="^firefox$"]'
action: 3
- verb: 'assign'
query: '[app_id="KeePassXC$"]'
action: 3
- verb: 'assign'
query: '[app_id="org.qutebrowser.qutebrowser"]'
action: 3
- verb: 'assign'
query: '[app_id="org.remmina.*"]'
action: 5
- verb: 'assign'
query: '[app_id="homebank"]'
action: 6
- verb: 'assign'
query: '[app_id="org.inkscape.Inkscape"]'
action: 7
- verb: 'assign'
query: '[app_id="^libreoffice-*"]'
action: 6
- verb: 'assign'
query: '[class="Gimp"]'
action: 7
- verb: 'for_window'
query: '[app_id="imv"]'
action: 'floating enable'
- verb: 'for_window'
query: '[app_id="org.pwmt.zathura"]'
action: 'floating enable'
- verb: 'for_window'
query: '[app_id="^launcher$"]'
action: 'floating enable, resize set 800px 400px'
- verb: 'for_window'
query: '[title="Remmina Remote Desktop Client"]'
action: 'floating enable'
- verb: 'for_window'
query: '[app_id="pavucontrol"]'
action: 'floating enable, resize set 600px 400px'
- verb: 'for_window'
query: '[title="^Open .*$"]'
action: 'floating enable, resize set 900px 700px'

2
inventory.ini Normal file
View file

@ -0,0 +1,2 @@
[all]
localhost ansible_connection=local

6
playbook.yml Normal file
View file

@ -0,0 +1,6 @@
---
- hosts: all
roles:
#- ansible-sshagentd
#- ansible-sway
- ansible-mako

1
requirements.txt Normal file
View file

@ -0,0 +1 @@
ansible == 6.4.0

13
requirements.yml Normal file
View file

@ -0,0 +1,13 @@
---
- src: https://git.epha.se/ephase/ansible-sway
scm: git
version: main
- src: https://git.epha.se/ephase/ansible-mako
scm: git
version: main
- src: https://git.epha.se/ephase/ansible-kanshi
scm: git
version: main
- src: https://git.epha.se/ephase/ansible-sshagentd
scm: git
version: main