diff --git a/code/.config/Code - OSS/User/settings.json b/code/.config/Code - OSS/User/settings.json index e7836a4..bf9ecac 100644 --- a/code/.config/Code - OSS/User/settings.json +++ b/code/.config/Code - OSS/User/settings.json @@ -1,17 +1,17 @@ { // Remove clutter - // "window.titleBarStyle": "custom", - "window.menuBarVisibility": "toggle", - "workbench.activityBar.visible": false, - "workbench.editor.showTabs": false, - "workbench.editor.enablePreview": false, - "workbench.editor.enablePreviewFromQuickOpen": true, - "breadcrumbs.enabled": false, - "workbench.editor.closeEmptyGroups": true, - "workbench.editor.tabCloseButton": "off", - "explorer.openEditors.visible": 0, - "debug.openDebug": "openOnDebugBreak", - "debug.internalConsoleOptions": "none", + "window.titleBarStyle": "custom", + // "window.menuBarVisibility": "toggle", + // "workbench.activityBar.visible": false, + // "workbench.editor.showTabs": false, + // "workbench.editor.enablePreview": false, + // "workbench.editor.enablePreviewFromQuickOpen": true, + // "breadcrumbs.enabled": false, + // "workbench.editor.closeEmptyGroups": true, + // "workbench.editor.tabCloseButton": "off", + // "explorer.openEditors.visible": 0, + // "debug.openDebug": "openOnDebugBreak", + // "debug.internalConsoleOptions": "none", // Don't ask "git.autofetch": true, "git.confirmSync": false, diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index 5f0d555..a831b07 100644 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -39,7 +39,7 @@ abbr ec edit-config function mutt --wraps=neomutt --description 'alias mutt=neomutt' neomutt $argv; - pkill -SIGRTMIN+4 waybar + pkill -RTMIN+4 waybar end abbr neomutt mutt diff --git a/scripts/.local/bin/sway-screenshare b/scripts/.local/bin/sway-screenshare new file mode 100755 index 0000000..26d74fa --- /dev/null +++ b/scripts/.local/bin/sway-screenshare @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +set -x +if ! lsmod | grep v4l2loopback > /dev/null; then + echo "Adding v42loopback module to kernel" + sudo modprobe v4l2loopback +fi + +geometry(){ + windowGeometries=$( + # `height - 1` is there because of: https://github.com/ammen99/wf-recorder/pull/56 (I could remove it if it's merged, maybe) + swaymsg -t get_workspaces -r | jq -r '.[] | select(.focused) | .rect | "\(.x),\(.y) \(.width)x\(.height - 1)"'; \ + swaymsg -t get_outputs -r | jq -r '.[] | select(.active) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' + ) + geometry=$(slurp -b "#45858820" -c "#45858880" -w 3 -d <<< "$windowGeometries") || exit $? + echo $geometry +} + +{ +if [ "$1" == "stop" ]; then + if pgrep ffplay > /dev/null; then + pkill ffplay > /dev/null + fi + if pgrep wf-recorder > /dev/null; then + pkill wf-recorder > /dev/null + fi + notify-send -t 2000 "Wayland recording has been stopped" +elif [ "$1" == "is-recording" ]; then + if pgrep wf-recorder > /dev/null && pgrep ffplay > /dev/null; then + notify-send -t 2000 "Wayland recording is up" + else + notify-send -t 2000 "No Wayland recording" + fi +else + if ! pgrep wf-recorder > /dev/null; then + geometry=$(geometry) || exit $? + wf-recorder --muxer=v4l2 --codec=rawvideo --file=/dev/video2 --geometry="$geometry" & + fi + if ! pgrep ffplay; then + unset SDL_VIDEODRIVER + ffplay /dev/video2 & + sleep 0.5 + # a hack so FPS is not dropping + swaymsg [class=ffplay] move position 1915 1050 + swaymsg focus tiling + fi + notify-send -t 2000 "Wayland recording has been started" +fi +} > ~/.wayland-share-screen.log 2>&1 diff --git a/scripts/.local/bin/terminal b/scripts/.local/bin/terminal new file mode 100755 index 0000000..1e42953 --- /dev/null +++ b/scripts/.local/bin/terminal @@ -0,0 +1,6 @@ +#!/bin/sh + +command -v kitty > /dev/null && + exec kitty $@ +command -v alacritty > /dev/null && + exec alacritty -e $@ diff --git a/sway/.config/sway/config b/sway/.config/sway/config index d681b8f..40c0bb6 100644 --- a/sway/.config/sway/config +++ b/sway/.config/sway/config @@ -16,7 +16,7 @@ set $up k set $right l - set $term alacritty + set $term terminal # set $menu wofi --show drun --allow-images --insensitive --term $term -p'Iniciar: ' set $menu bmenu run $term font Fira Code 14px diff --git a/sway/.config/waybar/config b/sway/.config/waybar/config index 7688733..3b530ae 100644 --- a/sway/.config/waybar/config +++ b/sway/.config/waybar/config @@ -107,7 +107,7 @@ "format": "{}", "exec": "jq -r '.temp +\"°C \"+ .weather' .forecast.json", "interval": 30, - "on-click": "alacritty --class weather -e sh -c 'forecast full;read -n1 -p\"Press Any key to quit \"'", + "on-click": "terminal --class weather sh -c 'forecast full;read -n1 -p\"Press Any key to quit \"'", "on-click-right": "xdg-open https://openweathermap.org" }, "custom/mail": { @@ -115,7 +115,7 @@ "format":"{} ", "exec-if":"sleep 30s", "exec": "checkmail", - "on-click": "alacritty -e neomutt; pkill -SIGRTMIN+4 waybar", + "on-click": "terminal neomutt; pkill -SIGRTMIN+4 waybar", "signal": 4, "interval": 30 }, @@ -125,7 +125,7 @@ "interval": 60, "exec-if":"sleep 60s", "exec": "yay -Qqu | wc -l | sed 's/^0$//'", - "on-click": "alacritty -e sh -c 'ping -qc1 archlinux.org >/dev/null && yay -Syu || yay -Su; pkill -SIGRTMIN+8 waybar; read'", + "on-click": "terminal sh -c 'ping -qc1 archlinux.org >/dev/null && yay -Syu || yay -Su; pkill -SIGRTMIN+8 waybar; read'", "signal": 8 }, "custom/recording": { @@ -139,7 +139,7 @@ "format":"{}", "exec":"pgrep -f spigot.jar>/dev/null && spigot command list | awk '/There are/ {if ($6) print $6}'", "interval":30, - "on-click":"alacritty -e spigot console" + "on-click":"terminal spigot console" }, "custom/delugeD":{ "format":"{}",