···
+
programs.oh-my-posh = {
+
enableZshIntegration = true;
+
console_title_template = "{{ .Shell }} in {{ .Folder }}";
+
background = "transparent";
+
template = "{{ if .SSHSession }}{{.HostName}} {{ end }}";
+
background = "transparent";
+
template = "{{ .Path }} ";
+
background = "transparent";
+
template = "{{if not .Detached}}{{ .HEAD }}{{else}}@{{ printf \"%.7s\" .Commit.Sha }}{{end}}{{ if .Staging.Changed }} ({{ .Staging.String }}){{ end }}{{ if .Working.Changed }}*{{ end }} <cyan>{{ if .BranchStatus }}{{ .BranchStatus }}{{ end }}</>";
+
branch_identical_icon = "";
+
branch_ahead_icon = "⇡";
+
branch_behind_icon = "⇣";
+
type = "executiontime";
+
background = "transparent";
+
template = "{{ .FormattedMs }}";
+
background = "transparent";
+
template = ''{{if ne .Type "unknown" }} {{ .Type }}{{ end }}'';
+
foreground_templates = [
+
"{{if gt .Code 0}}red{{end}}"
+
"{{if eq .Code 0}}magenta{{end}}"
+
background = "transparent";
+
foreground_templates = [
+
"{{if gt .Code 0}}red{{end}}"
+
"{{if eq .Code 0}}magenta{{end}}"
+
background = "transparent";
+
background = "transparent";
+
enableCompletion = true;
+
syntaxHighlighting.enable = true;
+
ghrpc = "gh repo create -c";
+
goops = "git commit --amend --no-edit && git push --force-with-lease";
+
chngwall = "~/.config/hypr/randomize.sh";
+
ssh -p $port -o "BatchMode yes" $host || sleep 1
+
"https://waka.hackclub.com/api/summary?user=''${user_id}&interval=month" \
+
-H 'accept: application/json' \
+
-H 'Authorization: Bearer 2ce9e698-8a16-46f0-b49a-ac121bcfd608' | jq '. + {
+
"total_categories_sum": (.categories | map(.total) | add),
+
"total_categories_human_readable": (
+
(.categories | map(.total) | add) as $total_seconds |
+
"\($total_seconds / 3600 | floor)h \(($total_seconds % 3600) / 60 | floor)m \($total_seconds % 60)s"
+
.projects | sort_by(-.total) | map(.key)
+
# Configuration variables - set these to your defaults
+
local default_plc_id="did:plc:krxbvxvis5skq7jj6eot23ul"
+
local default_github_username="taciturnaxolotl"
+
local extracted_github_username=""
+
# Check if current directory is a git repository
+
if ! git rev-parse --is-inside-work-tree &>/dev/null; then
+
echo "Not a git repository"
+
# Get the repository name from the current directory
+
local repo_name=$(basename "$(git rev-parse --show-toplevel)")
+
# Check if origin remote exists and points to ember
+
local origin_url=$(git remote get-url origin 2>/dev/null)
+
local origin_ember=false
+
if [[ -n "$origin_url" ]]; then
+
# Try to extract GitHub username if origin is a GitHub URL
+
if [[ "$origin_url" == *"github.com"* ]]; then
+
extracted_github_username=$(echo "$origin_url" | sed -E 's/.*github\.com[:/]([^/]+)\/.*$/\1/')
+
# Override the default username with the extracted one
+
default_github_username=$extracted_github_username
+
if [[ "$origin_url" == *"ember"* ]]; then
+
echo "✅ Origin remote exists and points to ember"
+
echo "⚠️ Origin remote exists but doesn't point to ember"
+
echo "⚠️ Origin remote doesn't exist"
+
# Check if github remote exists
+
local github_exists=false
+
if git remote get-url github &>/dev/null; then
+
echo "✅ GitHub remote exists"
+
echo "⚠️ GitHub remote doesn't exist"
+
# Fix remotes if needed
+
if [[ "$origin_ember" = false || "$github_exists" = false ]]; then
+
echo "Setting up remotes..."
+
# Prompt for PLC identifier if needed
+
if [[ "$origin_ember" = false ]]; then
+
echo -n "Enter your PLC identifier [default: $default_plc_id]: "
+
plc_id=''${plc_input:-$default_plc_id}
+
# Prompt for GitHub username with default from origin if available
+
local github_username=""
+
if [[ "$github_exists" = false ]]; then
+
echo -n "Enter your GitHub username [default: $default_github_username]: "
+
github_username=''${github_input:-$default_github_username}
+
# Set up origin remote if needed
+
if [[ "$origin_ember" = false && -n "$plc_id" ]]; then
+
if git remote get-url origin &>/dev/null; then
+
git remote remove origin
+
git remote add origin "git@ember:''${plc_id}/''${repo_name}"
+
echo "✅ Set up origin remote: git@ember:''${plc_id}/''${repo_name}"
+
# Set up GitHub remote if needed
+
if [[ "$github_exists" = false && -n "$github_username" ]]; then
+
git remote add github "git@github.com:''${github_username}/''${repo_name}.git"
+
echo "✅ Set up GitHub remote: git@github.com:''${github_username}/''${repo_name}.git"
+
echo "Remotes are correctly configured"
+
# Post AtProto status updates
+
local prompt_message=true
+
# Load account information from agenix secrets
+
if [[ -f "/run/agenix/bluesky" ]]; then
+
source "/run/agenix/bluesky"
+
echo "Error: Bluesky credentials file not found at /run/agenix/bluesky"
+
while [[ $# -gt 0 ]]; do
+
echo "Usage: now [-m|--message \"your message\"]"
+
# Prompt for message if none provided
+
if [[ "$prompt_message" = true ]]; then
+
echo -n "$ACCOUNT1 is: "
+
if [[ -z "$message" ]]; then
+
echo "No message provided. Aborting."
+
# Generate JWT for ACCOUNT1
+
local account1_response=$(curl -s -X POST \
+
-H "Content-Type: application/json" \
+
"identifier": "'$ACCOUNT1'",
+
"password": "'$ACCOUNT1_PASSWORD'"
+
"https://bsky.social/xrpc/com.atproto.server.createSession")
+
account1_jwt=$(echo "$account1_response" | jq -r '.accessJwt')
+
if [[ -z "$account1_jwt" || "$account1_jwt" == "null" ]]; then
+
echo "Failed to authenticate account $ACCOUNT1"
+
echo "Response: $account1_response"
+
# Generate JWT for ACCOUNT2
+
local account2_response=$(curl -s -X POST \
+
-H "Content-Type: application/json" \
+
"identifier": "'$ACCOUNT2'",
+
"password": "'$ACCOUNT2_PASSWORD'"
+
"https://bsky.social/xrpc/com.atproto.server.createSession")
+
account2_jwt=$(echo "$account2_response" | jq -r '.accessJwt')
+
if [[ -z "$account2_jwt" || "$account2_jwt" == "null" ]]; then
+
echo "Failed to authenticate account $ACCOUNT2"
+
echo "Response: $account2_response"
+
# Post to ACCOUNT1 as a.status.updates
+
local account1_post_response=$(curl -s -X POST \
+
-H "Content-Type: application/json" \
+
-H "Authorization: Bearer $account1_jwt" \
+
"collection": "a.status.update",
+
"$type": "a.status.update",
+
"text": "'"$message"'",
+
"createdAt": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'"
+
"https://bsky.social/xrpc/com.atproto.repo.createRecord")
+
if [[ $(echo "$account1_post_response" | jq -r 'has("error")') == "true" ]]; then
+
echo "Error posting to $ACCOUNT1:"
+
echo "$account1_post_response" | jq
+
# Post to ACCOUNT2 as normal post
+
local account2_post_response=$(curl -s -X POST \
+
-H "Content-Type: application/json" \
+
-H "Authorization: Bearer $account2_jwt" \
+
"collection": "app.bsky.feed.post",
+
"$type": "app.bsky.feed.post",
+
"text": "'"$message"'",
+
"createdAt": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'"
+
"https://bsky.social/xrpc/com.atproto.repo.createRecord")
+
if [[ $(echo "$account2_post_response" | jq -r 'has("error")') == "true" ]]; then
+
echo "Error posting to $ACCOUNT2:"
+
echo "$account2_post_response" | jq
+
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
+
zstyle ':completion:*' list-colors "''${(s.:.)LS_COLORS}"
+
zstyle ':completion:*' menu no
+
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
+
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
+
eval "$(terminal-wakatime init)"
+
path = "${config.xdg.dataHome}/zsh/history";
+
expireDuplicatesFirst = true;
+
# will source zsh-autosuggestions.plugin.zsh
+
name = "zsh-autosuggestions";
+
src = pkgs.fetchFromGitHub {
+
repo = "zsh-autosuggestions";
+
sha256 = "sha256-KLUYpUu4DHRumQZ3w59m9aTW6TBKMCXl2UcKi4uMd7w=";
+
# will source zsh-sytax-highlighting
+
name = "zsh-sytax-highlighting";
+
src = pkgs.fetchFromGitHub {
+
repo = "zsh-syntax-highlighting";
+
sha256 = "sha256-iJdWopZwHpSyYl5/FQXEW7gl/SrKaYDEtTH9cGP7iPo=";
+
src = pkgs.fetchFromGitHub {
+
sha256 = "sha256-Qv8zAiMtrr67CbLRrFjGaPzFZcOiMVEFLg1Z+N6VMhg=";
+
enableZshIntegration = true;
+
enableZshIntegration = true;
+
sync_address = "https://api.atuin.sh";
+
#session_path = config.age.secrets."atuin-session".path;
+
#key_path = config.age.secrets."atuin-key".path;
+
dotfiles.enabled = false;