Ejemplo n.º 1
0
def main():
    if len(sys.argv) == 1:
        text = os.getcwd()
    else:
        text = os.path.join(os.getcwd(), sys.argv[1])

    text = text.replace(' ', r'\ ')
    print('# copied to the clipboard', file=sys.stderr)
    print(text)
    text_to_clipboards(text)
Ejemplo n.º 2
0
def main():
    if len(sys.argv) == 1:
        text = os.getcwd()
    else:
        text = os.path.join(os.getcwd(), sys.argv[1])

    text = text.replace(' ', r'\ ')
    print('# copied to the clipboard', file=sys.stderr)
    print(text)
    text_to_clipboards(text)
Ejemplo n.º 3
0
def main():
    normal = False
    if "-n" in sys.argv:
        normal = True
        sys.argv.remove("-n")

    if len(sys.argv) == 1:
        text = os.getcwd()
    else:
        text = os.path.join(os.getcwd(), sys.argv[1])

    if not normal:
        text = text.replace(' ', r'\ ')
    print('# copied to the clipboard', file=sys.stderr)
    print(text)
    text_to_clipboards(text)
Ejemplo n.º 4
0
def main():
    normal = False
    if "-n" in sys.argv:
        normal = True
        sys.argv.remove("-n")

    if len(sys.argv) == 1:
        text = os.getcwd()
    else:
        text = os.path.join(os.getcwd(), sys.argv[1])

    if not normal:
        text = text.replace(' ', r'\ ')
    print('# copied to the clipboard', file=sys.stderr)
    print(text)
    text_to_clipboards(text)
Ejemplo n.º 5
0
def main():
    text = os.path.split(os.getcwd())[1]
    print('# copied to the clipboard', file=sys.stderr)
    print(text)
    text_to_clipboards(text)
Ejemplo n.º 6
0
def main():
    text = os.path.split(os.getcwd())[1]
    print('# copied to the clipboard', file=sys.stderr)
    print(text)
    text_to_clipboards(text)
Ejemplo n.º 7
0
def toClipboard():
    top.destroy()
    mergedstring = ''.join(stringtobecopied)
    tocb.text_to_clipboards(mergedstring)
    triggerClipboard()
    subprocess.call(['xsel', '-bc'])
Ejemplo n.º 8
0
#!/usr/bin/env python

# Website: https://ubuntuincident.wordpress.com/2011/03/17/show-the-absolute-path-of-a-file/
# Laszlo Szathmary, 2011 ([email protected])
#
# NEW! The path is also copied to the clipboard.
#
# Print the absolute path of a file.
# If no parameter is passed, show the current path.
# sp.py -> "show path"
#
# Usage: sp <filename>

import os
import sys
from tocb import text_to_clipboards

if len(sys.argv) == 1:
    text = os.getcwd()
else:
    text = os.path.join(os.getcwd(), sys.argv[1])

text = text.replace(' ', r'\ ')
print '# copied to the clipboard'
print text
text_to_clipboards(text)