about summary refs log tree commit diff stats
path: root/shell/trace.mu
Commit message (Expand)AuthorAgeFilesLines
* .Kartik K. Agaram2021-06-041-1/+1
* .Kartik K. Agaram2021-06-041-0/+2
* .Kartik K. Agaram2021-06-041-3/+3
* .Kartik K. Agaram2021-06-041-3/+3
* .Kartik K. Agaram2021-06-031-4/+3
* shell: more stable trace when rerunningKartik K. Agaram2021-06-021-2/+138
* .Kartik K. Agaram2021-06-021-2/+2
* bugfix for disappearing traceKartik K. Agaram2021-05-311-0/+2
* bugfix: unbound variables were not raising errorKartik K. Agaram2021-05-301-0/+14
* first test re-running sandbox with a deeper traceKartik K. Agaram2021-05-301-0/+1
* first attempt doesn't workKartik K. Agaram2021-05-301-0/+29
* .Kartik K. Agaram2021-05-291-4/+45
* .Kartik K. Agaram2021-05-291-82/+54
* shell: scrolling the traceKartik K. Agaram2021-05-291-3/+209
* shell: skeleton for scrollingKartik K. Agaram2021-05-291-2/+28
* cache visibility for all lines in traceKartik K. Agaram2021-05-291-15/+35
* .Kartik K. Agaram2021-05-291-4/+5
* .Kartik K. Agaram2021-05-291-1/+1
* .Kartik K. Agaram2021-05-291-1/+1
* .Kartik K. Agaram2021-05-291-1/+1
* shell: start implementing scrolling in the traceKartik K. Agaram+14
* shell: use ctrl-m rather than tab to bounce to traceKartik K. Agaram2021-04-251-1/+1
* better error message on trace overflowKartik K. Agaram2021-04-221-1/+8
* start cleaning up pixel graphicsKartik K. Agaram2021-04-191-24/+24
* shell: ctrl-r runs on real screen without a traceKartik K. Agaram2021-04-171-1/+3
* shell: reenable the traceKartik K. Agaram2021-04-171-0/+12
* shell: start jumping to keyboard using TabKartik K. Agaram2021-04-101-2/+2
* support for arrow keysKartik K. Agaram2021-04-051-0/+14
* get rid of ctrl-d/ctrl-u when browsing traceKartik K. Agaram2021-03-081-42/+26
* Add j/k keybindings for navigating traceMax Bernstein2021-03-081-0/+16
* 7866Kartik Agaram2021-03-071-6/+6
* 7864 - shell: clean up the trace some moreKartik K. Agaram2021-03-071-0/+5
* 7857 - shell: first function callKartik K. Agaram2021-03-051-0/+30
* 7853Kartik K. Agaram2021-03-051-1/+88
ss="k">if f.extension in ('html', 'htm', 'xhtml'): return self.either(c, 'firefox', 'opera', 'elinks') if f.extension in ('swf', ): return self.either(c, 'firefox', 'opera') if f.extension == 'nes': return self.either(c, 'fceux') if f.extension in ('swc', 'smc'): return self.either(c, 'zsnes') if f.mimetype is not None: if INTERPRETED_LANGUAGES.match(f.mimetype): return self.either(c, 'edit_or_run') if f.container: return self.either(c, 'aunpack', 'file_roller') if f.video or f.audio: if f.video: c.flags += 'd' return self.either(c, 'mplayer', 'totem') if f.image: return self.either(c, 'feh', 'eog', 'mirage') if f.document or f.filetype.startswith('text'): return self.either(c, 'editor') # ----------------------------------------- application definitions # Note: Trivial applications are defined at the bottom def app_pager(self, c): return tup('less', *c) def app_editor(self, c): try: default_editor = os.environ['EDITOR'] except KeyError: pass else: parts = default_editor.split() exe_name = os.path.basename(parts[0]) if exe_name in get_executables(): return tuple(parts) + tuple(c) return self.either(c, 'vim', 'emacs', 'nano') @depends_on(app_editor, Applications.app_self) def app_edit_or_run(self, c): if c.mode is 1: return self.app_self(c) return self.app_editor(c) @depends_on('mplayer') def app_mplayer(self, c): if c.mode is 1: return tup('mplayer', '-fs', *c) elif c.mode is 2: args = "mplayer -fs -sid 0 -vfm ffmpeg -lavdopts " \ "lowres=1:fast:skiploopfilter=all:threads=8".split() args.extend(c) return tup(*args) elif c.mode is 3: return tup('mplayer', '-mixer', 'software', *c) else: return tup('mplayer', *c) @depends_on('feh') def app_feh(self, c): arg = {1: '--bg-scale', 2: '--bg-tile', 3: '--bg-center'} c.flags += 'd' if c.mode in arg: return tup('feh', arg[c.mode], c.file.path) if c.mode is 11: if len(c.files) > 1: return tup('feh', *c) else: from collections import deque # Open all image files in feh directory = self.fm.env.get_directory(c.file.dirname) images = [f.path for f in directory.files if f.image] position = images.index(c.file.path) deq = deque(images) deq.rotate(-position) return tup('feh', *deq) return tup('feh', *c) @depends_on('aunpack') def app_aunpack(self, c): if c.mode is 0: c.flags += 'p' return tup('aunpack', '-l', c.file.path) return tup('aunpack', c.file.path) @depends_on('file-roller') def app_file_roller(self, c): c.flags += 'd' return tup('file-roller', c.file.path) @depends_on('make') def app_make(self, c): if c.mode is 0: return tup("make") if c.mode is 1: return tup("make", "install") if c.mode is 2: return tup("make", "clear") @depends_on('java') def app_java(self, c): def strip_extensions(file): if '.' in file.basename: return file.path[:file.path.index('.')] return file.path files_without_extensions = map(strip_extensions, c.files) return tup("java", files_without_extensions) @depends_on('totem') def app_totem(self, c): if c.mode is 0: return tup("totem", *c) if c.mode is 1: return tup("totem", "--fullscreen", *c) # Often a programs invocation is trivial. For example: # vim test.py readme.txt [...] # This could be implemented like: # @depends_on("vim") # def app_vim(self, c): # return tup("vim", *c.files) # Instead of creating such a generic function for each program, just add # its name here and it will be automatically done for you. CustomApplications.generic('vim', 'fceux', 'elinks', 'wine', 'zsnes', 'javac') # By setting flags='d', this programs will not block ranger's terminal: CustomApplications.generic('opera', 'firefox', 'apvlv', 'evince', 'zathura', 'gimp', 'mirage', 'eog', flags='d') # What filetypes are recognized as scripts for interpreted languages? # This regular expression is used in app_default() INTERPRETED_LANGUAGES = re.compile(r''' ^(text|application)/x-( haskell|perl|python|ruby|sh )$''', re.VERBOSE)