unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* How to create a service for contents of arbitrary file
@ 2021-04-07  4:11 Bone Baboon
  2021-04-07 11:12 ` Julien Lepiller
  0 siblings, 1 reply; 9+ messages in thread
From: Bone Baboon @ 2021-04-07  4:11 UTC (permalink / raw)
  To: help-guix

When I use a virtual terminal or Emacs on a virtual terminal using
`emacsclient --tty` I have a blinking cursor.  My preference is to not
have the cursor blink.  I can stop the cursor from blinking by manually
changing the contents of `/sys/class/graphics/fbcon/cursor_blink` to
"0".  I would like to create a service that manages the contents of
`/sys/class/graphics/fbcon/cursor_blink`.

I looked in "Services" as well as the "Defining Services" of the manual
for something similar to `etc-service-type` that allows for the file to
be in any location.

Any suggestions on how to make a service for this?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to create a service for contents of arbitrary file
  2021-04-07  4:11 How to create a service for contents of arbitrary file Bone Baboon
@ 2021-04-07 11:12 ` Julien Lepiller
  2021-04-07 14:12   ` Gary Johnson
  2021-04-08 23:46   ` Bone Baboon
  0 siblings, 2 replies; 9+ messages in thread
From: Julien Lepiller @ 2021-04-07 11:12 UTC (permalink / raw)
  To: help-guix, Bone Baboon

There's special-files-service-type described here: http://guix.gnu.org/manual/devel/en/html_node/Base-Services.html#Base-Services

However, I'm not sure it will work in /sys. I guess you'll have to try and report back :)

HTH!

Le 7 avril 2021 00:11:38 GMT-04:00, Bone Baboon <bone.baboon@disroot.org> a écrit :
>When I use a virtual terminal or Emacs on a virtual terminal using
>`emacsclient --tty` I have a blinking cursor.  My preference is to not
>have the cursor blink.  I can stop the cursor from blinking by manually
>changing the contents of `/sys/class/graphics/fbcon/cursor_blink` to
>"0".  I would like to create a service that manages the contents of
>`/sys/class/graphics/fbcon/cursor_blink`.
>
>I looked in "Services" as well as the "Defining Services" of the manual
>for something similar to `etc-service-type` that allows for the file to
>be in any location.
>
>Any suggestions on how to make a service for this?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to create a service for contents of arbitrary file
  2021-04-07 11:12 ` Julien Lepiller
@ 2021-04-07 14:12   ` Gary Johnson
  2021-04-08 23:26     ` Bone Baboon
  2021-04-08 23:46   ` Bone Baboon
  1 sibling, 1 reply; 9+ messages in thread
From: Gary Johnson @ 2021-04-07 14:12 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: Bone Baboon, help-guix

Bone Baboon <bone.baboon@disroot.org> writes:

> When I use a virtual terminal or Emacs on a virtual terminal using
> `emacsclient --tty` I have a blinking cursor.  My preference is to not
> have the cursor blink.

In addition to Julien's suggestion, I'll also point out that you can
tell Emacs to not use a blinking cursor by including this line in your
~/.emacs.d/init.el file:

(blink-cursor-mode 0)

Hope that helps,
  Gary

-- 
GPG Key ID: 7BC158ED
Use `gpg --search-keys lambdatronic' to find me
Protect yourself from surveillance: https://emailselfdefense.fsf.org
=======================================================================
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Why is HTML email a security nightmare? See https://useplaintext.email/

Please avoid sending me MS-Office attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to create a service for contents of arbitrary file
  2021-04-07 14:12   ` Gary Johnson
@ 2021-04-08 23:26     ` Bone Baboon
  0 siblings, 0 replies; 9+ messages in thread
From: Bone Baboon @ 2021-04-08 23:26 UTC (permalink / raw)
  To: Gary Johnson; +Cc: help-guix


Gary Johnson writes:
> In addition to Julien's suggestion, I'll also point out that you can
> tell Emacs to not use a blinking cursor by including this line in your
> ~/.emacs.d/init.el file:
>
> (blink-cursor-mode 0)

Thank you for pointing out `blink-cursor-mode` I am aware of it and
tested it.  When Emacs is started with `emacsclient --tty` from a
virtual terminal or a terminal emulator `blink-cursor-mode` does not
seem to do anything.  When I use a graphical Emacs `blink-cursor-mode`
does control the cursor blinking.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to create a service for contents of arbitrary file
  2021-04-07 11:12 ` Julien Lepiller
  2021-04-07 14:12   ` Gary Johnson
@ 2021-04-08 23:46   ` Bone Baboon
  2021-04-09  0:06     ` Julien Lepiller
  1 sibling, 1 reply; 9+ messages in thread
From: Bone Baboon @ 2021-04-08 23:46 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: help-guix


Julien Lepiller writes:

> There's special-files-service-type described here: http://guix.gnu.org/manual/devel/en/html_node/Base-Services.html#Base-Services
>
> However, I'm not sure it will work in /sys. I guess you'll have to try and report back :)

Thank you for this suggestion.

I added this to services in my system configuration:

```
(service special-files-service-type
  `(("/sys/class/graphics/fbcon/cursor_blink"
     "/home/user/no-blink"))
```

The contents of `home/user/no-blink` is "0".

When I run a system reconfiguration I get this error "guix system:
error: symlink: Operation not permitted:
"sys/class/graphics/fbcon/cursor_blink.new".

Any ideas on how to overcome this error?

The contents of `/sys/class/graphics/fbcon/cursor_blink` is reset to "1"
every time the computer is turned on and the cursor is blinking.  I
would like to get a service working that sets it to "0" so that I do not
need to manually change this setting every time I boot the computer.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to create a service for contents of arbitrary file
  2021-04-08 23:46   ` Bone Baboon
@ 2021-04-09  0:06     ` Julien Lepiller
  2021-04-10  4:18       ` Bone Baboon
  0 siblings, 1 reply; 9+ messages in thread
From: Julien Lepiller @ 2021-04-09  0:06 UTC (permalink / raw)
  To: Bone Baboon; +Cc: help-guix

I think this is because you cannot replace a file a /sys like guix tries to. Instead, it seems you can set a linux kernel argument on the command line run by grub at startup. According to the internet, that would be "vt.global_cursor_default=0"

You can set it up in your config by adding a kernel-arguments field to you operating-system declaration, like this:

(operating-system
  (kernel-arguments (cons "vt.global_cursor_default=0" %default-kernel-argumentt)))

Hope that helps!

Le 8 avril 2021 19:46:08 GMT-04:00, Bone Baboon <bone.baboon@disroot.org> a écrit :
>
>Julien Lepiller writes:
>
>> There's special-files-service-type described here:
>http://guix.gnu.org/manual/devel/en/html_node/Base-Services.html#Base-Services
>>
>> However, I'm not sure it will work in /sys. I guess you'll have to
>try and report back :)
>
>Thank you for this suggestion.
>
>I added this to services in my system configuration:
>
>```
>(service special-files-service-type
>  `(("/sys/class/graphics/fbcon/cursor_blink"
>     "/home/user/no-blink"))
>```
>
>The contents of `home/user/no-blink` is "0".
>
>When I run a system reconfiguration I get this error "guix system:
>error: symlink: Operation not permitted:
>"sys/class/graphics/fbcon/cursor_blink.new".
>
>Any ideas on how to overcome this error?
>
>The contents of `/sys/class/graphics/fbcon/cursor_blink` is reset to
>"1"
>every time the computer is turned on and the cursor is blinking.  I
>would like to get a service working that sets it to "0" so that I do
>not
>need to manually change this setting every time I boot the computer.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to create a service for contents of arbitrary file
  2021-04-09  0:06     ` Julien Lepiller
@ 2021-04-10  4:18       ` Bone Baboon
  2021-04-10 10:50         ` Julien Lepiller
  0 siblings, 1 reply; 9+ messages in thread
From: Bone Baboon @ 2021-04-10  4:18 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: help-guix

I have been able to execute this command
`echo "0" > /sys/class/graphics/fbcon/cursor_blink`
with a system that was using `runit` as it's initialization
system. The command was executed during stage 1 of runit's system
initialization. 
http://smarden.org/runit/runit.8.html

Is there an equivalent to runit's stage 1 for Shepherd?

Julien Lepiller writes:

> I think this is because you cannot replace a file a /sys like guix tries to. Instead, it seems you can set a linux kernel argument on the command line run by grub at startup. According to the internet, that would be "vt.global_cursor_default=0"
>
> You can set it up in your config by adding a kernel-arguments field to you operating-system declaration, like this:
>
> (operating-system
>   (kernel-arguments (cons "vt.global_cursor_default=0" %default-kernel-argumentt)))

Thank you for bringing this kernel argument to my attention.

It looks like there are three settings to choose from:
https://www.kernel.org/doc/html/v4.15/admin-guide/kernel-parameters.html

`-1` and `1` both are blinking cursors. `0` is no cursor at all.  The
challenge with no cursor at all is that it lacks the visual feedback of
where the cursor is located.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to create a service for contents of arbitrary file
  2021-04-10  4:18       ` Bone Baboon
@ 2021-04-10 10:50         ` Julien Lepiller
  2021-04-14 23:22           ` Bone Baboon
  0 siblings, 1 reply; 9+ messages in thread
From: Julien Lepiller @ 2021-04-10 10:50 UTC (permalink / raw)
  To: Bone Baboon; +Cc: help-guix

No, Shepherd doesn't have a notion of stages. You can make it run a command at startup by using a normal service though. I use one on my server to set up static networking with ipv4 and ipv6 by running iproute. See https://git.lepiller.eu/system-configuration/tree/-/modules/config/network.scm

Maybe there's another kernel argument you could use?

Le 10 avril 2021 00:18:48 GMT-04:00, Bone Baboon <bone.baboon@disroot.org> a écrit :
>I have been able to execute this command
>`echo "0" > /sys/class/graphics/fbcon/cursor_blink`
>with a system that was using `runit` as it's initialization
>system. The command was executed during stage 1 of runit's system
>initialization. 
>http://smarden.org/runit/runit.8.html
>
>Is there an equivalent to runit's stage 1 for Shepherd?
>
>Julien Lepiller writes:
>
>> I think this is because you cannot replace a file a /sys like guix
>tries to. Instead, it seems you can set a linux kernel argument on the
>command line run by grub at startup. According to the internet, that
>would be "vt.global_cursor_default=0"
>>
>> You can set it up in your config by adding a kernel-arguments field
>to you operating-system declaration, like this:
>>
>> (operating-system
>>   (kernel-arguments (cons "vt.global_cursor_default=0"
>%default-kernel-argumentt)))
>
>Thank you for bringing this kernel argument to my attention.
>
>It looks like there are three settings to choose from:
>https://www.kernel.org/doc/html/v4.15/admin-guide/kernel-parameters.html
>
>`-1` and `1` both are blinking cursors. `0` is no cursor at all.  The
>challenge with no cursor at all is that it lacks the visual feedback of
>where the cursor is located.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to create a service for contents of arbitrary file
  2021-04-10 10:50         ` Julien Lepiller
@ 2021-04-14 23:22           ` Bone Baboon
  0 siblings, 0 replies; 9+ messages in thread
From: Bone Baboon @ 2021-04-14 23:22 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: help-guix


Julien Lepiller writes:

> No, Shepherd doesn't have a notion of stages. You can make it run a command at startup by using a normal service though. I use one on my server to set up static networking with ipv4 and ipv6 by running iproute. See https://git.lepiller.eu/system-configuration/tree/-/modules/config/network.scm

Thank you for sharing this example.

> Maybe there's another kernel argument you could use?

I have searched for one but have not found it yet.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-04-14 23:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07  4:11 How to create a service for contents of arbitrary file Bone Baboon
2021-04-07 11:12 ` Julien Lepiller
2021-04-07 14:12   ` Gary Johnson
2021-04-08 23:26     ` Bone Baboon
2021-04-08 23:46   ` Bone Baboon
2021-04-09  0:06     ` Julien Lepiller
2021-04-10  4:18       ` Bone Baboon
2021-04-10 10:50         ` Julien Lepiller
2021-04-14 23:22           ` Bone Baboon

unofficial mirror of help-guix@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guix-user/0 guix-user/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-user guix-user/ https://yhetil.org/guix-user \
		help-guix@gnu.org
	public-inbox-index guix-user

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.user
	nntp://news.gmane.io/gmane.comp.gnu.guix.user


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git