Skip to content

File search results in rofi #1894

Answered by CapelaGames
CapelaGames asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not sure if there is an easier way to do this but this is how I got it working.
(replace username with your username, I couldn't seem to get ~ working)
Use this to run the following script ./finder.py

#!/usr/bin/env python3

import subprocess
import shlex

if __name__ == '__main__':

    # arg1 = sys.argv[1]
    # Use fd to get a list of files and directories, and split them into a list
    files = subprocess.run(shlex.split("fd . /home/username"), encoding='utf-8', capture_output=True).stdout.splitlines()

    # Set the title for the Rofi window
    title = 'Find Files'

    # Construct the rofi command using dmenu 
    rofi_command = ['rofi', '-dmenu', '-i', '-p', title]

    # Join…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@DaveDavenport
Comment options

@CapelaGames
Comment options

@DaveDavenport
Comment options

@CapelaGames
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by CapelaGames
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants