Skip to content

Commit

Permalink
#603 Do not use hard-coded "/usr/local/bin/" path
Browse files Browse the repository at this point in the history
  • Loading branch information
vdesabou committed May 5, 2023
1 parent ba32257 commit d57bcd7
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/_posts/articles/2014-12-23-modifier-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Alfred modifiers are specific actions you can trigger when pressing special keys

* Select a track with `⌘+⌥` (cmd+alt key) to add track to queue ([Spotify Connect](https://alfred-spotify-mini-player.com/articles/spotify-connect/) users only)

* Select a track or an episode with `fn+⇧` (function key + shift) to preview the track or the episode for 30 seconds (require mpg123 to be installed with [brew](https://brew.sh))
* Select a track or an episode with `fn+⇧` (function key + shift) to preview the track or the episode for 30 seconds

* Select a track with `` (shift key) to add the album to either _Your Music_, or any of your playlists (you can even create a new one)

Expand Down
2 changes: 1 addition & 1 deletion spotify-mini-player/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4666,7 +4666,7 @@ main($query,"PREVIEW","");
<key>escaping</key>
<integer>102</integer>
<key>script</key>
<string>PATH=$PATH:/opt/homebrew/bin/:/usr/local/bin/
<string>
php -S 127.0.0.1:15298</string>
<key>scriptargtype</key>
Expand Down
1 change: 0 additions & 1 deletion spotify-mini-player/src/download_artworks.ksh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/ksh

SILENT="$1"
PATH=$PATH:/opt/homebrew/bin/:/usr/local/bin/

if [ "$SILENT" = "false" ]
then
Expand Down
2 changes: 1 addition & 1 deletion spotify-mini-player/src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ function getFuzzySearchResults($w, $update_in_progress, $query, $table_name, $ta

$delimiter = '{::}';

exec("/usr/bin/sqlite3 -separator $delimiter '$dbfile' 'select ".implode(",",$table_columns)." from ".$table_name." ".$where_clause.";' | /usr/local/bin/fzf --filter \"$query\" --delimiter=\"$delimiter\" --nth=\"$nth\"" , $retArr, $retVal);
exec("/usr/bin/sqlite3 -separator $delimiter '$dbfile' 'select ".implode(",",$table_columns)." from ".$table_name." ".$where_clause.";' | fzf --filter \"$query\" --delimiter=\"$delimiter\" --nth=\"$nth\"" , $retArr, $retVal);

$i = 0;
$results = array();
Expand Down
6 changes: 3 additions & 3 deletions spotify-mini-player/src/secondDelimiter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2668,7 +2668,7 @@ function secondDelimiterPreview($w, $query, $db, $update_in_progress) {
$is_display_rating = getSetting($w,'is_display_rating');
$output_application = getSetting($w,'output_application');

if (!file_exists('/usr/local/bin/mpg123')) {
if (!file_exists('mpg123')) {
$w->result(null, '', 'mpg123 is not installed, install using brew install mpg123', array('install using brew install mpg123', 'alt' => '', 'cmd' => '', 'shift' => '', 'fn' => '', 'ctrl' => '',), './images/warning.png', 'no', null, '');
echo $w->tojson();
exit;
Expand Down Expand Up @@ -2749,7 +2749,7 @@ function secondDelimiterPreview($w, $query, $db, $update_in_progress) {
return;
}
}
exec('curl -s ' . $track->preview_url . ' | /usr/local/bin/mpg123 - > /dev/null 2>&1 &');
exec('curl -s ' . $track->preview_url . ' | mpg123 - > /dev/null 2>&1 &');
}
else {
$w->result(null, '', 'The track . ' . $track->name . ' does not have a preview', array('uri=' . $track_uri, 'alt' => '', 'cmd' => '', 'shift' => '', 'fn' => '', 'ctrl' => '',), './images/warning.png', 'no', null, '');
Expand Down Expand Up @@ -2827,7 +2827,7 @@ function secondDelimiterPreview($w, $query, $db, $update_in_progress) {
}
}

exec('curl -s ' . $episode->audio_preview_url . ' | /usr/local/bin/mpg123 - > /dev/null 2>&1 &');
exec('curl -s ' . $episode->audio_preview_url . ' | mpg123 - > /dev/null 2>&1 &');
}
else {
$w->result(null, '', 'The episode . ' . $episode->name . ' does not have a preview', array('uri=' . $episode->uri, 'alt' => '', 'cmd' => '', 'shift' => '', 'fn' => '', 'ctrl' => '',), './images/warning.png', 'no', null, '');
Expand Down
2 changes: 0 additions & 2 deletions spotify-mini-player/src/spotify_mini_player_notifications.ksh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ ACTION=""
APP=""
ALFRED_NAME=""

PATH=$PATH:/opt/homebrew/bin/:/usr/local/bin/

while getopts 'v:d:a:m:' arguments
do
case ${arguments} in
Expand Down

0 comments on commit d57bcd7

Please sign in to comment.