-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththemefinder.py
50 lines (34 loc) · 1.03 KB
/
themefinder.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import os
import menu
import paramiko
#print ("Testing dir list:")
#print(os.listdir("Themes"))
def ListThemes():
themes = os.listdir("Themes")
return themes
def themePicker():
options = ListThemes()
print (options)
choice = menu.main_menu(options)
return choice
def applyTheme(ip,username,password,theme):
# Paths for moving the file
source_path = f"Themes/{theme}/suspended.png"
print (source_path)
destination_path = "/usr/share/remarkable/suspended.png"
# Create an SSH client
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
try:
# Connect to the remote server
ssh.connect(ip, "22", username, password)
# Create an SFTP session
sftp = ssh.open_sftp()
sftp.put(source_path, destination_path)
print(f"File moved from {source_path} to {destination_path}")
# Close the SFTP session
sftp.close()
finally:
# Close the SSH connection
ssh.close()
#themePicker()