From 455fbce803112e09815b11967834b43a2511b668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Mon, 29 Dec 2025 16:58:06 +0300 Subject: [PATCH] feat: :spark: new defaults apps by defining them on mimeapps --- .config/btop/btop.conf | 5 +- .config/hypr/hyprland.conf | 2 +- .config/mimeapps.list | 112 ++++++++++++++++++++++++++ .config/mpv/mpv.conf | 3 + .config/scripts/shared/song_detail.sh | 34 ++++---- 5 files changed, 137 insertions(+), 19 deletions(-) create mode 100644 .config/mpv/mpv.conf diff --git a/.config/btop/btop.conf b/.config/btop/btop.conf index 0dbb910..9ef0fe7 100644 --- a/.config/btop/btop.conf +++ b/.config/btop/btop.conf @@ -1,4 +1,4 @@ -#? Config file for btop v. 1.4.4 +#? Config file for btop v. 1.4.5 #* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. #* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" @@ -115,6 +115,9 @@ cpu_bottom = False #* Shows the system uptime in the CPU box. show_uptime = True +#* Shows the CPU package current power consumption in watts. Requires running `make setcap` or `make setuid` or running with sudo. +show_cpu_watts = True + #* Show cpu temperature. check_temp = True diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 9b72bc1..fc1e3a2 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -20,7 +20,7 @@ exec-once = sleep 3 && hyprctl keyword input:touchdevice:enabled false exec-once = sleep 3 && swaync-client -dn exec-once = sleep 3 && wl-paste --type text --watch cliphist store # Stores only text data exec-once = sleep 3 && wl-paste --type image --watch cliphist store # Stores only image data - +exec-once = sleep 4 && rfkill unblock bluetooth && bluetoothctl power on # exec = gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark" # for GTK3 apps # exec = gsettings set org.gnome.desktop.interface color-scheme "prefer-dark" # for GTK4 apps diff --git a/.config/mimeapps.list b/.config/mimeapps.list index 6804d5a..1a85015 100644 --- a/.config/mimeapps.list +++ b/.config/mimeapps.list @@ -1,5 +1,117 @@ [Default Applications] video/mp4=org.gnome.Showtime.desktop +video/x-msvideo=org.gnome.Showtime.desktop +video/x-matroska=org.gnome.Showtime.desktop +video/quicktime=org.gnome.Showtime.desktop +video/x-flv=org.gnome.Showtime.desktop +video/x-ms-wmv=org.gnome.Showtime.desktop +video/x-m4v=org.gnome.Showtime.desktop +video/webm=org.gnome.Showtime.desktop +video/ogg=org.gnome.Showtime.desktop +video/mpeg=org.gnome.Showtime.desktop +application/x-matroska=org.gnome.Showtime.desktop +audio/mpeg=org.gnome.Decibels.desktop +application/zip=org.gnome.FileRoller.desktop +application/x-tar=org.gnome.FileRoller.desktop +application/x-7z-compressed=org.gnome.FileRoller.desktop +application/x-rar-compressed=org.gnome.FileRoller.desktop +application/x-bzip2=org.gnome.FileRoller.desktop +application/x-gzip=org.gnome.FileRoller.desktop +application/x-xz=org.gnome.FileRoller.desktop +application/x-iso9660-image=org.gnome.FileRoller.desktop +application/vnd.rar=org.gnome.FileRoller.desktop +audio/flac=org.gnome.Decibels.desktop +audio/ogg=org.gnome.Decibels.desktop +audio/wav=org.gnome.Decibels.desktop +audio/x-wav=org.gnome.Decibels.desktop +audio/aac=org.gnome.Decibels.desktop +audio/x-m4a=org.gnome.Decibels.desktop +audio/webm=org.gnome.Decibels.desktop +audio/x-vorbis+ogg=org.gnome.Decibels.desktop +audio/x-opus+ogg=org.gnome.Decibels.desktop +image/jpeg=org.gnome.Loupe.desktop +image/png=org.gnome.Loupe.desktop +image/gif=org.gnome.Loupe.desktop +image/webp=org.gnome.Loupe.desktop +image/tiff=org.gnome.Loupe.desktop +image/x-canon-crw=org.gnome.Loupe.desktop +image/x-canon-cr2=org.gnome.Loupe.desktop +image/x-nikon-nef=org.gnome.Loupe.desktop +image/x-sony-arw=org.gnome.Loupe.desktop +image/svg+xml=org.gnome.Loupe.desktop +image/bmp=org.gnome.Loupe.desktop +image/x-icns=org.gnome.Loupe.desktop +application/pdf=org.gnome.Papers.desktop +text/plain=com.system76.CosmicEdit.desktop +text/x-python=com.system76.CosmicEdit.desktop +text/x-c=com.system76.CosmicEdit.desktop +text/x-c++=com.system76.CosmicEdit.desktop +text/x-java=com.system76.CosmicEdit.desktop +text/x-javascript=com.system76.CosmicEdit.desktop +text/x-shellscript=com.system76.CosmicEdit.desktop +text/x-yaml=com.system76.CosmicEdit.desktop +text/x-json=com.system76.CosmicEdit.desktop +text/html=com.system76.CosmicEdit.desktop +text/css=com.system76.CosmicEdit.desktop +text/x-rust=com.system76.CosmicEdit.desktop +application/x-shellscript=com.system76.CosmicEdit.desktop +application/x-python=com.system76.CosmicEdit.desktop [Added Associations] video/mp4=org.gnome.Showtime.desktop; +video/x-msvideo=org.gnome.Showtime.desktop; +video/x-matroska=org.gnome.Showtime.desktop; +video/quicktime=org.gnome.Showtime.desktop; +video/x-flv=org.gnome.Showtime.desktop; +video/x-ms-wmv=org.gnome.Showtime.desktop; +video/x-m4v=org.gnome.Showtime.desktop; +video/webm=org.gnome.Showtime.desktop; +video/ogg=org.gnome.Showtime.desktop; +video/mpeg=org.gnome.Showtime.desktop; +application/x-matroska=org.gnome.Showtime.desktop; +application/zip=org.gnome.FileRoller.desktop; +application/x-tar=org.gnome.FileRoller.desktop; +application/x-7z-compressed=org.gnome.FileRoller.desktop; +application/x-rar-compressed=org.gnome.FileRoller.desktop; +application/x-bzip2=org.gnome.FileRoller.desktop; +application/x-gzip=org.gnome.FileRoller.desktop; +application/x-xz=org.gnome.FileRoller.desktop; +application/x-iso9660-image=org.gnome.FileRoller.desktop; +application/vnd.rar=org.gnome.FileRoller.desktop; +audio/mpeg=org.gnome.Decibels.desktop; +audio/flac=org.gnome.Decibels.desktop; +audio/ogg=org.gnome.Decibels.desktop; +audio/wav=org.gnome.Decibels.desktop; +audio/x-wav=org.gnome.Decibels.desktop; +audio/aac=org.gnome.Decibels.desktop; +audio/x-m4a=org.gnome.Decibels.desktop; +audio/webm=org.gnome.Decibels.desktop; +audio/x-vorbis+ogg=org.gnome.Decibels.desktop; +audio/x-opus+ogg=org.gnome.Decibels.desktop; +image/jpeg=org.gnome.Loupe.desktop; +image/png=org.gnome.Loupe.desktop; +image/gif=org.gnome.Loupe.desktop; +image/webp=org.gnome.Loupe.desktop; +image/tiff=org.gnome.Loupe.desktop; +image/x-canon-crw=org.gnome.Loupe.desktop; +image/x-canon-cr2=org.gnome.Loupe.desktop; +image/x-nikon-nef=org.gnome.Loupe.desktop; +image/x-sony-arw=org.gnome.Loupe.desktop; +image/svg+xml=org.gnome.Loupe.desktop; +image/bmp=org.gnome.Loupe.desktop; +image/x-icns=org.gnome.Loupe.desktop; +application/pdf=org.gnome.Papers.desktop; +text/plain=com.system76.CosmicEdit.desktop; +text/x-python=com.system76.CosmicEdit.desktop; +text/x-c=com.system76.CosmicEdit.desktop; +text/x-c++=com.system76.CosmicEdit.desktop; +text/x-java=com.system76.CosmicEdit.desktop; +text/x-javascript=com.system76.CosmicEdit.desktop; +text/x-shellscript=com.system76.CosmicEdit.desktop; +text/x-yaml=com.system76.CosmicEdit.desktop; +text/json=com.system76.CosmicEdit.desktop; +text/html=com.system76.CosmicEdit.desktop; +text/css=com.system76.CosmicEdit.desktop; +text/x-rust=com.system76.CosmicEdit.desktop; +application/x-shellscript=com.system76.CosmicEdit.desktop; +application/x-python=com.system76.CosmicEdit.desktop; diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf new file mode 100644 index 0000000..b4ccd24 --- /dev/null +++ b/.config/mpv/mpv.conf @@ -0,0 +1,3 @@ +asc=no +ao=alsa +audio-device=alsa/pipewire diff --git a/.config/scripts/shared/song_detail.sh b/.config/scripts/shared/song_detail.sh index e5b0a0f..4583621 100755 --- a/.config/scripts/shared/song_detail.sh +++ b/.config/scripts/shared/song_detail.sh @@ -23,20 +23,16 @@ if command -v playerctl &> /dev/null; then if [[ "$player_status" == "Playing" ]] || [[ "$player_status" == "Paused" ]]; then # Get the last activity time for this player activity_cache="/tmp/playerctl_activity_${player}" + current_time=$(date +%s) - if [[ "$player_status" == "Playing" ]]; then - # Update timestamp for playing player - current_time=$(date +%s) - echo "$current_time" > "$activity_cache" + # Always update timestamp for any Playing or Paused player + # This ensures we track when a player was last active (Playing or just paused) + echo "$current_time" > "$activity_cache" + + # Compare timestamps to find most recent + if [[ $current_time -gt $most_recent_time ]]; then most_recent_time=$current_time most_recent_player="$player" - elif [[ -f "$activity_cache" ]]; then - # Check if paused player has a recent activity timestamp - activity_time=$(cat "$activity_cache") - if [[ $activity_time -gt $most_recent_time ]]; then - most_recent_time=$activity_time - most_recent_player="$player" - fi fi fi done <<< "$player_list" @@ -100,18 +96,22 @@ if command -v playerctl &> /dev/null; then fi fi + # Escape special characters for waybar markup compatibility + artist_escaped="${artist//&/&}" + title_escaped="${title//&/&}" + if [[ -n "$artist" && -n "$title" && -n "$duration" && -n "$position" ]]; then - echo "$icon $artist - $title ($position / $duration)" + echo "$icon $artist_escaped - $title_escaped ($position / $duration)" elif [[ -n "$artist" && -n "$title" && -n "$duration" ]]; then - echo "$icon $artist - $title ($duration)" + echo "$icon $artist_escaped - $title_escaped ($duration)" elif [[ -n "$title" && -n "$duration" && -n "$position" ]]; then - echo "$icon $title ($position / $duration)" + echo "$icon $title_escaped ($position / $duration)" elif [[ -n "$title" && -n "$duration" ]]; then - echo "$icon $title ($duration)" + echo "$icon $title_escaped ($duration)" elif [[ -n "$artist" && -n "$title" ]]; then - echo "$icon $artist - $title" + echo "$icon $artist_escaped - $title_escaped" elif [[ -n "$title" ]]; then - echo "$icon $title" + echo "$icon $title_escaped" else echo "$icon Something's Playing" fi