diff --git a/Media/marioPlaysTheBlues_overlay.png b/Media/marioPlaysTheBlues_overlay.png new file mode 100644 index 0000000..8032937 Binary files /dev/null and b/Media/marioPlaysTheBlues_overlay.png differ diff --git a/README.md b/README.md index 904cb97..7688f9b 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,20 @@ System configuration files ========================== +![ricing screenshot](scrot.jpg) + Here you can find all relevant configurations. This is thought equally as public viewport and backup. I appreciate suggestions, rants and bug reports :) Requirements & Usage -------------------- +Most things can be simply copied over, but I used a special naming scheme where hidden (dot) files start with `dot`, like `.profile` becomes `dot.profile`, to ensure visibility. + +I also brought the zsh and tmux config into the config folder, but still use the original config files (`~/.zshrc` and `~/.tmux.conf` respectively) to load the actual configs. This feels more consistent in my opinion. + +### ZSH + My zshrc expects the zgenom repository checked out in `~/pkg/`: ```sh @@ -14,15 +22,16 @@ mkdir -p ~/pkg git clone https://github.com/jandamm/zgenom.git ~/pkg/zgenom ``` -Most things can be simply copied over, but I used a special naming scheme where hidden (dot) files start with `dot`, like `.profile` becomes `dot.profile`, to ensure visibility. - -I also brought the zsh and tmux config into the config folder, but still use the original config files (`~/.zshrc` and `~/.tmux.conf` respectively) to load the actual configs. This feels more consistent in my opinion. - My ZSH prompt is written by myself and uses [Powerline Extra Symbols](https://github.com/ryanoasis/powerline-extra-symbols), so make sure to install a compatible font. I would suggest checking out [Nerdfonts](https://www.nerdfonts.com/). +### Sway(-lock) + +My screen lock script uses `grim` to take a screenshot, `ImageMagick` to blur and overlay it, and finally `swaylock` to lock the screen. The result looks like this: + +![lock screen example](lock.jpg) + Wayland vs X11 -------------- I used to have seperate branches for Wayland and X11 based setups, but all issues I had with Wayland are gone now, so there is no need for me to keep X11 configs around. You can still find them in the commit tree, though. - You can check out my old setup on [this reddit post](https://www.reddit.com/r/unixporn/comments/d0fuc1/sway_mario_plays_the_blues/). diff --git a/dot.local/bin/lock b/dot.local/bin/lock new file mode 100755 index 0000000..11ef4a8 --- /dev/null +++ b/dot.local/bin/lock @@ -0,0 +1,5 @@ +cd ~/tmp && +grim -o eDP-1 scrot.png && +mogrify -scale 10% -blur 0x1.5 -resize 600% scrot.png && +composite -gravity center ~/Media/marioPlaysTheBlues_overlay.png scrot.png scrot.png && +swaylock diff --git a/dot.local/bin/wlprop b/dot.local/bin/wlprop new file mode 100755 index 0000000..a27bc41 --- /dev/null +++ b/dot.local/bin/wlprop @@ -0,0 +1,45 @@ +#!/usr/bin/env sh + +# wlprop +# +# Licensed under the MIT license +# Copyright © 2022 bjosephmitchell@gmail.com +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the “Software”), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# Dependencies: +# - swaymsg +# - jq +# - slurp +# - awk + +# Get the sway tree and store the output +SWAY_TREE=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?)') + +# Invoke slurp to let the user select a window +SELECTION=$(echo $SWAY_TREE | jq -r '.rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp) + +# Extract the X, Y, Width, and Height from the selection +X=$(echo $SELECTION | awk -F'[, x]' '{print $1}') +Y=$(echo $SELECTION | awk -F'[, x]' '{print $2}') +W=$(echo $SELECTION | awk -F'[, x]' '{print $3}') +H=$(echo $SELECTION | awk -F'[, x]' '{print $4}') + +# Find the window matching the selection +echo $SWAY_TREE | jq -r --argjson x $X --argjson y $Y --argjson w $W --argjson h $H \ + '. | select(.rect.x == $x and .rect.y == $y and .rect.width == $w and .rect.height == $h)' diff --git a/lock.jpg b/lock.jpg new file mode 100644 index 0000000..957a829 Binary files /dev/null and b/lock.jpg differ diff --git a/scrot.jpg b/scrot.jpg new file mode 100644 index 0000000..414d137 Binary files /dev/null and b/scrot.jpg differ