Compare commits

...

3 Commits

14 changed files with 117 additions and 61 deletions

View File

@@ -1,19 +1,23 @@
---
# Default settings for amethyst # Default settings for amethyst
# Repo: `https://github.com/ianyh/Amethyst` # Repo: `https://github.com/ianyh/Amethyst`
# #
# Note due to issue 1419 (https://github.com/ianyh/Amethyst/issues/1419) some # Note due to issue 1419 (https://github.com/ianyh/Amethyst/issues/1419) some
# config values may conflict and not work if they are the same as the default # config values may conflict and not work if they are the same as the default
# values for amathyst. You can see these values on github at # values for amathyst. You can see these values on GitHub at
# https://github.com/ianyh/Amethyst/blob/development/Amethyst/default.amethyst # https://github.com/ianyh/Amethyst/blob/development/Amethyst/default.amethyst
# If you're experiencing conflicts and the settings are the same as the default, # If you're experiencing conflicts and the settings are the same as the default,
# comment out the commands in this file. # comment out the commands in this file.
# #
# Move this file to: `~/.amethyst.yml` # Move this file to: `~/.amethyst.yml`
# In order to register changes restart Amethyst. # In order to register changes restart Amethyst.
# If you experience issues pulling in the changes you can also quit Amethyst and run: `defaults delete com.amethyst.Amethyst.plist` # If you experience issues pulling in the changes you can also
# This removes the current preferences and causes Amethyst to restart with default preferences and pull configs from this file. # quit Amethyst and run: `defaults delete com.amethyst.Amethyst.plist`
# This removes the current preferences and causes Amethyst to restart
# with default preferences and pull configs from this file.
# layouts - Ordered list of layouts to use by layout key (default tall, wide, fullscreen, and column). # layouts - Ordered list of layouts to use by layout key
# (default tall, wide, fullscreen, and column).
layouts: layouts:
- bsp - bsp
- tall - tall
@@ -71,39 +75,49 @@ cycle-layout-backward:
mod: mod2 mod: mod2
key: space key: space
# Shrink the main pane by a percentage of the screen dimension as defined by window-resize-step. Note that not all layouts respond to this command. # Shrink the main pane by a percentage of the screen
# dimension as defined by window-resize-step.
# Note that not all layouts respond to this command.
shrink-main: shrink-main:
mod: mod1 mod: mod1
key: h key: h
# Expand the main pane by a percentage of the screen dimension as defined by window-resize-step. Note that not all layouts respond to this command. # Expand the main pane by a percentage of the screen dimension
# as defined by window-resize-step. Note that not all layouts
# respond to this command.
expand-main: expand-main:
mod: mod1 mod: mod1
key: l key: l
# Increase the number of windows in the main pane. Note that not all layouts respond to this command. # Increase the number of windows in the main pane.
# Note that not all layouts respond to this command.
increase-main: increase-main:
mod: mod1 mod: mod1
key: ',' key: ','
# Decrease the number of windows in the main pane. Note that not all layouts respond to this command. # Decrease the number of windows in the main pane.
# Note that not all layouts respond to this command.
decrease-main: decrease-main:
mod: mod1 mod: mod1
key: '.' key: '.'
# General purpose command for custom layouts. Functionality is layout-dependent. # General purpose command for custom layouts.
# Functionality is layout-dependent.
# command1: # command1:
# mod: <NONE> # mod: <NONE>
# key: <NONE> # key: <NONE>
# General purpose command for custom layouts. Functionality is layout-dependent. # General purpose command for custom layouts.
# Functionality is layout-dependent.
# command2: # command2:
# mod: <NONE> # mod: <NONE>
# key: <NONE> # key: <NONE>
# General purpose command for custom layouts. Functionality is layout-dependent. # General purpose command for custom layouts.
# Functionality is layout-dependent.
# command3: # command3:
# mod: <NONE> # mod: <NONE>
# key: <NONE> # key: <NONE>
# General purpose command for custom layouts. Functionality is layout-dependent. # General purpose command for custom layouts.
# Functionality is layout-dependent.
# command4: # command4:
# mod: <NONE> # mod: <NONE>
# key: <NONE> # key: <NONE>
@@ -133,42 +147,51 @@ focus-screen-cw:
mod: mod1 mod: mod1
key: n key: n
# Move the currently focused window onto the next screen in the list going counter-clockwise. # Move the currently focused window onto the next
# screen in the list going counter-clockwise.
swap-screen-ccw: swap-screen-ccw:
mod: mod2 mod: mod2
key: h key: h
# Move the currently focused window onto the next screen in the list going clockwise. # Move the currently focused window onto the next
# screen in the list going clockwise.
swap-screen-cw: swap-screen-cw:
mod: mod2 mod: mod2
key: l key: l
# Swap the position of the currently focused window with the next window in the list going counter-clockwise. # Swap the position of the currently focused window with
# the next window in the list going counter-clockwise.
swap-ccw: swap-ccw:
mod: mod2 mod: mod2
key: j key: j
# Swap the position of the currently focused window with the next window in the list going clockwise. # Swap the position of the currently focused window with
# the next window in the list going clockwise.
swap-cw: swap-cw:
mod: mod2 mod: mod2
key: k key: k
# Swap the position of the currently focused window with the main window in the list. # Swap the position of the currently focused window
# with the main window in the list.
swap-main: swap-main:
mod: mod1 mod: mod1
key: enter key: enter
# Move focus to the n-th screen in the list; e.g., focus-screen-3 will move mouse focus to the 3rd screen. Note that the main window in the given screen will be focused. # Move focus to the n-th screen in the list; e.g.,
# focus-screen-3 will move mouse focus to the 3rd screen.
# Note that the main window in the given screen will be focused.
#focus-screen-n: #focus-screen-n:
# focus-screen-<screen-number>: # focus-screen-<screen-number>:
# mod: mod1 # mod: mod1
# key: y # key: y
# Move the currently focused window to the n-th screen; e.g., throw-screen-3 will move the window to the 3rd screen. # Move the currently focused window to the n-th screen;
# e.g., throw-screen-3 will move the window to the 3rd screen.
# throw-screen-n: # throw-screen-n:
# throw-screen-<screen-number>: # throw-screen-<screen-number>:
# mod: mod1 # mod: mod1
# key: u # key: u
# Move the currently focused window to the n-th space; e.g., throw-space-3 will move the window to the 3rd space. # Move the currently focused window to the n-th space;
# e.g., throw-space-3 will move the window to the 3rd space.
# throw-space-<screen-number>: # throw-space-<screen-number>:
# mod: mod1 # mod: mod1
# key: i # key: i
@@ -203,7 +226,9 @@ throw-space-right:
mod: mod2 mod: mod2
key: right key: right
# Toggle the floating state of the currently focused window; i.e., if it was floating make it tiled and if it was tiled make it floating. # Toggle the floating state of the currently focused window;
# i.e., if it was floating make it tiled and if it was
# tiled make it floating.
toggle-float: toggle-float:
mod: mod1 mod: mod1
key: t key: t
@@ -236,10 +261,13 @@ relaunch-amethyst:
# disable screen padding on builtin display # disable screen padding on builtin display
disable-padding-on-builtin-display: false disable-padding-on-builtin-display: false
# Boolean flag for whether or not to add margins betwen windows (default false). # Boolean flag for whether to add margins between
# windows (default false).
window-margins: false window-margins: false
# Boolean flag for whether or not to set window margins if there is only one window on the screen, assuming window margins are enabled (default false). # Boolean flag for whether to set window margins if there is
# only one window on the screen, assuming window margins
# are enabled (default false).
smart-window-margins: true smart-window-margins: true
# # Add 10px margin between windows # # Add 10px margin between windows
@@ -248,39 +276,53 @@ smart-window-margins: true
# The size of the margins between windows (in px, default 0). # The size of the margins between windows (in px, default 0).
window-margin-size: 0 window-margin-size: 0
# The max number of windows that may be visible on a screen at one time before # The max number of windows that may be visible on a screen
# additional windows are minimized. A value of 0 disables the feature. # at one time before additional windows are minimized.
# A value of 0 disables the feature.
window-max-count: 0 window-max-count: 0
# The smallest height that a window can be sized to regardless of its layout frame (in px, default 0). # The smallest height that a window can be sized to
# regardless of its layout frame (in px, default 0).
window-minimum-height: 0 window-minimum-height: 0
# The smallest width that a window can be sized to regardless of its layout frame (in px, default 0) # The smallest width that a window can be sized to
# regardless of its layout frame (in px, default 0)
window-minimum-width: 0 window-minimum-width: 0
# List of bundle identifiers for applications to either be automatically floating or automatically tiled based on floating-is-blacklist (default []). # List of bundle identifiers for applications to either be automatically
# floating or automatically tiled based on floating-is-blacklist (default []).
floating: [] floating: []
# Boolean flag determining behavior of the floating list. # Boolean flag determining behavior of the floating list.
# true if the applications should be floating and all others tiled. false if the applications should be tiled and all others floating (default true). # true if the applications should be floating and all others tiled.
# false if the applications should be tiled and all others floating (default true).
floating-is-blacklist: false floating-is-blacklist: false
# true if screen frames should exclude the status bar. false if the screen frames should include the status bar (default false). # true if screen frames should exclude the status bar.
# false if the screen frames should include the status bar (default false).
ignore-menu-bar: false ignore-menu-bar: false
# true if windows smaller than a 500px square should be floating by default (default true) # true if windows smaller than a 500px square should
# be floating by default (default true)
float-small-windows: true float-small-windows: true
# true if the mouse should move position to the center of a window when it becomes focused (default false). Note that this is largely incompatible with focus-follows-mouse. # true if the mouse should move position to the center of a window
# when it becomes focused (default false).
# Note that this is largely incompatible with focus-follows-mouse.
mouse-follows-focus: false mouse-follows-focus: false
# true if the windows underneath the mouse should become focused as the mouse moves (default false). Note that this is largely incompatible with mouse-follows-focus # true if the windows underneath the mouse should become focused as
# the mouse moves (default false). Note that this is largely
# incompatible with mouse-follows-focus
focus-follows-mouse: false focus-follows-mouse: false
# true if dragging and dropping windows on to each other should swap their positions (default false). # true if dragging and dropping windows on to each other
# should swap their positions (default false).
mouse-swaps-windows: true mouse-swaps-windows: true
# true if changing the frame of a window with the mouse should update the layout to accommodate the change (default false). Note that not all layouts will be able to respond to the change. # true if changing the frame of a window with the mouse should update the
# layout to accommodate the change (default false).
# Note that not all layouts will be able to respond to the change.
mouse-resizes-windows: true mouse-resizes-windows: true
# true to display the name of the layout when a new layout is selected (default true). # true to display the name of the layout when a new layout is selected (default true).
@@ -292,13 +334,15 @@ enables-layout-hud-on-space-change: true
# true to get updates to beta versions of the software (default false). # true to get updates to beta versions of the software (default false).
use-canary-build: false use-canary-build: false
# true to insert new windows into the first position and false to insert new windows into the last position (default false). # true to insert new windows into the first position and
# false to insert new windows into the last position (default false).
new-windows-to-main: false new-windows-to-main: false
# true to automatically move to a space when throwing a window to it (default true). # true to automatically move to a space when throwing a window to it (default true).
follow-space-thrown-windows: true follow-space-thrown-windows: true
# The integer percentage of the screen dimension to increment and decrement main pane ratios by (default 5). # The integer percentage of the screen dimension to increment
# and decrement main pane ratios by (default 5).
window-resize-step: 5 window-resize-step: 5
# Padding to apply between windows and the left edge of the screen (in px, default 0). # Padding to apply between windows and the left edge of the screen (in px, default 0).

View File

@@ -1,3 +1,4 @@
---
# The editor to use with 'cheat -e <sheet>'. Defaults to $EDITOR or $VISUAL. # The editor to use with 'cheat -e <sheet>'. Defaults to $EDITOR or $VISUAL.
# editor: $EDITOR # editor: $EDITOR
@@ -37,7 +38,7 @@ pager: less -FRX
# #
# This is very useful when you would like to maintain, for example, a # This is very useful when you would like to maintain, for example, a
# "pristine" repository of community cheatsheets on one cheatpath, and an # "pristine" repository of community cheatsheets on one cheatpath, and an
# editable personal reponsity of cheatsheets on another cheatpath. # editable personal repository of cheatsheets on another cheatpath.
# #
# Cheatpaths can be also configured to automatically apply tags to cheatsheets # Cheatpaths can be also configured to automatically apply tags to cheatsheets
# on certain paths, which can be useful for querying purposes. # on certain paths, which can be useful for querying purposes.

View File

@@ -1,3 +1,4 @@
---
check_for_updates: true check_for_updates: true
excluded_labels: excluded_labels:
- maintenance - maintenance

View File

@@ -1,2 +1,3 @@
---
git_protocol: https git_protocol: https
version: '1' version: '1'

View File

@@ -1,3 +1,4 @@
---
github.com: github.com:
git_protocol: https git_protocol: https
users: users:

View File

@@ -18,3 +18,4 @@ composer.phar
wp_*.sh wp_*.sh
auth.json auth.json
dfm.sh dfm.sh
.scannerwork

View File

@@ -1,3 +1,4 @@
---
wtf: wtf:
colors: colors:
background: black background: black

View File

@@ -1,3 +1,4 @@
---
- include: 'tools/dotbot-defaults.yaml' - include: 'tools/dotbot-defaults.yaml'
- shell: - shell:
- echo "Configuring air" - echo "Configuring air"

View File

@@ -1,3 +1,4 @@
---
- include: 'tools/dotbot-defaults.yaml' - include: 'tools/dotbot-defaults.yaml'
- shell: - shell:
- echo "Configuring lakka" - echo "Configuring lakka"

View File

@@ -1,3 +1,4 @@
---
- include: 'tools/dotbot-defaults.yaml' - include: 'tools/dotbot-defaults.yaml'
- shell: - shell:
- echo "Configuring tunkki" - echo "Configuring tunkki"

View File

@@ -1,3 +1,4 @@
---
- include: 'tools/dotbot-defaults.yaml' - include: 'tools/dotbot-defaults.yaml'
- shell: - shell:
- echo "Configuring v" - echo "Configuring v"

View File

@@ -1,3 +1,4 @@
---
- include: 'tools/dotbot-defaults.yaml' - include: 'tools/dotbot-defaults.yaml'
- clean: - clean:
~/: ~/:

View File

@@ -42,26 +42,26 @@ sortByOnDiskSize = False
class Blob(object): class Blob(object):
sha1 = '' sha1 = ''
size = 0 size = 0
packedSize = 0 packed_size = 0
path = '' path = ''
def __init__(self, line): def __init__(self, line):
cols = line.split() cols = line.split()
self.sha1, self.size, self.packedSize = cols[0], int(cols[2]), int(cols[3]) self.sha1, self.size, self.packed_size = cols[0], int(cols[2]), int(cols[3])
def __repr__(self): def __repr__(self):
return '{} - {} - {} - {}'.format( return '{} - {} - {} - {}'.format(
self.sha1, self.size, self.packedSize, self.path) self.sha1, self.size, self.packed_size, self.path)
def __lt__(self, other): def __lt__(self, other):
if (sortByOnDiskSize): if (sortByOnDiskSize):
return self.size < other.size return self.size < other.size
else: else:
return self.packedSize < other.packedSize return self.packed_size < other.packed_size
def csv_line(self): def csv_line(self):
return "{},{},{},{}".format( return "{},{},{},{}".format(
self.size/1024, self.packedSize/1024, self.sha1, self.path) self.size/1024, self.packed_size/1024, self.sha1, self.path)
def main(): def main():
@@ -71,45 +71,45 @@ def main():
args = parse_arguments() args = parse_arguments()
sortByOnDiskSize = args.sortByOnDiskSize sortByOnDiskSize = args.sortByOnDiskSize
sizeLimit = 1024*args.filesExceeding size_limit = 1024*args.filesExceeding
if args.filesExceeding > 0: if args.filesExceeding > 0:
print("Finding objects larger than {}kB…".format(args.filesExceeding)) print("Finding objects larger than {}kB…".format(args.filesExceeding))
else: else:
print("Finding the {} largest objects…".format(args.matchCount)) print("Finding the {} largest objects…".format(args.matchCount))
blobs = get_top_blobs(args.matchCount, sizeLimit) blobs = get_top_blobs(args.matchCount, size_limit)
populate_blob_paths(blobs) populate_blob_paths(blobs)
print_out_blobs(blobs) print_out_blobs(blobs)
def get_top_blobs(count, sizeLimit): def get_top_blobs(count, size_limit):
"""Get top blobs from git repository """Get top blobs from git repository
Args: Args:
count (int): How many items to return count (int): How many items to return
sizeLimit (int): What is the size limit size_limit (int): What is the size limit
Returns: Returns:
dict: Dictionary of Blobs dict: Dictionary of Blobs
""" """
sortColumn = 4 sort_column = 4
if sortByOnDiskSize: if sortByOnDiskSize:
sortColumn = 3 sort_column = 3
verifyPack = "git verify-pack -v `git rev-parse --git-dir`/objects/pack/pack-*.idx | grep blob | sort -k{}nr".format(sortColumn) # noqa: E501 verify_pack = "git verify-pack -v `git rev-parse --git-dir`/objects/pack/pack-*.idx | grep blob | sort -k{}nr".format(sort_column) # noqa: E501
output = check_output(verifyPack, shell=True).decode('utf-8').strip().split("\n")[:-1] # noqa: E501 output = check_output(verify_pack, shell=True).decode('utf-8').strip().split("\n")[:-1] # noqa: E501
blobs = dict() blobs = dict()
# use __lt__ to do the appropriate comparison # use __lt__ to do the appropriate comparison
compareBlob = Blob("a b {} {} c".format(sizeLimit, sizeLimit)) compare_blob = Blob("a b {} {} c".format(size_limit, size_limit))
for objLine in output: for obj_line in output:
blob = Blob(objLine) blob = Blob(obj_line)
if sizeLimit > 0: if size_limit > 0:
if compareBlob < blob: if compare_blob < blob:
blobs[blob.sha1] = blob blobs[blob.sha1] = blob
else: else:
break break
@@ -132,8 +132,8 @@ def populate_blob_paths(blobs):
print("Finding object paths…") print("Finding object paths…")
# Only include revs which have a path. Other revs aren't blobs. # Only include revs which have a path. Other revs aren't blobs.
revList = "git rev-list --all --objects | awk '$2 {print}'" rev_list = "git rev-list --all --objects | awk '$2 {print}'"
all_object_lines = check_output(revList, shell=True).decode('utf-8').strip().split("\n")[:-1] # noqa: E501 all_object_lines = check_output(rev_list, shell=True).decode('utf-8').strip().split("\n")[:-1] # noqa: E501
outstanding_keys = list(blobs.keys()) outstanding_keys = list(blobs.keys())
for line in all_object_lines: for line in all_object_lines:
@@ -151,16 +151,16 @@ def populate_blob_paths(blobs):
def print_out_blobs(blobs): def print_out_blobs(blobs):
if len(blobs): if len(blobs):
csvLines = ["size,pack,hash,path"] csv_lines = ["size,pack,hash,path"]
for blob in sorted(blobs.values(), reverse=True): for blob in sorted(blobs.values(), reverse=True):
csvLines.append(blob.csv_line()) csv_lines.append(blob.csv_line())
command = ["column", "-t", "-s", ","] command = ["column", "-t", "-s", ","]
p = Popen(command, stdin=PIPE, stdout=PIPE, stderr=PIPE) p = Popen(command, stdin=PIPE, stdout=PIPE, stderr=PIPE)
# Encode the input as bytes # Encode the input as bytes
input_data = ("\n".join(csvLines) + "\n").encode() input_data = ("\n".join(csv_lines) + "\n").encode()
stdout, _ = p.communicate(input_data) stdout, _ = p.communicate(input_data)

View File

@@ -1,3 +1,4 @@
---
- defaults: - defaults:
create: create:
mode: 0755 mode: 0755