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
# ~/.config/starship.toml | |
[battery] | |
full_symbol = "🔋" | |
charging_symbol = "🔌" | |
discharging_symbol = "⚡" | |
[[battery.display]] | |
threshold = 30 | |
style = "bold red" |
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
#!/bin/bash | |
# Set variables | |
REMOTE_URL="https://raw.githubusercontent.com/yokoffing/Betterfox/main/user.js" | |
LOCAL_DIR="$HOME/.mozilla/firefox" | |
PROFILE_DIR=$(ls -d "$LOCAL_DIR"/*.default-release | head -n 1) | |
LOCAL_FILE="$PROFILE_DIR/user.js" | |
TMP_FILE="/tmp/user.js.tmp" | |
# Function to send desktop notification |
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
#!/usr/bin/env python3 | |
import re | |
import subprocess | |
import requests | |
from bs4 import BeautifulSoup | |
from rich.console import Console | |
from rich.table import Table | |
from rich.prompt import Confirm | |
from getpass import getpass |
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
import sys | |
import re | |
import requests | |
from packaging import version, specifiers | |
def parse_requirement(requirement): | |
# Ignore git repository requirements | |
if requirement.startswith('git+'): | |
return None, None |
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
#!/bin/bash | |
# Exit immediately if a command exits with a non-zero status | |
set -e | |
# Function to display an error message and exit | |
error_exit() { | |
echo "Error: $1" >&2 | |
exit 1 | |
} |
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
#!/bin/bash | |
# Script to install fonts from a specified folder on a Linux system | |
# Function to display usage instructions | |
usage() { | |
echo "Usage: $0 FONT_FOLDER" | |
echo "Install all fonts from the specified folder to the system." | |
echo "Example: $0 /path/to/font/folder" | |
exit 1 |
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
#!/bin/bash | |
# Exit immediately if a command exits with a non-zero status. | |
set -e | |
# Function to print messages with date and time | |
log() { | |
echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')] $@" | |
} |
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
#!/bin/bash | |
# Get the full energy capacity of the battery as designed and the current full energy capacity | |
# Replace commas with dots to ensure proper arithmetic operations | |
energy_full_design=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep energy-full-design: | awk '{gsub(",","."); print $2}') | |
energy_full=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep energy-full: | awk '{gsub(",","."); print $2}') | |
# Calculate battery health as a percentage using awk | |
battery_health=$(awk -v e_full="$energy_full" -v e_design="$energy_full_design" 'BEGIN {printf "%.2f", (e_full/e_design)*100}') |
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
#!/bin/bash | |
# Function for displaying help | |
function display_help() { | |
echo "Usage: $0 [file/directory]... [options]" | |
echo | |
echo "Copy the content of [file] or all files in [directory] to clipboard" | |
echo | |
echo "Options:" | |
echo " --help Show this help message" |
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
#!/bin/bash | |
# Check if the script is run as root | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
# Detect the Linux distribution | |
if grep -qiE 'debian|ubuntu' /etc/os-release; then |
NewerOlder