Compare commits
No commits in common. "75201b189f256b1c995a2415f604d88e3cbf1114" and "cb180c409509ac513666893beff2dae18dbe81b9" have entirely different histories.
75201b189f
...
cb180c4095
2 changed files with 3 additions and 28 deletions
12
README.MD
12
README.MD
|
@ -27,18 +27,6 @@ or
|
||||||
```
|
```
|
||||||
it can also be run without any arguments to receive a i3bar compatible json string
|
it can also be run without any arguments to receive a i3bar compatible json string
|
||||||
|
|
||||||
## Tools
|
|
||||||
- `pingclock` performs a single `ping` to a server and returns the response time
|
|
||||||
- `battery` shows the current battery level
|
|
||||||
- `brightness` shows the current backlight level and gives options to adjust it
|
|
||||||
- `volume` shows the current volume level and gives options to adjust and manage it
|
|
||||||
- `date` shows the date
|
|
||||||
- `fuzzytime` shows the fuzzytime clock
|
|
||||||
- `wlan` shows the state of the wireless network interface. SSID connected to and signal level.
|
|
||||||
- `nic` shows the status and/or the ip address of the network interface card
|
|
||||||
- `temperature` shows the current CPU temperature
|
|
||||||
- `notes` a simple one liner note taking tool, displaying notes in dmenu/rofi
|
|
||||||
|
|
||||||
Personally, I have these bound to key combinations in i3. In fact, I have a seperate `bindsym` mode in which all these tools are accessible i.e. `$mod+i` to get to "info" mode then `p` to show pingclock.
|
Personally, I have these bound to key combinations in i3. In fact, I have a seperate `bindsym` mode in which all these tools are accessible i.e. `$mod+i` to get to "info" mode then `p` to show pingclock.
|
||||||
|
|
||||||
## You can also set the volume and brightness levels by typing a numeric figure into the dmenu/rofi input box
|
## You can also set the volume and brightness levels by typing a numeric figure into the dmenu/rofi input box
|
||||||
|
|
19
notes.nim
19
notes.nim
|
@ -20,7 +20,6 @@ proc read_notes(): seq[string] =
|
||||||
proc write_notes(notes: seq[string]) =
|
proc write_notes(notes: seq[string]) =
|
||||||
try:
|
try:
|
||||||
let f = open(note_file, fmWrite)
|
let f = open(note_file, fmWrite)
|
||||||
defer: f.close()
|
|
||||||
for note in notes:
|
for note in notes:
|
||||||
f.writeLine(note)
|
f.writeLine(note)
|
||||||
except:
|
except:
|
||||||
|
@ -44,16 +43,6 @@ proc write_note(note: string) =
|
||||||
except:
|
except:
|
||||||
echo "write_note, Unable to write note :", getCurrentExceptionMsg()
|
echo "write_note, Unable to write note :", getCurrentExceptionMsg()
|
||||||
|
|
||||||
proc replace_note(new_note: string, old_note: string) =
|
|
||||||
let notes = read_notes()
|
|
||||||
var new_notes: seq[string] = @[]
|
|
||||||
for a_note in notes:
|
|
||||||
if old_note == a_note:
|
|
||||||
new_notes.add(new_note)
|
|
||||||
else:
|
|
||||||
new_notes.add(a_note)
|
|
||||||
write_notes(new_notes)
|
|
||||||
|
|
||||||
proc get_notes(): (Info, seq[string]) =
|
proc get_notes(): (Info, seq[string]) =
|
||||||
var info = newInfo()
|
var info = newInfo()
|
||||||
info.title = "Notes :"
|
info.title = "Notes :"
|
||||||
|
@ -63,7 +52,7 @@ proc get_notes(): (Info, seq[string]) =
|
||||||
proc display_option_menu(option: string) =
|
proc display_option_menu(option: string) =
|
||||||
var select = newInfo()
|
var select = newInfo()
|
||||||
select.title = "Note :"
|
select.title = "Note :"
|
||||||
let args = concat(@[option],note_choices)
|
let args = concat(@["option"],note_choices)
|
||||||
let chosen = outputJSON(select,args)
|
let chosen = outputJSON(select,args)
|
||||||
if chosen in note_choices:
|
if chosen in note_choices:
|
||||||
case chosen:
|
case chosen:
|
||||||
|
@ -72,11 +61,9 @@ proc display_option_menu(option: string) =
|
||||||
start_notes()
|
start_notes()
|
||||||
of "back":
|
of "back":
|
||||||
start_notes()
|
start_notes()
|
||||||
elif chosen != "" and chosen != option:
|
|
||||||
replace_note(chosen, option)
|
|
||||||
display_option_menu(chosen)
|
|
||||||
else:
|
else:
|
||||||
display_option_menu(option)
|
write_note(option)
|
||||||
|
display_option_menu(chosen)
|
||||||
|
|
||||||
proc start_notes() =
|
proc start_notes() =
|
||||||
let (info,notes) = get_notes()
|
let (info,notes) = get_notes()
|
||||||
|
|
Loading…
Reference in a new issue