Skip to content

Instantly share code, notes, and snippets.

@Atrate
Atrate / hyprtabs.sh
Last active March 2, 2024 12:50
i3-like tabs for Hyprland. Usage: save the script as `~/.config/hypr/hyprtabs.sh` or somewhere else and add the following to your `hyprland.conf`, changing the keybind or path as you see fit: `bind = $mainMod SHIFT, w, exec, ~/.config/hypr/hyprtabs.sh`
#!/bin/bash --posix
# ------------------------------------------------------------------------------
# Copyright (C) 2024 Atrate
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
@Atrate
Atrate / restoresyncthing.sh
Created September 10, 2023 20:15
Restore files that were backed up by Syncthing as "sync conflicts"
#!/bin/bash --posix
# ------------------------------------------------------------------------
# Copyright (C) 2023 Atrate
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
@Atrate
Atrate / window_volume.sh
Last active August 28, 2023 09:32
Bash script to adjust the volume of the currently focused window
#!/bin/bash --posix
# Copyright (C) 2020-2023 Atrate <atrate@protonmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@Atrate
Atrate / snowstats.sh
Last active April 2, 2024 19:02
Quick script to get the statistics of traffic on Tor Project's Snowflake proxy instance running locally on docker
#!/bin/bash --posix
docker logs snowflake-proxy 2>&1 | grep --color=auto 'Traffic Relayed' | awk '
{
# Extract the download and upload values
down[1] = $14
down[2] = $15
gsub(/[^a-zA-Z]/, "", down[2])
up[1] = $17
up[2] = $18