From 3bea84ce6859a1ce7e27fe73fdc4adbd40feb298 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Wed, 24 Nov 2021 14:29:06 +0100 Subject: [PATCH] feat(sway): add toggle gaps script --- configs/.zshrc | 6 ++ configs/nvim/lua/plugins.lua | 4 +- configs/sway/.gitignore | 1 + configs/sway/config | 2 + configs/sway/toggle_gaps.sh | 14 ++++ configs/waybar/media.log | 151 ++++++++++++++++++++++++++++++++++ configs/waybar/mediaplayer.py | 4 +- 7 files changed, 179 insertions(+), 3 deletions(-) create mode 100644 configs/sway/.gitignore create mode 100755 configs/sway/toggle_gaps.sh diff --git a/configs/.zshrc b/configs/.zshrc index 2cb1c87..aba0dca 100644 --- a/configs/.zshrc +++ b/configs/.zshrc @@ -74,3 +74,9 @@ fi export PNPM_HOME="$HOME/.local/share/pnpm" export PATH="$PNPM_HOME:$PATH" if [ -e /home/jim/.nix-profile/etc/profile.d/nix.sh ]; then . /home/jim/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer + +PATH="/home/jim/perl5/bin${PATH:+:${PATH}}"; export PATH; +PERL5LIB="/home/jim/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; +PERL_LOCAL_LIB_ROOT="/home/jim/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; +PERL_MB_OPT="--install_base \"/home/jim/perl5\""; export PERL_MB_OPT; +PERL_MM_OPT="INSTALL_BASE=/home/jim/perl5"; export PERL_MM_OPT; diff --git a/configs/nvim/lua/plugins.lua b/configs/nvim/lua/plugins.lua index ef11324..e3b8f16 100644 --- a/configs/nvim/lua/plugins.lua +++ b/configs/nvim/lua/plugins.lua @@ -8,9 +8,11 @@ return require("packer").startup(function() -- Faster Filetype Detection use "nathom/filetype.nvim" - use "alexghergh/nvim-tmux-navigation" + use 'lervag/vimtex' + use 'xuhdev/vim-latex-live-preview' + -- Theming Section use 'folke/tokyonight.nvim' use "xiyaowong/nvim-transparent" diff --git a/configs/sway/.gitignore b/configs/sway/.gitignore new file mode 100644 index 0000000..8d4bfcf --- /dev/null +++ b/configs/sway/.gitignore @@ -0,0 +1 @@ +nohup.out diff --git a/configs/sway/config b/configs/sway/config index 9a23aa0..119b30a 100644 --- a/configs/sway/config +++ b/configs/sway/config @@ -24,6 +24,7 @@ set $screenclip slurp | grim -g - ~/Pictures/Screenshots/scrn-$(date +"%Y-%m-%d- set $screenshot grim ~/Pictures/screenshots/scrn-$(date +"%Y-%m-%d-%H-%M-%S").png set $windowshot swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | $screenclip set $toggle_layout ~/.config/sway/toggle_layout.sh +set $toggle_gaps ~/.config/sway/toggle_gaps.sh # Input configuration @@ -180,6 +181,7 @@ output * bg `find ~/.customization/background -type f | shuf -n 1` fill # Switch the current container between different layout styles bindsym $mod+w exec $toggle_layout + bindsym $mod+g exec $toggle_gaps # Make the current focus fullscreen bindsym $mod+f fullscreen diff --git a/configs/sway/toggle_gaps.sh b/configs/sway/toggle_gaps.sh new file mode 100755 index 0000000..41b4452 --- /dev/null +++ b/configs/sway/toggle_gaps.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +GAPS_OUTER=5 +GAPS_INNER=1 + +if [ "$(pgrep waybar)" != "" ]; then + killall waybar; + swaymsg gaps outer all set 0; + swaymsg gaps inner all set 0; +else + swaymsg gaps outer all set $GAPS_OUTER; + swaymsg gaps inner all set $GAPS_INNER; + nohup waybar & 2&> /dev/null; +fi diff --git a/configs/waybar/media.log b/configs/waybar/media.log index b226144..27c97f7 100644 --- a/configs/waybar/media.log +++ b/configs/waybar/media.log @@ -86,3 +86,154 @@ __main__ INFO Received new metadata __main__ INFO Writing output __main__ DEBUG Received signal to stop, exiting __main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Received signal to stop, exiting +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Received signal to stop, exiting +__main__ DEBUG Received signal to stop, exiting +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Received signal to stop, exiting +__main__ DEBUG Received signal to stop, exiting +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Initialize player: chromium +__main__ DEBUG Initialize player: chromium +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new playback status +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new playback status +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new playback status +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new playback status +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new playback status +__main__ INFO Received new playback status +__main__ INFO Received new metadata +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new playback status +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new playback status +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new playback status +__main__ INFO Received new playback status +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new playback status +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new playback status +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ DEBUG Received signal to stop, exiting +__main__ INFO Player has vanished +__main__ DEBUG Initialize player: chromium +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new playback status +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new playback status +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Received new metadata +__main__ INFO Writing output +__main__ INFO Player has vanished +__main__ DEBUG Received signal to stop, exiting +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} +__main__ DEBUG Arguments received {'verbose': 0, 'player': None} diff --git a/configs/waybar/mediaplayer.py b/configs/waybar/mediaplayer.py index 5ed81db..0a66a31 100755 --- a/configs/waybar/mediaplayer.py +++ b/configs/waybar/mediaplayer.py @@ -23,12 +23,12 @@ def write_output(text, player): sys.stdout.flush() -def on_play(player, status, manager): +def on_play(player, _, manager): logger.info('Received new playback status') on_metadata(player, player.props.metadata, manager) -def on_metadata(player, metadata, manager): +def on_metadata(player, metadata, _): logger.info('Received new metadata') track_info = ''