Skip to content

Commit c86f16a

Browse files
authored
fixed version (#718)
* refactor: remove redundant code * refactor: remove odd line * format: light format changes * fix: fixed possibly unbound variable usage
1 parent 2b295eb commit c86f16a

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

Configs/.local/lib/hyde/fastfetch.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,7 @@ logo) # eats around 13 ms
4747
image_dirs+=("$HYDE_CACHE_HOME/wall.quad")
4848
image_dirs+=("$HYDE_CACHE_HOME/wall.sqre")
4949
[ -f "$HOME/.face.icon" ] && image_dirs+=("$HOME/.face.icon")
50-
[ -f "$hyde_distro_logo" ] && image_dirs+=("$hyde_distro_logo")
51-
image_dirs+=("${confDir}/fastfetch/logo")
52-
image_dirs+=("${iconDir}/Wallbash-Icon/fastfetch/")
53-
if [ -n "${HYDE_THEME}" ] && [ -d "${confDir}/hyde/themes/${HYDE_THEME}/logo" ]; then
54-
image_dirs+=("${confDir}/hyde/themes/${HYDE_THEME}/logo")
55-
fi
50+
# also .bash_logout may be matched with this find
5651
find -L "${image_dirs[@]}" -maxdepth 1 -type f \( -name "wall.quad" -o -name "wall.sqre" -o -name "*.icon" -o -name "*logo*" -o -name "*.png" \) ! -path "*/wall.set*" ! -path "*/wallpapers/*.png" 2>/dev/null
5752
) | shuf -n 1
5853
}

Configs/.local/lib/hyde/keybinds.hint.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
import time
88

99

10-
# filepath: /home/khing/.local/lib/hyde/keybinds.hint.py
11-
12-
1310
def get_hyprctl_binds():
1411
while True:
1512
try:
@@ -350,7 +347,11 @@ def expand_meta_data(binds_data):
350347
submap_key_display = submap_keys[submap]["key_display"]
351348
bind["submap_mod"] = submap_mod_display
352349
bind["submap_key"] = submap_key_display
353-
bind["displayed_keys"] = ( f"{submap_mod_display} + {submap_key_display} + " if submap_mod_display else "") + f"{formatted_keys}"
350+
bind["displayed_keys"] = (
351+
f"{submap_mod_display} + {submap_key_display} + "
352+
if submap_mod_display
353+
else ""
354+
) + f"{formatted_keys}"
354355
bind["description"] = f"[{submap}] {bind['description']}"
355356
else:
356357
bind["submap_mod"] = ""

Configs/.local/lib/hyde/mediaplayer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def create_tooltip_text(
7171

7272
return tooltip
7373

74+
7475
def format_artist_track(artist, track, playing, max_length):
7576
# Use the appropriate prefix based on playback status
7677
prefix = prefix_playing if playing else prefix_paused
@@ -94,7 +95,9 @@ def format_artist_track(artist, track, playing, max_length):
9495
if len(track) != len(track[:track_limit]):
9596
track = track[:track_limit].rstrip() + "…"
9697

97-
output_text = f"{prefix}{prefix_separator}<i>{artist}</i>{artist_track_separator}<b>{track}</b>"
98+
output_text = (
99+
f"{prefix}{prefix_separator}<i>{artist}</i>{separator}<b>{track}</b>"
100+
)
98101
else:
99102
output_text = "<b>Nothing playing</b>"
100103
return output_text

Configs/.local/lib/hyde/parse.config.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ def load_toml_file(toml_file):
3737

3838

3939
def parse_toml_to_env(toml_file, env_file=None, export=False):
40-
ignored_keys = ["$schema", "$SCHEMA", "hyprland","hyprland-ipc","hyprland-start", "hyprland-env"]
40+
ignored_keys = [
41+
"$schema",
42+
"$SCHEMA",
43+
"hyprland",
44+
"hyprland-ipc",
45+
"hyprland-start",
46+
"hyprland-env",
47+
]
4148

4249
toml_content = load_toml_file(toml_file)
4350
if toml_content is None:

Configs/.local/lib/hyde/weather.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def format_chances(hour):
208208
"yes",
209209
) # True or False (default: True)
210210
try:
211-
forecast_days = int(
211+
FORECAST_DAYS = int(
212212
os.getenv("WEATHER_FORECAST_DAYS", "3")
213213
) # Number of days to show the forecast for (default: 3)
214214
except ValueError:
@@ -225,7 +225,7 @@ def format_chances(hour):
225225
TIME_FORMAT = "12h"
226226
if windspeed_unit not in ("km/h", "mph"):
227227
WINDSPEED_UINT = "km/h"
228-
if forecast_days not in range(4):
228+
if FORECAST_DAYS not in range(4):
229229
FORECAST_DAYS = 3
230230

231231
### Main Logic ###
@@ -262,7 +262,7 @@ def format_chances(hour):
262262
data["tooltip"] += f"Wind: {get_wind_speed(current_weather)}\n"
263263
data["tooltip"] += f"Humidity: {current_weather['humidity']}%\n"
264264
# Get the weather forecast for the next 2 days
265-
for i in range(forecast_days):
265+
for i in range(FORECAST_DAYS):
266266
day_instance = weather["weather"][i]
267267
data["tooltip"] += "\n<b>"
268268
if i == 0:

0 commit comments

Comments
 (0)