From 2c2466a30ec448629199025fda1d4e6a1946fec5 Mon Sep 17 00:00:00 2001 From: Leaced Date: Thu, 23 Mar 2023 15:46:11 +0100 Subject: [PATCH] Add files via upload --- .config/sway/gammastep.ini | 9 +++++++ .config/sway/mako.conf | 20 +++++++++++++++ .config/sway/menu.sh | 43 ++++++++++++++++++++++++++++++++ .config/sway/screenshot.sh | 32 ++++++++++++++++++++++++ .config/sway/toggle_gammastep.sh | 13 ++++++++++ 5 files changed, 117 insertions(+) create mode 100644 .config/sway/gammastep.ini create mode 100644 .config/sway/mako.conf create mode 100644 .config/sway/menu.sh create mode 100644 .config/sway/screenshot.sh create mode 100644 .config/sway/toggle_gammastep.sh diff --git a/.config/sway/gammastep.ini b/.config/sway/gammastep.ini new file mode 100644 index 0000000..ce49013 --- /dev/null +++ b/.config/sway/gammastep.ini @@ -0,0 +1,9 @@ +[general] +temp-day=6500 +temp-night=3500 +brightness-day=1 +brightness-night=0.8 +location-provider=manual +[manual] +lat=49.7 +lon=8.1 diff --git a/.config/sway/mako.conf b/.config/sway/mako.conf new file mode 100644 index 0000000..fe3e760 --- /dev/null +++ b/.config/sway/mako.conf @@ -0,0 +1,20 @@ +margin=10 +padding=2 +border-size=2 +border-radius=0 +icons=1 +markup=1 +icon-location=right +sort=+time + +[urgency=low] +border-color=#000000 +default-timeout=5000 + +[urgency=normal] +border-color=#8d00c4 +default-timeout=10000 + +[urgency=high] +border-color=#c40000 +default-timeout=0 diff --git a/.config/sway/menu.sh b/.config/sway/menu.sh new file mode 100644 index 0000000..5650880 --- /dev/null +++ b/.config/sway/menu.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +# This script will open a little menu with different options +# Dependencies: Sway, Bemenu, Unicode, systemd + +screenshot () { +case "$(echo -e "πŸ–§ ...von allen Bildschirmen +πŸ—” ...vom aktiven Fenster +βŒ— ...von Auswahl +πŸ–΅ ...vom Bildschirm" | +bemenu -p "Foto" "$@")" in + +"πŸ–§ ...von allen Bildschirmen") exec .config/sway/screenshot.sh all ;; +"πŸ—” ...vom aktiven Fenster") exec .config/sway/screenshot.sh focus ;; +"βŒ— ...von Auswahl") exec .config/sway/screenshot.sh choice ;; +"πŸ–΅ ...vom Bildschirm") exec .config/sway/screenshot.sh ;; +esac + +exit 0 +} + +case "$(echo -e "πŸ–Ό Bildschirmfoto... +🌘 gammastep umschalten +πŸ”’ ausloggen +⏻ Herunterfahren +↻ Neustarten +⏾ Standby" | +bemenu -p "MenΓΌ" "$@")" in + +"πŸ–Ό Bildschirmfoto...") + screenshot "$@";; +"🌘 gammastep umschalten") + exec ~/.config/sway/toggle_gammastep.sh ;; +"πŸ”’ ausloggen") + loginctl terminate-user $USER ;; +"⏻ Herunterfahren") + shutdown now ;; +"↻ Neustarten") + reboot ;; +"⏾ Standby") + systemctl suspend ;; +esac + +exit 0 diff --git a/.config/sway/screenshot.sh b/.config/sway/screenshot.sh new file mode 100644 index 0000000..c9b21f4 --- /dev/null +++ b/.config/sway/screenshot.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# This script will take a screenshot +# Dependencies: sway, grim, slurp, gnu-utils + +FILENAME="$HOME/screenshot-$(date +'%Y-%m-%d-%H%M%S.png')" + +case $1 in +all) #Screenshot of all outputs + grim -t jpeg -q 100 $FILENAME ;; + +focus) # Screenshot of focused window + geometry="$( + swaymsg -p -t get_tree | + grep -A 8 \"focused\"\:\ true | + grep -o "[0-9]*" | + awk ' + BEGIN{ RS = "" ; FS = "\n" } + {printf "%d,%d %dx%d", $2+$1,$3+$1,$4-2*$1,$5-2*$1}')" + grim -t jpeg -q 100 -g "$geometry" $FILENAME ;; + +choice) #Screenshot von Auswahl + grim -t jpeg -q 100 -g "$(slurp)" $FILENAME ;; + +*) #Default: Screenshot of focused output + focused_output="$( + swaymsg -p -t get_outputs | + grep focused | + awk '{print $2}')" + grim -t jpeg -q 100 -o $focused_output $FILENAME ;; +esac + +exit 0 diff --git a/.config/sway/toggle_gammastep.sh b/.config/sway/toggle_gammastep.sh new file mode 100644 index 0000000..de8a722 --- /dev/null +++ b/.config/sway/toggle_gammastep.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# This script will toggle gammastep +# Dependencies: sway, gammastep, gnu-utils + +PID="$(ps -e | grep gammastep | awk -F ' ' '{print $1}')" + +if [[ $PID > 0 ]]; then + kill $PID +else + swaymsg exec "gammastep-indicator -c .config/sway/gammastep.ini" +fi + +exit 0