Jump to content

Search the Community

Showing results for tags 'bash'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Alfred 3
  • Make the Most of Alfred
    • Discussion & Help
    • Bug Reports
    • Alfred Feature Suggestions
    • Themes
  • Alfred Workflows
    • Share your Workflows
    • Workflow Help & Questions
  • Alfred v2 Themes
  • Alfred Remote for iOS
    • Alfred Remote Discussion & Help
    • Remote Connection Troubleshooting

Categories

  • Articles
    • Forum Integration
    • Frontpage
  • Pages
  • Miscellaneous
    • Databases
    • Templates
    • Media

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Twitter


Website URL


Jabber


Location


Interests

  1. I would like to create a Workflow that takes a file selection from Finder (matching com.apple.xcode.compiled-asset-catalog files) and runs each file through the `acextract` executable. I'm completely unfamiliar with bash scripting syntax, so I understand conceptually what needs to happen, but can't figure out how to get Alfred to do what I want. The command I want to execute is: acextract -i $file -o ./$dir ...where $dir would be the .car filename converted to a new directory, but without an extension, i.e. from ./assets.car to ./assets/
  2. Hi everybody! OK, I am desperate - I've spent the last two days trying to cobble together a tagging workflow and I am totally stuck... I would be extremely thankful if some of you Alfred-specialists around here could take a look at my issue. I kind of know my way around Applescript but everything else is a total mystery to me. So here it is: The Workflow uses "tag" (https://github.com/jdberry/tag/ - installed via homebrew, if that matters) to assign my custom tags to files selected in Finder. The workflow should work with a hotkey - be it via a "selecti
  3. I tried running this script in a workflow #!/usr/local/bin/bash string="a FeW WOrdS" string=${string,,} echo "$string" But then in the Alfred workflow debugger, I get /Users/me/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/A4DF2A96-E3FC-4D43-BAEC-BD9CDFAA265E: line 10: ${string,,}: bad substitution This script works in my normal terminal, so why doesn't it work in an Alfred script?
  4. Does anyone have an Applescript to run commands in the Alacritty terminal emulator instead of the default one? I've been trying to adapt iterm2 ones but I'm not well versed in Applescript and cannot get it to work.
  5. I feel like I must be too stupid to use Alfred and maybe I shouldn't even try to do this anymore. I just want to take the output of a bash command and post to OSX Notification; I honestly can't believe how so dramatically different (difficult/frustration/inane) trying to do this simple thing is compared with the amazing ease of use and simple to understand the rest of Alfred typically is. I will post my workflow as it is currently, but it should be noted this is perhaps the 37th attempt to figure it out: Workflow view attached, where contents of 'Terminal Co
  6. Hey All, Looking for a solution on a very minor annoyance, I usually run a lot of shell commands from Alfred using the > prefix, which is great! Love it! However, when it executes the command it pops open terminal and runs the command and leaves another lingering window around which I find annoying. Does anyone know of a way to force Alfred to close the window it opens after the command is executed? Very rarely do I need the returned command's output. It's usually for firing off quick things like docker pulls, file moves, git commits and such. If I n
  7. I'm trying create a workflow to utilize the MacOS Say command. With this command, I'd like to queue up several paragraphs for it to speak and highlight the spoken paragraph. I'm close, but I'm running into issue with the clipboard management. It was my understanding that the /bin/bash scripts can queue commands up in sequence. In which case the below code should execute like this; 1. Copy the query (which in my workflow is the selected text). 2. Open find in Safari 3. Paste the clipboard contents. 4. Say the selected text. It looks like the LAST copied t
  8. Hi there, I'm a newbie to Alfred and completey overwhelmed by the possibilities of its workflows. As such, I have a newbie question but google and the search engine of this forum could not help me. In a workflow I'm using the (Action => Run Script) element to call a bash script that resides in my home folder. This bash script returns 0 in case everything is fine and a different number else. I'm now interested to evaluate this result but don't quite manage to get this done. Do I have to pass the result of the script into some variable of Alfred after calling the script?
  9. Is it possible to easily run custom bash scripts with Alfred, but run them from my local machine, instead of typing them into Alfred? For example, if I have the following script: ➜ xdoc git:(master) ✗ pwd /Users/max/Dropbox/work/src/github.com/mbigras/xdoc ➜ xdoc git:(master) ✗ ls README.md xcats xdoc xdoc.mm ➜ xdoc git:(master) ✗ readlink xcats /Users/max/Dropbox/work/src/github.com/mbigras/xdoc/xcats ➜ xdoc git:(master) ✗ cat xcats #!/usr/bin/env bash echo inside xcats with args: $@ with the following workflow, I get the following error, please see attached images
  10. Hi, I want to set a custom bash (source "${HOME}/.zshrc") when running all the scripts in my workflow. There's any elegant way of doing this or I have to set it on the first line of each script?
  11. I have a workflow that is listening for spotify ads (so i can mute them). I have a while loop listening. When it finds an ad (a track with < 35 second duration), it sends a notification - but not an alfred style post notification; just the default applescript-like notification. Here's the code: Note: osascript -e "display notification \"Muting ad for $sleepDuration seconds\" with title \"Mute Spotify Ads\"" This is what I'd like to replace with an alfred Post Notification. vol=`osascript -e 'tell application "Spotify" to sound volume as integer'`; while : do state=
  12. Hi! I have been a user of Alfred (+ Powerpack) for years, but only recently decided to invest more time into customizing it with the workflows I thought were helpful. As I am a software developer, I generally setup any new Mac OSX environment using a completely automated installer: https://github.com/kigster/pullulant I wanted to add to Pullulant a simple bash script for installing Alfred. I can install the software itself using Homebrew, and then I was hoping to download and install my favorite workflows. I have now spent over an hour searching online, and I am absolutely stunned
  13. Trying to pass multiple paths from file action as args to a command in a bash script. Is there a way to do this?
  14. Can anyone suggest a way or sketch a workflow to be able to run shell scripts from alfred directly? Example: Say I have a example.sh in /home/folder/ I'd like to be able to run this from Alfred; i.e. the following sequence of events happen: 1. I type example. 2. example.sh shows up in the list of results. 3. I [hotkey] to the options menu of example. 4. I [hotkey] something (a workflow?) to execute the script (in /home/folder).
  15. G'day folks! I've recently dug into writing a workflow for Alfred which purpose is to control Hyperion (a service which supplies LED stripes with data). However, when I'm trying to ssh into the remote machine to fetch a list of all available colors (148 ones), it apparently takes too long. Now, I've read on the forum that Alfred has no such thing as timeout. But in that case, I would love if someone could explain why I can fetch the list of effects, where there are only 14 lines and not the list of colors (148). Is there anything I can do? Oh, and yeah: I've seen the setting "termi
  16. My goal is to automate the process of updating a user's hosts file. (/etc/hosts/) I have a bash script that works fine if I run it from my home directory. User opens Alfred and types in the keyword "hostsup" (No arguments required) Alfred opens a Terminal window and runs a script that has been added to the Workflow folder The script displays some informative text for the user Then the scripts ask the user if they would like to continue On 'y', the terminal prompts the user for their password (Because the command uses sudo) The script outputs a completion message and instructs the user to
  17. Hi everyone! For long, I've been launching VirtualBox's virtual machines with the following script, bin/bash being the language selected: VBoxManage startvm "vm_name" In a recent update, it seems that VirtualBox moved the necessary "files" (I don't really know/understand what happens in the background) from /usr/bin to /usr/local/bin. See this topic: https://forums.virtualbox.org/viewtopic.php?f=8&t=68825. People there pointed that it might be related to recent security restrictions in OS X (Yosemite, El Capitan). From the Terminal, when I first point to /usr/local/bin, the prev
  18. I was sitting there in iTerm thinking "wouldn't it be great if I could talk to Alfred directly from the terminal"? bash completion, etc. I'm not sure how to get this done; I was hoping for some guidance by the authors. Alfred's AppleScript library only exposes a few functions. If I wanted to use completion, I'd need a list of all of its keywords. However, if that list existed, I'm sure I could work something out. It'd be pretty awesome. Chris
  19. Hi, my first post is a little bit long, but I spent some days in Google before posting here, so I hope to get help. I am trying to create workflow using AppleScript that creates Mail message for me with some links in the footer of the mail body. The problem is that I can't insert links this way, because it places this html as Plain text instead of Rich text: set FooterText to "<a href=\"http://example.com\">Example link</a>" I was trying to find a way to convert html text to Rich text, and found that it can be done with "textutil" from a Terminal app. Running this command f
  20. I'm trying to modify the AppendText2File workflow so that if the text to be appended has a single quote inside it the workflow doesn't break. Here's the relevant portion of the workflow: dt=`date` ## append to the original file echo "* "$dt" -- "{query} >> $original What do I do to strip out single quotes (or replace them with something bash/Alfred doesn't hate)?
  21. I would like to write an Alfred workflow that acts as a thin wrapper around a command line application which takes many option flags and arguments. Is there any way to integrate Alfred with the bash completion script of this application in such a way that the possible completions of a partially entered command are displayed?
  22. Currently there are some issues with Run Script when using /usr/bin/php, /usr/bin/perl, /usr/bin/python, etc... Those processes are launched from the shell using certain environment variables (such as LANG=C or another non-unicode supporting environment) which disable features or environments we may need to run our scripts correctly. Currently the only solution to this would be to use /bin/bash or /bin/zsh and set things ourselves and then launch our script from there. Doing so means we sacrifice the convenience of having scripts right in the workflow visual themselves AND we can no l
  23. Hi All, I want to fire off MacVim with a keyword action and a shortcut for where to open MacVim, e.g.: mvim d -> open MacVim in the folder ~/Downloads mvim h -> open MacVim in the folder ~/ ... I wrote a case statement in bash like this: MVIM=/usr/local/bin/mvim case "{query}" in "h") cd ~/ && $MVIM ;; "d") cd ~/Downloads && $MVIM ;; *) echo "unknown directory specified" ;; esac And when I run (e.g., mvim d) it once works flawlessly. However, if I want to open a second window of MacVim by running e.g. 'mvim h' nothing happens until I close
  24. Hey everyone, here's one I can absolutely not figure out for myself: if have this very simple bash script called launcher.sh #!/bin/bash node="/usr/local/bin/node" ${node} test.js 127.0.0.1:8374 &> node-out.txt & and a quite simple node script called test.js require('easyimage').thumbnail({ src:"a.jpg", dst:"b.jpg", width:60, height:60 }).then( function(image) { console.log('success'); }, function (err) { console.log(err); }); If i call from the terminal node test.js or ./launcher.sh, then everything is fine (I get image a.jpg to be cropped and written to b.jpg)
  25. Hi all, I'm sure there's an easy answer to this, but could someone explain to me why a simple Keyword to Script workflow, consisting of a keyword foo and the following one-line bash script (where mate is the TextMate shell utility and bar is the absolute path to a text file) sudo mate bar does absolutely nothing, even though it works fine when I run it in Terminal,. This workflow used to work, but it hasn't for the past couple of months (I think, because I don't use it very often). It's not a huge deal, but I'd like to understand what's broken it. It's not because it's run with sudo,
×
×
  • Create New...