pub / dotfiles

Configuration of software on my computer
git clone https://src.jayvii.de/pub/dotfiles.git
Home | Log | Files | Exports | Refs | RSS

commit 283debd04cd9c6316416f61825949c60d9e58cfc
parent 668d94a34206e13e00f68508920eda9363847624
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Thu, 27 Jun 2024 22:33:09 +0200

feat: update sway configurations

Diffstat:
Asway/.config/mako/config | 30++++++++++++++++++++++++++++++
Asway/.config/sway/brightness.sh | 41+++++++++++++++++++++++++++++++++++++++++
Msway/.config/sway/config | 59++++++++++++++++++++++++++++++++++++++++++++++++-----------
Asway/.config/sway/notification_daemon.sh | 17+++++++++++++++++
Asway/.config/swaylock/config | 2++
Asway/.config/waybar/README | 2++
Asway/.config/waybar/config | 132+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asway/.config/waybar/donotdisturb_status.sh | 12++++++++++++
Asway/.config/waybar/donotdisturb_toggle.sh | 8++++++++
Asway/.config/waybar/gaps | 12++++++++++++
Asway/.config/waybar/gaps.css | 5+++++
Asway/.config/waybar/modules/audio-output.sh | 11+++++++++++
Asway/.config/waybar/modules/audio-volume.sh | 4++++
Asway/.config/waybar/modules/audio.sh | 15+++++++++++++++
Asway/.config/waybar/snip.sh | 17+++++++++++++++++
Asway/.config/waybar/style.css | 300+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asway/.config/wofi/config | 20++++++++++++++++++++
Asway/.config/wofi/style.css | 41+++++++++++++++++++++++++++++++++++++++++
18 files changed, 717 insertions(+), 11 deletions(-)

diff --git a/sway/.config/mako/config b/sway/.config/mako/config @@ -0,0 +1,30 @@ +sort=-time +layer=overlay +background-color=#282a36 +width=600 +height=200 +border-size=1 +border-color=#ff79c6 +border-radius=15 +icons=1 +max-icon-size=64 +default-timeout=10000 +ignore-timeout=1 +font=Fira Code 12 +max-visible=3 +anchor=top-center + +[urgency=high] +border-color=#ff5555 +default-timeout=0 + +# == Mode: Away == +[mode=away] +default-timeout=0 +ignore-timeout=1 + +# == Mode: Do Not Disturb == +[mode=do-not-disturb] +invisible=1 +default-timeout=0 +ignore-timeout=1 diff --git a/sway/.config/sway/brightness.sh b/sway/.config/sway/brightness.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +DEV="/sys/class/backlight/intel_backlight" +MAX=$(cat "${DEV}/max_brightness") +CUR=$(cat "${DEV}/brightness") +PER=$((($CUR * 100) / $MAX)) + +# If no argument is given, return current value +if [[ -z $1 ]]; then + echo "$PER" + exit 0 +fi + +# increasing brightness +if [[ "$1" == "inc" ]]; then + + # calculate new value in percent, cap at 100% + PER_NEW=$((${PER} + ${2})) + if [[ $PER_NEW -gt 100 ]]; then + PER_NEW=100 + fi + +fi + +# decrease brightness +if [[ "$1" == "dec" ]]; then + + # calculate new value in percent, capt at 5% + PER_NEW=$((${PER} - ${2})) + if [[ $PER_NEW -lt 5 ]]; then + PER_NEW=5 + fi + +fi + +# calculate numerical value +CUR_NEW=$(((${MAX} * ${PER_NEW}) / 100)) + +# set new value +echo "Setting brightness to $CUR_NEW" +echo "$CUR_NEW" > "${DEV}/brightness" diff --git a/sway/.config/sway/config b/sway/.config/sway/config @@ -27,7 +27,7 @@ include /etc/sway/config-vars.d/* # # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) #output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill -output * bg ~/Bilder/Wallpaper/02.png fill +output * bg ~/Bilder/Wallpaper/Sway_Wallpaper_purple_2048x1536.png fill # # Example configuration: # @@ -40,9 +40,10 @@ output * bg ~/Bilder/Wallpaper/02.png fill # Example configuration: # exec swayidle -w \ - timeout 300 'swaylock' \ - timeout 360 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ - before-sleep 'swaylock' + timeout 300 'swaylock' \ + timeout 360 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ + timeout 290 "makoctl set-mode away" resume "makoctl set-mode default" \ + before-sleep 'swaylock' # # This will lock your screen after 300 seconds of inactivity, then turn off # your displays after another 300 seconds, and turn your screens back on when @@ -212,12 +213,12 @@ input "type:touchpad" { # # Mediakeys # -bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% -bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% -bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle -bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle -bindsym XF86MonBrightnessDown exec ~/.local/bin/brightness.sh dec 5 -bindsym XF86MonBrightnessUp exec ~/.local/bin/brightness.sh inc 5 +bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%; exec echo "Volume: $(pactl get-sink-volume @DEFAULT_SINK@ | awk '{ print $5 }')" > /tmp/notificationpipe +bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%; exec echo "Volume: $(pactl get-sink-volume @DEFAULT_SINK@ | awk '{ print $5 }')" > /tmp/notificationpipe +bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle; exec pactl get-sink-mute @DEFAULT_SINK@ > /tmp/notificationpipe +bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle; exec pactl get-source-mute @DEFAULT_SOURCE@ > /tmp/notificationpipe +bindsym XF86MonBrightnessDown exec ~/.config/sway/brightness.sh dec 5; exec echo "Brightness $(~/.config/sway/brightness.sh)" > /tmp/notificationpipe +bindsym XF86MonBrightnessUp exec ~/.config/sway/brightness.sh inc 5; exec echo "Brightness $(~/.config/sway/brightness.sh)" > /tmp/notificationpipe # # Resizing containers: @@ -266,7 +267,43 @@ include /etc/sway/config.d/* default_border pixel -exec ~/.startup.sh +# +## Autostart +# + +# SOV exec rm -f /tmp/sovpipe && mkfifo /tmp/sovpipe && tail -f /tmp/sovpipe | sov & +# Notification Daemon +exec ~/.config/sway/notification_daemon.sh + +# waybar +exec waybar + +# wlsunset +exec wlsunset -L 6.6441878 -l 49.7596208 + +# set volume to 100% and mute +exec pactl set-sink-volume @DEFAULT_SINK@ 100% +exec pactl set-sink-mute @DEFAULT_SINK@ 1 + +# set microphone to 15% and mute +exec pactl set-source-volume @DEFAULT_SOURCE@ 15% +exec pactl set-source-mute @DEFAULT_SOURCE@ 1 + +# set brightness to 100% +exec ~/.local/bin/brightness "inc" 100 + +# Launch KDE Connect +exec kdeconnect-indicator +exec_always kdeconnect-cli --refresh + +# Launch Nextcloud Sync +exec nextcloud --background + +# Launch Nextcloud Talk +exec $HOME/.local/opt/nextcloud-talk/Nextcloud\ Talk --background + +# Launch Nextcloud Talk +exec flatpak run org.signal.Signal diff --git a/sway/.config/sway/notification_daemon.sh b/sway/.config/sway/notification_daemon.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +rm -f /tmp/notificationpipe +mkfifo /tmp/notificationpipe + +NOTIFICATION_ID=0 + +while read notification_text < /tmp/notificationpipe; do + NOTIFICATION_ID=$( + notify-send \ + --urgency=low \ + --expire-time=100 \ + --print-id \ + --replace-id=$NOTIFICATION_ID \ + $notification_text + ) +done diff --git a/sway/.config/swaylock/config b/sway/.config/swaylock/config @@ -0,0 +1,2 @@ +image=/home/jan/Bilder/Wallpaper/02.png +hide-keyboard-layout diff --git a/sway/.config/waybar/README b/sway/.config/waybar/README @@ -0,0 +1,2 @@ +Configs are taken and adapted from: +https://github.com/aMir733/dotfiles/tree/wayfire/.config/waybar diff --git a/sway/.config/waybar/config b/sway/.config/waybar/config @@ -0,0 +1,132 @@ +{ + "layer": "top", + "position": "top", + "height": 24, + "spacing": 4, + "margin-top": 5, + "margin-bottom": 10, + + // Choose the order of the modules + + "modules-left":["custom/launcher", "wlr/workspaces", "wlr/taskbar"], + "modules-right":["custom/donotdisturb", "custom/snip", "pulseaudio", "cpu", "memory", "temperature", "backlight", "battery", "battery#bat2", "network", "tray", "clock", "custom/power"], + + // Modules configuration + + "wlr/taskbar": { + "format": "{icon}", + "icon-size": 20, + "icon-theme": "Adwaita", + "tooltip-format": "{title}", + "on-click": "activate", + "on-click-middle": "", + "on-click-right": "minimize" + }, + "wlr/workspaces": { + "format": "{name}: {icon}", + "format-icons": { + "1": "", + "2": "", + "3": "", + "4": "", + "5": "", + "focused": "", + "default": "" + }, + "sort-by-number": true + }, + "tray": { + "icon-size": 20, + "spacing": 10 + }, + "clock": { + "timezone": "Europe/Berlin", + "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>", + "format": "{:%a %d %b %H:%M}", + "format-alt": "{:%c}" + }, + "cpu": { + "format": "{usage}% ⚡", + "on-click": "qps" + // "tooltip": false + }, + "memory": { + "format": "{}% 💾", + "on-click": "qps" + }, + "temperature": { + "thermal-zone": 2, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 60, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{temperatureC}°C 🔥", + }, + "backlight": { + // "device": "acpi_video1", + "format": "{percent}% 💡" + }, + "battery": { + "states": { + "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% 🪫", + "format-charging": "{capacity}% 🔌", + "format-plugged": "{capacity}% 🔌", + "tooltip-format": "{time}", + "format-good": "{capacity}% 🔋", + "format-full": "{capacity}% 🔋", + }, + "battery#bat2": { + "bat": "BAT2" + }, + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "format-wifi": "{essid} ({signalStrength}%)", + "format-ethernet": "Connected 🖧", + "tooltip-format": "{ifname} via {gwaddr} 🖧", + "format-linked": "{ifname} (No IP) 🖧", + "format-disconnected": "Disconnected ⚠", + "on-click": "nm-connection-editor" + }, + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "format": "{volume}% 🔊", + "format-bluetooth": "{volume}% 🔊", + "format-bluetooth-muted": "{icon} {format_source}", + "format-muted": "{volume}% {format_source}", + "format-source": "🔇", + "format-source-muted": "🔇", + "format-icons": { + "headphone": "🎧", + "hands-free": "🎧", + "headset": "🎧", + "phone": "📞", + "portable": "📞", + "car": "🚗", + "default": ["🔇"] + }, + "on-click": "pavucontrol" + }, + "custom/launcher":{ + "format": "🐧", + "tooltip-format": "Applications", + "on-click": "wofi", + "on-click-right": "killall wofi" + }, + "custom/power":{ + "format": "⏻ ", + "on-click": "wlogout", + "on-click-right": "killall wlogout" + }, + "custom/snip":{ + "format": "✂", + "on-click": "~/.config/waybar/snip.sh 'selection'" + }, + "custom/donotdisturb":{ + "format": "{}", + "exec": "~/.config/waybar/donotdisturb_status.sh", + "on-click": "~/.config/waybar/donotdisturb_toggle.sh" + +} diff --git a/sway/.config/waybar/donotdisturb_status.sh b/sway/.config/waybar/donotdisturb_status.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +TIMEOUT=1 + +while [ ! -z $(pidof waybar) ]; do + if [ $(makoctl mode) != "default" ]; then + echo '🔕' + else + echo '🔔' + fi + sleep $TIMEOUT +done diff --git a/sway/.config/waybar/donotdisturb_toggle.sh b/sway/.config/waybar/donotdisturb_toggle.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +if [ $(makoctl mode) != "default" ]; then + makoctl set-mode default +else + makoctl set-mode do-not-disturb +fi + diff --git a/sway/.config/waybar/gaps b/sway/.config/waybar/gaps @@ -0,0 +1,12 @@ +[{ + "layer": "top", + "position": "left", +}, +{ + "layer": "top", + "position": "right", +}, +{ + "layer": "top", + "position": "bottom", +}] diff --git a/sway/.config/waybar/gaps.css b/sway/.config/waybar/gaps.css @@ -0,0 +1,5 @@ +* { + background: transparent; + min-width: 10px; + min-height: 10px; +} diff --git a/sway/.config/waybar/modules/audio-output.sh b/sway/.config/waybar/modules/audio-output.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +CURRENT=$(wpctl status | sed -n '/^Audio$/,/Sink endpoints:$/p' | sed -n '/\[vol: .*\]/p' | grep '*') +check_current () { if echo "$CURRENT" | grep -i "$1" &>/dev/null ; then echo true ; fi ; } + +case true in + "$(check_current "HDMI")") echo '{"text": "HDMI", "alt": "hdmi"}' | jq --unbuffered --compact-output ;; + "$(check_current "Wireless")") echo '{"text": "Headphone", "alt": "headphone"}' | jq --unbuffered --compact-output ;; + "$(check_current "Galaxy buds")") echo '{"text": "Galaxy Buds", "alt": "buds"}' | jq --unbuffered --compact-output ;; + *) echo '{"text": "??", "alt": "others"}' | jq --unbuffered --compact-output ;; +esac diff --git a/sway/.config/waybar/modules/audio-volume.sh b/sway/.config/waybar/modules/audio-volume.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +VOLUME=`echo "$(get-volume)*100" | bc | cut -d'.' -f1` +echo '{"percentage": '$VOLUME'}' | jq --unbuffered --compact-output diff --git a/sway/.config/waybar/modules/audio.sh b/sway/.config/waybar/modules/audio.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +CURRENT=$(wpctl status | sed -n '/^Audio$/,/Sink endpoints:$/p' | sed -n '/\[vol: .*\]/p' | grep '*') +VOLUME=`echo "$(get-volume)*100" | bc | cut -d'.' -f1` + +if echo "$CURRENT" | grep -i "HDMI" &>/dev/null ; then + echo '{"text": "'$VOLUME'", "alt": "hdmi"}' | jq --unbuffered --compact-output +elif echo "$CURRENT" | grep "Wireless" &>/dev/null ; then + echo '{"text": "'$VOLUME'", "alt": "headphone"}' | jq --unbuffered --compact-output +elif echo "$CURRENT" | grep "Galaxy Buds" &>/dev/null ; then + # "percentage": '$(buds_battery.py A8:87:B3:01:80:07 | tr ',' '\n' | sort -n | head -n 1 || echo 1)' + echo '{"text": "'$VOLUME'", "alt": "buds"}' | jq --unbuffered --compact-output +else + echo '{"text": "'$VOLUME'", "alt": "other"}' | jq --unbuffered --compact-output +fi diff --git a/sway/.config/waybar/snip.sh b/sway/.config/waybar/snip.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +SCREENSHOT="$HOME/Bilder/Screenshots/$(date +%Y-%m-%d_%H_%M_%S).png" + +# Make screenshot either on selection of whole screen +if [[ "$1" == "selection" ]]; then + grim -g "$(slurp -b "#FFFFFF30" -c "#58364e" -d )" "$SCREENSHOT" +else + grim "$SCREENSHOT" +fi + +# copy screenshot path to clipboard +wl-copy < "$SCREENSHOT" + +# send notification to user +notify-send "Screenshot!" "$SCREENSHOT" + diff --git a/sway/.config/waybar/style.css b/sway/.config/waybar/style.css @@ -0,0 +1,300 @@ +* { + border: none; + border-radius: 5px; + /* `otf-font-awesome` is required to be installed for icons */ + font-family: Roboto, Helvetica, Arial, sans-serif; + font-size: 13px; + min-height: 0; +} + +window#waybar { + background-color: transparent; + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + + +#workspaces button { + background: #1f1f1f; + color: #ffffff; + border-radius: 20px; + +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +#workspaces button:hover { + background: lightblue; + color: black; + border-bottom: 3px solid #ffffff; + +} + +#workspaces button.focused { + background: #1f1f1f; +} + +#workspaces button.focused:hover { + background: lightblue; + color: black; + border-bottom: 3px solid #ffffff; + +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + border-bottom: 3px solid #ffffff; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#custom-media, +#custom-launcher, +#custom-power, +#custom-layout, +#custom-updater, +#custom-snip, +#custom-donotdisturb, +#taskbar, +#tray, +#mode, +#idle_inhibitor, +#mpd { + padding: 0 10px; + color: #ffffff; +} + +#window, +#workspaces { + margin: 0px 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0px; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0px; +} + +#clock { + background-color: #171717; + color: #ffffff; +} + +#battery { + background-color: #ffffff; + color: #000000; +} + +#battery.charging, #battery.plugged { + color: #ffffff; + background-color: #26A65B; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + +#cpu { + background-color: #171717; + color: #ffffff; +} + +#memory { + background-color: #171717; + color: #ffffff; +} + +#disk { + background-color: #171717; + color: #ffffff; +} + +#backlight { + background-color: #171717; + color: #ffffff; +} + +#network { + background-color: #171717; + color: #ffffff; +} + +#network.disconnected { + background-color: #171717; + color: red; +} + +#pulseaudio { + background-color: #171717; + color: #ffffff; +} + +#pulseaudio.muted { + background-color: #171717; + color: red; +} + +#custom-media { + background-color: #8EC5FC; + background-image: linear-gradient(62deg, #8EC5FC 0%, #E0C3FC 100%); + color: black; + border-radius: 20px; + margin-right: 5px; + margin-left: 5px; +} + +#custom-media.custom-spotify { + background-color: #8EC5FC; + background-image: linear-gradient(62deg, #8EC5FC 0%, #E0C3FC 100%); + color: black; + border-radius: 20px; + margin-right: 5px; + +} + +#custom-media.custom-vlc { + background-color: #8EC5FC; + background-image: linear-gradient(62deg, #8EC5FC 0%, #E0C3FC 100%); + color: black; + border-radius: 20px; + margin-right: 5px; +} + +#custom-power{ + background-color: #171717; + font-size: 18px; + border-radius: 0px 20px 20px 0px; + margin-right: 5px; +} + +#custom-launcher{ + background-color: #171717; + font-size: 20px; + border-radius: 20px 0px 0px 20px; + margin-left: 5px; + +} + +#custom-layout{ + background-color: #171717; + color: white; + font-size:20px; +} + +#custom-updater { + background-color: #171717; + color: white; +} + +#custom-snip { + background-color: #171717; + color: skyblue; + font-size: 20px; +} + +#custom-donotdisturb { + background-color: #171717; + color: skyblue; +} + + + +#taskbar{ + background-color: #171717; + border-radius: 0px 20px 20px 0px; +} + +#temperature { + background-color: #171717; + color: #ffffff; +} + +#temperature.critical { + background-color: #eb4d4b; +} + +#tray { + background-color: #171717; + color: #ffffff; +} + +#tray > .passive { + -gtk-icon-effect: dim; + background-color: #171717; + color: #ffffff; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #171717; + color: #ffffff; +} + +#idle_inhibitor { + background-color: #171717; + border-radius: 20px 0px 0px 20px; + +} + +#idle_inhibitor.activated { + background-color: #171717; + color: #ffffff; + border-radius: 20px 0px 0px 20px; + +} + +#language { + background-color: #171717; + color: #ffffff; + min-width: 16px; +} + +#keyboard-state { + background: #97e1ad; + color: #000000; + min-width: 16px; +} + +#keyboard-state > label { + padding: 0px 5px; +} + +#keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); +} diff --git a/sway/.config/wofi/config b/sway/.config/wofi/config @@ -0,0 +1,20 @@ +hide_scroll=true +show=drun +width=50% +lines=8 +line_wrap=word +term=foot +allow_markup=true +always_parse_args=false +show_all=true +print_command=true +layer=overlay +allow_images=true +sort_order=alphabetical +gtk_dark=true +prompt= +image_size=28 +display_generic=true +location=center +key_expand=Tab +insensitive=true diff --git a/sway/.config/wofi/style.css b/sway/.config/wofi/style.css @@ -0,0 +1,41 @@ +* { + color: #e5e9f0; + background: transparent; +} + +#window { + background: rgba(41, 46, 66, 0.9); + margin: auto; + padding: 10px; + border-radius: 20px; + border: 5px solid #b072d1; +} + +#input { + padding: 10px; + margin-bottom: 10px; + border-radius: 15px; +} + +#outer-box { + padding: 20px; +} + +#img { + margin-right: 6px; +} + +#entry { + padding: 10px; + border-radius: 15px; +} + +#entry:selected { + background-color: #2e3440; +} + +#text { + margin: 2px; + font-size: 18px; + font-family: Fira Code Regular +}