Compare commits
1 Commits
8c4dcd1f87
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d618a76e7 |
+5
-4
@@ -13,6 +13,9 @@
|
|||||||
# notifytype=soundpack # Enable sound notifications
|
# notifytype=soundpack # Enable sound notifications
|
||||||
# notifies=default,mention,dm,me,follow,boost,favourite
|
# notifies=default,mention,dm,me,follow,boost,favourite
|
||||||
|
|
||||||
|
my $soundDataDir = ($ENV{'XDG_DATA_HOME'} || "$ENV{'HOME'}/.local/share") .
|
||||||
|
"/ttyverse";
|
||||||
|
|
||||||
sub notifier_soundpack {
|
sub notifier_soundpack {
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
my $text = shift;
|
my $text = shift;
|
||||||
@@ -52,16 +55,14 @@ sub notifier_soundpack {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Use the same XDG data directory as TTYverse and the extension manager.
|
my $sound_file = "$soundDataDir/sounds/$sound_pack/" . lc($class) . ".ogg";
|
||||||
my $data_dir = $data;
|
|
||||||
my $sound_file = "$data_dir/sounds/$sound_pack/" . lc($class) . ".ogg";
|
|
||||||
|
|
||||||
if (!-f $sound_file) {
|
if (!-f $sound_file) {
|
||||||
# Only warn once per session per class
|
# Only warn once per session per class
|
||||||
my $warn_key = "warned_missing_sound_$class";
|
my $warn_key = "warned_missing_sound_$class";
|
||||||
if (!$store->{$warn_key}) {
|
if (!$store->{$warn_key}) {
|
||||||
print $stdout "-- Warning: Sound file '$class.ogg' not found in pack '$sound_pack'\n";
|
print $stdout "-- Warning: Sound file '$class.ogg' not found in pack '$sound_pack'\n";
|
||||||
print $stdout "-- Place sound files in $data_dir/sounds/$sound_pack/\n";
|
print $stdout "-- Place sound files in $soundDataDir/sounds/$sound_pack/\n";
|
||||||
$store->{$warn_key} = 1;
|
$store->{$warn_key} = 1;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user