about summary refs log tree commit diff stats
path: root/config.mk
Commit message (Expand)AuthorAgeFilesLines
* replaced BORDERPX with sel->border in togglemax(), in other places this is no...Anselm R. Garbe2007-05-301-1/+1
* applied Szabolcs proposal to simplify setlayout()Anselm R. Garbe2007-05-221-1/+1
* removed strip, added -s to LDFLAGSAnselm R. Garbe2007-05-151-1/+1
* added new Mod1-b functionality to dwm(1)Anselm R. Garbe2007-05-151-2/+2
* another fix, call lt->arrange() in togglebar onlyAnselm R. Garbe2007-05-151-2/+2
* next version is 4.1Anselm R. Garbe2007-05-071-1/+1
* next version will be 4.0, so don't expect it within the next daysAnselm R. Garbe2007-04-111-1/+1
* next version will be 3.9, but don't expect it this week 3.9Anselm R. Garbe2007-03-291-1/+1
* Escape -s in dwm.1Anselm R. Garbe2007-02-261-1/+1
* reverting to bg 555Anselm R. Garbe2007-02-211-1/+1
* creating 3.6.1 3.6.1Anselm R. Garbe2007-02-211-1/+1
* cleaned up and commented the config.*.hAnselm R. Garbe2007-02-211-1/+1
* removed debug compile flagsAnselm R. Garbe2007-02-191-2/+2
* introduced Layout structAnselm R. Garbe2007-02-191-2/+2
* added ban() which takes care than a banned window is not banned again... (thi...Anselm R. Garbe2007-02-141-1/+1
* next version is 3.5Anselm R. Garbe2007-02-081-1/+1
* removed debug flags 3.4Anselm R. Garbe2007-02-071-2/+2
* replaced getproto with a saner function, now old-school artifacts of WM times...Anselm R. Garbe2007-02-071-2/+2
* made some changes more concistentAnselm R. Garbe2007-02-051-1/+1
* got rid of LD (inspired by JGs patch to wmii)Anselm R. Garbe2007-02-051-1/+0
* renamed CAVEATS into BUGSAnselm R. Garbe2007-01-261-1/+1
* prepared yet another hotfix release 3.2.2Anselm R. Garbe2007-01-251-1/+1
* hotfix release 3.2.1 3.2.1Anselm R. Garbe2007-01-241-1/+1
* moved BORDERPX to config.*.hAnselm R. Garbe2007-01-171-1/+1
* changed incnmaster shortcuts in config.arg.hAnselm R. Garbe2007-01-121-1/+1
* implemented nmaster appearance in mode label (using %u)Anselm R. Garbe2007-01-081-1/+1
* prevent pop() if first sel == nexttiled(clients)Anselm R. Garbe2007-01-051-2/+2
* fixing some minor issuesAnselm R. Garbe2007-01-051-2/+2
* I prefer two master windows by defaultAnselm R. Garbe2007-01-051-2/+2
* experimental version which allows master clients being increased/decreasedAnselm R. Garbe2007-01-051-2/+2
* next version will contain updated copyright noticearg@mig292007-01-021-1/+1
* added Solaris hintsarg@mig292006-12-181-1/+6
* removed the hardcoded fixed fallback, it is useless in non-Latin1 environmentsarg@mig292006-12-081-1/+1
* enforcing using fontsets even if they are incomplete for some encodingsarg@mig292006-12-051-1/+1
* hotfix of a serious crashing bug 2.5.1arg@mig292006-12-041-1/+1
* next version will be 2.5arg@mig292006-11-301-1/+1
* next version will be 2.4arg@mig292006-11-251-1/+1
* applied Gottox patchesarg@mig292006-11-211-1/+1
* next release will be 2.2arg@mig292006-11-031-1/+1
* applied Gottox patch to simplify the resizing of col, instead of resizing the...arg@mig292006-10-311-1/+1
* now being at v2.0Anselm R. Garbe2006-10-141-1/+1
* changing MASTER value from percent into per millAnselm R. Garbe2006-10-051-1/+1
* first step to a more flexible dotile() algorithmAnselm R. Garbe2006-09-291-1/+1
* fixing the settags issue, preparing 1.7.1 1.7.1Anselm R. Garbe2006-09-271-1/+1
* improved intro comment in dwm.h, updated config.mkarg@mmvi2006-09-201-1/+1
* small fixAnselm R. Garbe2006-09-111-1/+1
* maybe this might workAnselm R. Garbe2006-09-061-1/+1
* prepared dwm-1.4 update 1.4Anselm R. Garbe2006-09-061-1/+1
* seems to preserve floating client z-layer order (even with reorder() calls)Anselm R. Garbe2006-09-061-1/+1
* after 1.3Anselm R. Garbe2006-09-041-1/+1
__init__(self, win) self.column = column self.settings.signal_bind('setopt.display_size_in_status_bar', self.request_redraw, weak=True) def request_redraw(self): self.need_redraw = True def notify(self, text, duration=0, bad=False): self.msg = Message(text, duration, bad) def clear_message(self): self.msg = None def draw(self): """Draw the statusbar""" if self.hint and isinstance(self.hint, str): if self.old_hint != self.hint: self.need_redraw = True if self.need_redraw: self._draw_hint() return if self.old_hint and not self.hint: self.old_hint = None self.need_redraw = True if self.msg: if self.msg.is_alive(): self._draw_message() return else: self.msg = None self.need_redraw = True if self.fm.thisfile: self.fm.thisfile.load_if_outdated() try: ctime = self.fm.thisfile.stat.st_ctime except: ctime = -1 else: ctime = -1 if not self.result: self.need_redraw = True if self.old_du and not self.fm.thisdir.disk_usage: self.old_du = self.fm.thisdir.disk_usage self.need_redraw = True if self.old_thisfile != self.fm.thisfile: self.old_thisfile = self.fm.thisfile self.need_redraw = True if self.old_ctime != ctime: self.old_ctime = ctime self.need_redraw = True if self.need_redraw: self.need_redraw = False self._calc_bar() self._print_result(self.result) def _calc_bar(self): bar = Bar('in_statusbar') self._get_left_part(bar) self._get_right_part(bar) bar.shrink_by_removing(self.wid) self.result = bar.combine() def _draw_message(self): self.win.erase() self.color('in_statusbar', 'message', self.msg.bad and 'bad' or 'good') self.addnstr(0, 0, self.msg.text, self.wid) def _draw_hint(self): self.win.erase() highlight = True space_left = self.wid starting_point = self.x for string in self.hint.split('*'): highlight = not highlight if highlight: self.color('in_statusbar', 'text', 'highlight') else: self.color('in_statusbar', 'text') try: self.addnstr(0, starting_point, string, space_left) except: break space_left -= len(string) starting_point += len(string) def _get_left_part(self, bar): left = bar.left if self.column is not None and self.column.target is not None\ and self.column.target.is_directory: target = self.column.target.pointed_obj else: directory = self.fm.thistab.at_level(0) if directory: target = directory.pointed_obj else: return try: stat = target.stat except: return if stat is None: return if self.fm.mode != 'normal': perms = '--%s--' % self.fm.mode.upper() else: perms = target.get_permission_string() how = getuid() == stat.st_uid and 'good' or 'bad' left.add(perms, 'permissions', how) left.add_space() left.add(str(stat.st_nlink), 'nlink') left.add_space() left.add(self._get_owner(target), 'owner') left.add_space() left.add(self._get_group(target), 'group') if target.is_link: how = target.exists and 'good' or 'bad' try: dest = readlink(target.path) except: dest = '?' left.add(' -> ' + dest, 'link', how) else: left.add_space() if self.settings.display_size_in_status_bar and target.infostring: left.add(target.infostring.replace(" ", "")) left.add_space() left.add(strftime(self.timeformat, localtime(stat.st_mtime)), 'mtime') directory = target if target.is_directory else \ target.fm.get_directory(os.path.dirname(target.path)) if directory.vcs and directory.vcs.track: if directory.vcs.rootvcs.branch: vcsinfo = '({0:s}: {1:s})'.format(directory.vcs.rootvcs.repotype, directory.vcs.rootvcs.branch) else: vcsinfo = '({0:s})'.format(directory.vcs.rootvcs.repotype) left.add_space() left.add(vcsinfo, 'vcsinfo') left.add_space() if directory.vcs.rootvcs.obj.vcsremotestatus: vcsstr, vcscol = self.vcsremotestatus_symb[directory.vcs.rootvcs.obj.vcsremotestatus] left.add(vcsstr.strip(), 'vcsremote', *vcscol) if target.vcsstatus: vcsstr, vcscol = self.vcsstatus_symb[target.vcsstatus] left.add(vcsstr.strip(), 'vcsfile', *vcscol) if directory.vcs.rootvcs.head: left.add_space() left.add(str(directory.vcs.rootvcs.head['date']), 'vcsdate') left.add_space() left.add(directory.vcs.rootvcs.head['summary'], 'vcscommit') def _get_owner(self, target): uid = target.stat.st_uid try: return self.owners[uid] except KeyError: try: self.owners[uid] = getpwuid(uid)[0] return self.owners[uid] except KeyError: return str(uid) def _get_group(self, target): gid = target.stat.st_gid try: return self.groups[gid] except KeyError: try: self.groups[gid] = getgrgid(gid)[0] return self.groups[gid] except KeyError: return str(gid) def _get_right_part(self, bar): right = bar.right if self.column is None: return target = self.column.target if target is None \ or not target.accessible \ or (target.is_directory and target.files is None): return pos = target.scroll_begin max_pos = len(target) - self.column.hei base = 'scroll' right.add(" ", "space") if self.fm.thisdir.flat: right.add("flat=", base, 'flat') right.add(str(self.fm.thisdir.flat), base, 'flat') right.add(", ", "space") if self.fm.thisdir.filter: right.add("f=`", base, 'filter') right.add(self.fm.thisdir.filter.pattern, base, 'filter') right.add("', ", "space") if target.marked_items: if len(target.marked_items) == len(target.files): right.add(human_readable(target.disk_usage, separator='')) else: sumsize = sum(f.size for f in target.marked_items if not f.is_directory or f._cumulative_size_calculated) right.add(human_readable(sumsize, separator='')) right.add("/" + str(len(target.marked_items))) else: right.add(human_readable(target.disk_usage, separator='') + " sum") try: free = get_free_space(target.mount_path) except OSError: pass else: right.add(", ", "space") right.add(human_readable(free, separator='') + " free") right.add(" ", "space") if target.marked_items: # Indicate that there are marked files. Useful if you scroll # away and don't see them anymore. right.add('Mrk', base, 'marked') elif len(target.files): right.add(str(target.pointer + 1) + '/' + str(len(target.files)) + ' ', base) if max_pos <= 0: right.add('All', base, 'all') elif pos == 0: right.add('Top', base, 'top') elif pos >= max_pos: right.add('Bot', base, 'bot') else: right.add('{0:0>.0f}%'.format(100.0 * pos / max_pos), base, 'percentage') else: right.add('0/0 All', base, 'all') def _print_result(self, result): self.win.move(0, 0) for part in result: self.color(*part.lst) self.addstr(str(part)) if self.settings.draw_progress_bar_in_status_bar: queue = self.fm.loader.queue states = [] for item in queue: if item.progressbar_supported: states.append(item.percent) if states: state = sum(states) / len(states) barwidth = state / 100.0 * self.wid self.color_at(0, 0, int(barwidth), ("in_statusbar", "loaded")) self.color_reset() def get_free_space(path): stat = os.statvfs(path) return stat.f_bavail * stat.f_frsize class Message(object): elapse = None text = None bad = False def __init__(self, text, duration, bad): self.text = text self.bad = bad self.elapse = time() + duration def is_alive(self): return time() <= self.elapse