Pnote 0.2 - desktop notepad

Window managers, icon programs, widgets, etc.
Message
Author
User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

Pnote 0.2 - desktop notepad

#1 Post by zigbert »

Pnote

Pnote is a simple notepad where you can write things that drops into your mind. - nothing new.....

What is different from other pads, is the way to use it in combination with JWM. 'Throw' your mouse-pointer into the upper-left corner of the screen, and Pnote will show up. It autohides when not in use. To get this feature working, it must be set up to as a unique tray calling 'pnote'. My extended tray configuration looks like this

Code: Select all

<JWM>
 <Tray autohide="true" insert="right" border="0" layer="10" halign="left" valign="top" height="0" layout="horizontal" >
  <Swallow name="pnote">
   pnote
  </Swallow>
 </Tray>
</JWM>
Pnote is a integrated part of DuDE (starDust Desktop Environment), and configures via Pcorner. It will show up in DuDE-0.2.
It can also be used as a standalone app.

Image

Download
username: puppy
password: linux

Pnote-0.2 (1 kb)


Sigmund Berglund
Last edited by zigbert on Thu 04 Nov 2010, 17:32, edited 3 times in total.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#2 Post by jpeps »

--a bit temperamental on my Dell D600 getting it to load from the desktop with a pointer (flickers about 5 times before finally getting it--sometimes worse). It loads much easier if there's a browser or something already filling the window. A hot key is far more reliable.

It might be more useful if it didn't fill the entire column. I once used a transparent vim as a writable desktop that didn't block anything out.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#3 Post by zigbert »

Improved for the upcoming DuDE-0.2.

The reason for posting it here is not because of Pnotes brilliance, but because it shows a new way of using JWM.


Sigmund

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#4 Post by jpeps »

I hoping it can copy to clipboard.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#5 Post by zigbert »

jpeps
The way it is set up now it can only paste from clipboard. - Simply because you quit Pnote at once mouse-pointer leaves the yellow pad.

To copy to clipboard, Pnote must be running when pasting. This could be solved by running Pnote inside a tray (like xvkbd), but the downside is
- no delay before showing app.
- All left side of screen would become activating area for Pote - very annoying (I think).


Sigmund

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#6 Post by jpeps »

I like the version within the gtkdialog window; being able to copy/paste contents is huge plus.

Edit: I substituted in the gtkdialog window version after (after pasting in the necessary code) with dude-0.2. Works great.

Code: Select all

#!/bin/sh
VERSION=0.1

#jwmrc-trayX calls this activation area
if [ "$PAR" = "-m" ]; then #set mouse activation area of tray
export Pnotetray='
	<window width-request="30" height-request="1">
	 <text><label>ok</label></text>
 	 <action signal="focus-in-event">pnote -m2 &</action>
 	 <action signal="enter-notify-event">pnote -m2 &</action>
 	</window>'
	gtkdialog3 -p Pnotetray --name=pnotetray
	exit 0
fi

	#delay to see if user really wants Pnote to appear
#if mouse is still in upper-left corner
if [ "$PAR" = "-m2" ]; then
      sleep 0.3 
        [ `getcurpos | cut -d' ' -f1` -gt 5 ] && exit
        [ `getcurpos | cut -d' ' -f2` -gt 30 ] && exit
        #exit if already running
        TMP="`ps`"
        [ "`echo "$TMP" | grep 'Pnote '`" ] && exit
fi

#exit if already running
												
#set gtk-theme
echo 'style "menu" {
  font_name            = "DejaVu sans italic 14"
  bg[NORMAL]         = "#FFF4AF"
  base[NORMAL]         = "#FFF4AF"
  text[NORMAL]         = "#222222"
  }
class "*t*" style "menu"' > /tmp/gtkrc
export GTK2_RC_FILES=/tmp/gtkrc:/root/.gtkrc-2.0

[ ! -d $HOME/.stardust ] && mkdir $HOME/.stardust

export Pnote='
<window width-request="330" height-request="600">
 <edit left-margin="10"><variable>PAD</variable><input file>'$HOME'/.stardust/pnote</input></edit>
 <action signal="leave-notify-event">echo "$PAD" > $HOME/.stardust/pnote</action>
</window>'
gtkdialog3 -p Pnote --name=pnote

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#7 Post by technosaurus »

Kiosk mode

Code: Select all

<Tray x="0" y="0">
	<Swallow name="seamonkey-bin">
		seamonkey
	</Swallow>
</Tray>
put it after your main tray in .jwmrc-tray to cover it or before to go under it

you can also set the x & y position to place a small window in the desktop and also have a clickable tray button label to one side (or above/below with align="vertical")... for something like a calendar or various parts of pwidgets... I haven't tried the translucent trays in a while but that may appeal to others using this technique
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#8 Post by jpeps »

Pnote is rapidly becoming indispensable in my use of the desktop (although I need the cut & paste version). One of those seeming simple yet GREAT ideas......

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#9 Post by seaside »

jpeps,

If you put the following line of code just before the "exit" line, it will paste the pad contents to the clipboard.

Code: Select all

  <action signal="focus-out-event">echo "$PAD" | xclip -i -selection clipboard</action>
(I wonder how yellow became a standard for notetaking) :D

Cheers,
s

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#10 Post by jpeps »

seaside wrote:jpeps,

If you put the following line of code just before the "exit" line, it will paste the pad contents to the clipboard.
That works; although I kindof like the look and feel of the window..so you don't have to kill from the task bar.

(I wonder how yellow became a standard for notetaking) :D
Hey..be creative.. #FFC18C ??

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#11 Post by jpeps »

Script for changing Pnote colors:

Code: Select all

#!/bin/sh

## Changes background colors in Pnote 

PNOTE="/usr/sbin/pnote"
OLD=`grep -E 'bg' $PNOTE | cut -f2 -d\"`
echo "enter number: 1 Yellow, 2 Pink, 3 Purple, 4 Gray"
read Choice
case $Choice in
  "1" )  sed -i "s/${OLD}/#FFF4AF/g" ${PNOTE} ;;
  "2" )  sed -i "s/${OLD}/#FFC18C/g" ${PNOTE} ;;
  "3" )  sed -i "s/${OLD}/#BD8787/g" ${PNOTE} ;;
  "4" )  sed -i "s/${OLD}/#B7AFF/g" ${PNOTE} ;;
esac

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#12 Post by technosaurus »

I wanted to put this other ptray related idea out to you in case I forget before I get home.

swallowing a gtkdialog entrybox something like (there is probably something better than gtkdialog for this??)

...tooltip="Enter a URL">ENTRY ...

defaultbrowser $ENTRY


similar for running programs instead of gexec

...tooltip="Enter a program">ENTRY

$ENTRY

(or I guess you could always swallow rxvt using its inbuilt geometry)

... I guess they could easily be pwidgets too ...
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#13 Post by zigbert »

seaside wrote:

Code: Select all

  <action signal="focus-out-event">echo "$PAD" | xclip -i -selection clipboard</action>
Great stuff. Included for next release.


Thank you
Sigmund

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#14 Post by zigbert »

Version 0.2
See main post

This is the improved version used in DuDE 0.2. It also includes:
- Paste content of Pnote. (thanks to seaside)
- Pnote can use different colors of background/font (thanks to jpeps)

Be aware that the integration of jwm has changed and become much simpler (see jwm-config example in main post).

The next challenge is to wrap the text ??????


Sigmund

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#15 Post by zigbert »

technosaurus wrote:I wanted to put this other ptray related idea out to you in case I forget before I get home.

swallowing a gtkdialog entrybox something like (there is probably something better than gtkdialog for this??)

...tooltip="Enter a URL">ENTRY ...

defaultbrowser $ENTRY


similar for running programs instead of gexec

...tooltip="Enter a program">ENTRY

$ENTRY

(or I guess you could always swallow rxvt using its inbuilt geometry)

... I guess they could easily be pwidgets too ...
Sounds more like Ptray than Pwidgets to me........


Sigmund

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#16 Post by zigbert »

technosaurusHave you tested this idea? I can't see how the field can get focus after another window has been opened.


Sigmund

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#17 Post by technosaurus »

That's what I ran into too, so I guess that is out unless there is some way to grab focus....I'm not complaining though, since this is what makes the keyboard work so nicely.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#18 Post by jpeps »

zigbert wrote:
seaside wrote:

Code: Select all

  <action signal="focus-out-event">echo "$PAD" | xclip -i -selection clipboard</action>
Great stuff. Included for next release.


Thank you
Sigmund
To be able to paste into a terminal, vim, etc., I think pnote has to be open..which happens if "check exit" action is removed.

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#19 Post by seaside »

I'm wondering if it's worthwhile to have the clipboard action be the default.

If you didn't realize that just leaving the window would wipe out something specifically placed earlier on the clipboard, it might be confusing.

I know it was my suggestion, but perhaps better for a specific use as an option. :D

jpeps- Yes, the selection buffer is used to paste into terminals.

Cheers,
s

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#20 Post by jpeps »

Windowed version gets both the selection buffer & traditional clipboard.
Attachments
pnote-gray.png
(150.79 KiB) Downloaded 788 times

Post Reply