From a28d5324a6f02f5eb27a8b126187041b3c4a6214 Mon Sep 17 00:00:00 2001 From: N P Date: Tue, 31 Oct 2023 16:44:52 +0100 Subject: [PATCH] Adds screenshots to i3 (#100) * Adds screenshots to i3 * Fixes pre-commit installation --- Policyfile.rb | 1 + attributes/packages.rb | 6 ++++-- metadata.rb | 2 +- recipes/python.rb | 4 ++-- templates/i3_config.erb | 4 ++++ 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Policyfile.rb b/Policyfile.rb index ca7b816..fb63dbb 100644 --- a/Policyfile.rb +++ b/Policyfile.rb @@ -21,6 +21,7 @@ named_run_list 'chef', 'jarbas::pre_platform', 'jarbas::chef', 'jarbas::post_platform' named_run_list 'docker', 'jarbas::pre_platform', 'jarbas::docker', 'jarbas::post_platform' named_run_list 'gcloud', 'jarbas::pre_platform', 'jarbas::gcloud', 'jarbas::post_platform' +named_run_list 'i3', 'jarbas::i3' named_run_list 'platform', 'jarbas::pre_platform', 'jarbas::post_platform' named_run_list 'python', 'jarbas::pre_platform', 'jarbas::python', 'jarbas::post_platform' named_run_list 'rdp', 'jarbas::pre_platform', 'jarbas::rdp', 'jarbas::post_platform' diff --git a/attributes/packages.rb b/attributes/packages.rb index 0d83df0..04ccae7 100644 --- a/attributes/packages.rb +++ b/attributes/packages.rb @@ -18,10 +18,12 @@ default['jarbas']['packages']['arch'] = [ 'iotop', # View I/O usage of processes 'ntp', # Software clock syncronizer + 'maim', # maim (Make Image) is an utility that takes screenshots of your desktop 'poedit', # Cross-platform gettext catalogs (.po files) editor 'pulseaudio', # Proxy for sound hardware 'qt5-x11extras', 'qt5-quickcontrols', + 'xclip', ] # List of arch only AUR packages @@ -30,8 +32,8 @@ # Homebrew packages for mac_ox_x default['jarbas']['packages']['homebrew'] = [ - 'coreutils', # GNU File, Shell, and Text utilities - 'jq', # Lightweight and flexible command-line JSON processor + 'coreutils', # GNU File, Shell, and Text utilities + 'jq', # Lightweight and flexible command-line JSON processor 'telnet', # User interface to the TELNET protocol (built from macOS Sierra sources) 'tcptraceroute', # Traceroute implementation using TCP packets 'watch', # Executes a program periodically, showing output fullscreen diff --git a/metadata.rb b/metadata.rb index 1b976dd..ad6d0c0 100644 --- a/metadata.rb +++ b/metadata.rb @@ -3,7 +3,7 @@ maintainer_email 'nvnivs@gmail.com' license 'All Rights Reserved' description 'Installs/Configures workstation' -version '5.15.0' +version '5.16.1' chef_version '>= 17.2' issues_url 'https://github.com/z0c/jarbas/issues' diff --git a/recipes/python.rb b/recipes/python.rb index f23fa28..282b9c6 100644 --- a/recipes/python.rb +++ b/recipes/python.rb @@ -7,11 +7,11 @@ jarbas_package 'python' # pip packages -pip_packages = %w(pip pytest tox pre-commit) +pip_packages = %w(python-pip python-pytest python-tox pre-commit) pip_packages.each do |p| case node['platform'] when 'arch', 'manjaro' - jarbas_package "python-#{p}" + jarbas_package p when 'mac_os_x' jarbas_execute "pip_package[#{p}]" do command "pip3 install #{p}" diff --git a/templates/i3_config.erb b/templates/i3_config.erb index 8e0cceb..abdc2c3 100644 --- a/templates/i3_config.erb +++ b/templates/i3_config.erb @@ -422,3 +422,7 @@ mode "$mode_gaps_outer" { default_border pixel 1 default_floating_border pixel 1 for_window [class="^.*"] border pixel 1 + +# Screenshots +bindsym $mod+p exec --no-startup-id maim --window $(xdotool getactivewindow) "/home/$USER/Pictures/$(date)" +bindsym Shift+$mod+p exec --no-startup-id maim --window $(xdotool getactivewindow) | xclip -selection clipboard -t image/png