forked from blue-build/legacy-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from gerblesh/modular-rewrite
Modular rewrite
- Loading branch information
Showing
52,092 changed files
with
287,648 additions
and
41 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
ublue_variants: | ||
- label: ublue-os/startingpoint | ||
- label: gerblesh/usway-rewrite | ||
ks: /kickstart/ublue-os.ks | ||
flavors: | ||
- label: startingpoint | ||
- label: usway-rewrite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
type: bling # configure what to pull in from ublue-os/bling | ||
install: | ||
- fonts # selection of common good free fonts | ||
- justfiles # add "!include /usr/share/ublue-os/just/bling.just" | ||
# in your custom.just (added by default) or local justfile | ||
- nix-installer # shell shortcuts for determinate system's nix installers | ||
- ublue-os-wallpapers | ||
- ublue-update # https://github.com/ublue-os/ublue-update | ||
# - dconf-update-service # a service unit that updates the dconf db on boot | ||
# - devpod # https://devpod.sh/ as an rpm |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
# Low battery notifier | ||
|
||
# Kill already running processes | ||
already_running="$(ps -fC 'grep' -N | grep 'battery.sh' | wc -l)" | ||
if [[ $already_running -gt 1 ]]; then | ||
pkill -f --older 1 'battery.sh' | ||
fi | ||
|
||
while [[ 0 -eq 0 ]]; do | ||
battery_status="$(cat /sys/class/power_supply/BAT1/status)" | ||
battery_charge="$(cat /sys/class/power_supply/BAT1/capacity)" | ||
|
||
if [[ $battery_status == 'Discharging' ]]; then | ||
if [[ $battery_charge -le 10 ]]; then | ||
notify-send "Battery Critical!" "Battery is at ${battery_charge}%" --app-name "Power Alerts" --urgency "critical" --icon "battery-000" | ||
pw-cat -p /usr/share/sounds/speech-dispatcher/prompt.wav | ||
powerprofilesctl set power-saver | ||
sleep 180 | ||
elif [[ $battery_charge -le 25 ]]; then | ||
notify-send "Battery Low!" "Battery is at ${battery_charge}%" --app-name "Power Alerts" --urgency "critical" --icon "battery-010" | ||
pw-cat -p /usr/share/sounds/freedesktop/stereo/dialog-warning.oga | ||
powerprofilesctl set power-saver | ||
sleep 240 | ||
fi | ||
else | ||
sleep 600 | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
brightness_percent=$(light | LC_ALL=C xargs /usr/bin/printf "%.*f\n" "$p") | ||
|
||
notify-send \ | ||
--app-name sway \ | ||
--expire-time 800 \ | ||
--hint string:x-canonical-private-synchronous:volume \ | ||
--hint "int:value:$brightness_percent" \ | ||
--hint "string:category:backlight" \ | ||
--transient \ | ||
"Brightness" "$brightness_percent" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
default_cache_home=~/.cache | ||
cache_home="${XDG_CACHE_HOME:-$default_cache_home}" | ||
mkdir -p "$cache_home" | ||
data_file="$cache_home/emoji-menu.json" | ||
|
||
if ! [ -f "$data_file" ]; then | ||
curl -o "$data_file" -L "https://github.com/github/gemoji/raw/master/db/emoji.json" | ||
fi | ||
|
||
filter='.[] | (.emoji + " " + .description + " (" + (.aliases | join(", ")) + ")")' | ||
sel="$(jq -r "$filter" <"$data_file" | fuzzel --dmenu --prompt " Select Emoji: " | cut -d ' ' -f 1 | tr -d '\n')" | ||
if [ -n "$sel" ]; then | ||
wl-copy "$sel" | ||
wtype "$sel" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
image=$(cat ~/.config/wallpaper) | ||
|
||
playerctl -a pause | ||
swaylock -f --image "$image" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
|
||
playerctl -a pause | ||
|
||
options=" Screen Lock\n Logout\n Sleep\n⏻ Shutdown\n Restart\n BIOS" | ||
|
||
choice=$(printf "$options" | fuzzel --dmenu --index --prompt=" Goodbye! ") | ||
|
||
echo $choice | ||
|
||
case $choice in | ||
0) | ||
echo "Screenlock" | ||
/usr/bin/lock.sh | ||
;; | ||
1) | ||
echo "Logout" | ||
swaymsg exit | ||
;; | ||
2) | ||
echo "Suspend" | ||
systemctl suspend | ||
;; | ||
3) | ||
echo "Shutting down.." | ||
systemctl poweroff | ||
;; | ||
4) | ||
echo "Restarting" | ||
systemctl reboot | ||
;; | ||
5) | ||
echo "entering UEFI firmware interface" | ||
systemctl reboot --firmware-setup | ||
;; | ||
esac | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
|
||
FILE="$(grimshot save $1)" | ||
|
||
if [[ -f "$FILE" ]]; then | ||
cat $FILE | wl-copy | ||
notify-send "Screenshot" "Screenshot taken, copied to clipboard and saved in Pictures folder" --icon "$FILE" --app-name "screenshot.sh" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
#!/usr/bin/python3 | ||
|
||
# This script requires i3ipc-python package (install it from a system package manager | ||
# or pip). | ||
# It adds icons to the workspace name for each open window. | ||
# Set your keybindings like this: set $workspace1 workspace number 1 | ||
# Add your icons to WINDOW_ICONS. | ||
# Based on https://github.com/maximbaz/dotfiles/blob/master/bin/i3-autoname-workspaces | ||
|
||
import argparse | ||
import i3ipc | ||
import logging | ||
import re | ||
import signal | ||
import sys | ||
|
||
WINDOW_ICONS = { | ||
"firefox": "", | ||
"godot": "", | ||
"foot": "", | ||
"brave-browser": "", | ||
"lite-xl": "", | ||
"spot": "", | ||
"com.github.neithern.g4music": "", | ||
"thunar": "", | ||
"mpv": "", | ||
"imv": "", | ||
"com.obsproject.Studio": "", | ||
"obsidian": "", | ||
"mullvad vpn": "" | ||
} | ||
|
||
DEFAULT_ICON = "" | ||
|
||
|
||
def icon_for_window(window): | ||
name = None | ||
if window.app_id is not None and len(window.app_id) > 0: | ||
name = window.app_id.lower() | ||
elif window.window_class is not None and len(window.window_class) > 0: | ||
name = window.window_class.lower() | ||
|
||
|
||
if name in WINDOW_ICONS: | ||
return WINDOW_ICONS[name] | ||
|
||
logging.info("No icon available for window with name: %s" % str(name)) | ||
return DEFAULT_ICON | ||
|
||
def rename_workspaces(ipc): | ||
for workspace in ipc.get_tree().workspaces(): | ||
name_parts = parse_workspace_name(workspace.name) | ||
icon_tuple = () | ||
for w in workspace: | ||
if w.app_id is not None or w.window_class is not None: | ||
icon = icon_for_window(w) | ||
if not ARGUMENTS.duplicates and icon in icon_tuple: | ||
continue | ||
icon_tuple += (icon,) | ||
name_parts["icons"] = " ".join(icon_tuple) + " " | ||
|
||
new_name = construct_workspace_name(name_parts) | ||
ipc.command('rename workspace "%s" to "%s"' % (workspace.name, str(new_name))) | ||
|
||
|
||
def undo_window_renaming(ipc): | ||
for workspace in ipc.get_tree().workspaces(): | ||
name_parts = parse_workspace_name(workspace.name) | ||
name_parts["icons"] = None | ||
new_name = construct_workspace_name(name_parts) | ||
ipc.command('rename workspace "%s" to "%s"' % (workspace.name, new_name)) | ||
ipc.main_quit() | ||
sys.exit(0) | ||
|
||
|
||
def parse_workspace_name(name): | ||
return re.match( | ||
"(?P<num>[0-9]+):?(?P<shortname>\w+)? ?(?P<icons>.+)?", name | ||
).groupdict() | ||
|
||
|
||
def construct_workspace_name(parts): | ||
new_name = parts["num"] | ||
icons = parts["icons"] | ||
if icons: | ||
icons = icons.replace(" ", "") | ||
|
||
if parts["shortname"] or icons: | ||
new_name += ":" | ||
|
||
if parts["shortname"]: | ||
new_name += parts["shortname"] | ||
|
||
if parts["icons"]: | ||
new_name += " " + parts["icons"] | ||
return new_name | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser( | ||
description="This script automatically changes the workspace name in sway depending on your open applications." | ||
) | ||
parser.add_argument( | ||
"--duplicates", | ||
"-d", | ||
action="store_true", | ||
help="Set it when you want an icon for each instance of the same application per workspace.", | ||
) | ||
parser.add_argument( | ||
"--logfile", | ||
"-l", | ||
type=str, | ||
default="/tmp/sway-autoname-workspaces.log", | ||
help="Path for the logfile.", | ||
) | ||
args = parser.parse_args() | ||
global ARGUMENTS | ||
ARGUMENTS = args | ||
|
||
logging.basicConfig( | ||
level=logging.INFO, | ||
filename=ARGUMENTS.logfile, | ||
filemode="w", | ||
format="%(message)s", | ||
) | ||
|
||
ipc = i3ipc.Connection() | ||
|
||
for sig in [signal.SIGINT, signal.SIGTERM]: | ||
signal.signal(sig, lambda signal, frame: undo_window_renaming(ipc)) | ||
|
||
def window_event_handler(ipc, e): | ||
if e.change in ["new", "close", "move"]: | ||
rename_workspaces(ipc) | ||
|
||
ipc.on("window", window_event_handler) | ||
|
||
rename_workspaces(ipc) | ||
|
||
ipc.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
|
||
|
||
volume="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2}')" | ||
|
||
volume_muted="$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $3}')" | ||
volume_percent=$(echo "$volume * 100" | bc | LC_ALL=C xargs /usr/bin/printf "%.*f\n" "$p") | ||
volume_string="$volume_percent $volume_muted" | ||
|
||
|
||
|
||
notify-send \ | ||
--app-name sway \ | ||
--expire-time 800 \ | ||
--hint string:x-canonical-private-synchronous:volume \ | ||
--hint "int:value:$volume_percent" \ | ||
--hint "string:category:volume" \ | ||
--transient \ | ||
"Volume" "$volume_string" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
WALLPAPER_PATH="" | ||
# Default Wallpaper, feel free to change this to whatever you like | ||
DEFAULT_WALLPAPER="$HOME/Pictures/Wallpapers/Mocha/mocha-background.jpg" | ||
|
||
if [ ! -f "$HOME/.config/wallpaper" ]; then | ||
echo "$DEFAULT_WALLPAPER" > "$HOME/.config/wallpaper" | ||
fi | ||
|
||
if [[ $1 == "init" ]]; then | ||
WALLPAPER_PATH=$(cat "$HOME/.config/wallpaper") | ||
else | ||
if [ ! -f "$1" ]; then | ||
echo "Error: No File Exists at $1" | ||
exit 1 | ||
fi | ||
PID=$(pidof swaybg) | ||
kill $PID | ||
echo "$1" > "$HOME/.config/wallpaper" | ||
WALLPAPER_PATH="$1" | ||
fi | ||
|
||
FULL_WALLPAPER_PATH="${WALLPAPER_PATH/#\~/$HOME}" | ||
|
||
swaybg -i "$FULL_WALLPAPER_PATH" -m fill & | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
NEW_WALLPAPER=$(/usr/bin/ls -1 "$HOME/Pictures/Wallpapers/Mocha" | fuzzel --dmenu --prompt " Select Wallpaper: ") | ||
|
||
/usr/bin/wallpaper "$HOME/Pictures/Wallpapers/Mocha/$NEW_WALLPAPER" |
6 changes: 6 additions & 0 deletions
6
config/files/usr/etc/NetworkManager/conf.d/00-macrandomize.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[device] | ||
wifi.scan-rand-mac-address=yes | ||
|
||
[connection] | ||
wifi.cloned-mac-address=random | ||
ethernet.cloned-mac-address=random |
Oops, something went wrong.